text:
// cucumber.js
// const dotenv = require('dotenv');
const os = require("os");
// dotenv.config();

/**
 *
 * Configures Cucumber
 *
 * Sets up the required stuff to make React code operate nicely in a Node environment
 *
 * Source: https://medium.com/@Charles_Stover/behavior-driven-react-development-with-cucumber-faf596d9d71b
 *
 */
const CPU_COUNT = os.cpus().length;
const IS_DEV = process.env.NODE_ENV === "development";
const FAIL_FAST = IS_DEV ? ["--fail-fast"] : [];
const FORMAT =
  process.env.CI || !process.stdout.isTTY ? "progress" : "progress-bar";

exports.default = [
  ...FAIL_FAST,
  `--format ${FORMAT}`,
  `--parallel ${CPU_COUNT}`,

  // "test/**/*.feature",
  "../blackbox-testing/features/**/*.feature",

  `--tags "@testsuite:squatch-js and not @skip"`,

  // Babel and jsDom make our code work as if it's in the browser
  //   "--require-module jsdom-global/register",
  //   "--require-module ts-node/register",
  "--require-module " + __dirname + "/babelregister.js",
  // '--require-module source-map-support/register',

  // Order matters -- these setups need to happen first
  //   "--require tests/cucumber-setup/loaders.ts",

  // Step definitions go last
  "--require test/step_definitions/**/*.ts",
  "--require test/step_definitions/**/*.tsx",

  // '--format usage',
].join(" ");


text:
"""Suite Type Names Suite: Terminology for Registry data types
Level 1, version 1

Generated from /Volumes/Sap/System Folder/Extensions/AppleScript
AETE/AEUT resource version 1/0, language 0, script 0
"""

import aetools
import MacOS

_code = 'tpnm'

class Type_Names_Suite_Events:

    pass

class PostScript_picture(aetools.ComponentItem):
    """PostScript picture -  """
    want = 'EPS '

class point(aetools.ComponentItem):
    """point - point coordinates """
    want = 'QDpt'

class string(aetools.ComponentItem):
    """string - a string of characters """
    want = 'TEXT'

plain_text = string

plain_text = string

class TIFF_picture(aetools.ComponentItem):
    """TIFF picture -  """
    want = 'TIFF'

class application_dictionary(aetools.ComponentItem):
    """application dictionary -  """
    want = 'aete'

class system_dictionary(aetools.ComponentItem):
    """system dictionary -  """
    want = 'aeut'

class color_table(aetools.ComponentItem):
    """color table -  """
    want = 'clrt'

class menu_item(aetools.ComponentItem):
    """menu item -  """
    want = 'cmen'

class menu(aetools.ComponentItem):
    """menu -  """
    want = 'cmnu'

class double_integer(aetools.ComponentItem):
    """double integer -  """
    want = 'comp'

class type_element_info(aetools.ComponentItem):
    """type element info -  """
    want = 'elin'

class type_event_info(aetools.ComponentItem):
    """type event info - information about an event """
    want = 'evin'

class extended_real(aetools.ComponentItem):
    """extended real -  """
    want = 'exte'

class fixed(aetools.ComponentItem):
    """fixed - a real number """
    want = 'fixd'

class fixed_point(aetools.ComponentItem):
    """fixed point -  """
    want = 'fpnt'

class fixed_rectangle(aetools.ComponentItem):
    """fixed rectangle -  """
    want = 'frct'

class type_class_info(aetools.ComponentItem):
    """type class info - information about properties and elements of a class """
    want = 'gcli'

class location_reference(aetools.ComponentItem):
    """location reference -  """
    want = 'insl'

class long_fixed_point(aetools.ComponentItem):
    """long fixed point -  """
    want = 'lfpt'

class long_fixed_rectangle(aetools.ComponentItem):
    """long fixed rectangle -  """
    want = 'lfrc'

class long_fixed(aetools.ComponentItem):
    """long fixed -  """
    want = 'lfxd'

class long_point(aetools.ComponentItem):
    """long point -  """
    want = 'lpnt'

class long_rectangle(aetools.ComponentItem):
    """long rectangle -  """
    want = 'lrct'

class machine_location(aetools.ComponentItem):
    """machine location -  """
    want = 'mLoc'

class unsigned_integer(aetools.ComponentItem):
    """unsigned integer -  """
    want = 'magn'

class null(aetools.ComponentItem):
    """null -  """
    want = 'null'

class type_property_info(aetools.ComponentItem):
    """type property info -  """
    want = 'pinf'

class type_parameter_info(aetools.ComponentItem):
    """type parameter info -  """
    want = 'pmin'

class bounding_rectangle(aetools.ComponentItem):
    """bounding rectangle - bounding rectangle """
    want = 'qdrt'

class small_integer(aetools.ComponentItem):
    """small integer -  """
    want = 'shor'

class small_real(aetools.ComponentItem):
    """small real -  """
    want = 'sing'

class scrap_styles(aetools.ComponentItem):
    """scrap styles -  """
    want = 'styl'

class type_suite_info(aetools.ComponentItem):
    """type suite info -  """
    want = 'suin'

class target_id(aetools.ComponentItem):
    """target id -  """
    want = 'targ'

class dash_style(aetools.ComponentItem):
    """dash style -  """
    want = 'tdas'

class pixel_map_record(aetools.ComponentItem):
    """pixel map record -  """
    want = 'tpmm'

class RGB16_color(aetools.ComponentItem):
    """RGB16 color -  """
    want = 'tr16'

class RGB96_color(aetools.ComponentItem):
    """RGB96 color -  """
    want = 'tr96'

class rotation(aetools.ComponentItem):
    """rotation -  """
    want = 'trot'

class version(aetools.ComponentItem):
    """version -  """
    want = 'vers'
PostScript_picture._superclassnames = []
PostScript_picture._privpropdict = {
}
PostScript_picture._privelemdict = {
}
point._superclassnames = []
point._privpropdict = {
}
point._privelemdict = {
}
string._superclassnames = []
string._privpropdict = {
}
string._privelemdict = {
}
TIFF_picture._superclassnames = []
TIFF_picture._privpropdict = {
}
TIFF_picture._privelemdict = {
}
application_dictionary._superclassnames = []
application_dictionary._privpropdict = {
}
application_dictionary._privelemdict = {
}
system_dictionary._superclassnames = []
system_dictionary._privpropdict = {
}
system_dictionary._privelemdict = {
}
color_table._superclassnames = []
color_table._privpropdict = {
}
color_table._privelemdict = {
}
menu_item._superclassnames = []
menu_item._privpropdict = {
}
menu_item._privelemdict = {
}
menu._superclassnames = []
menu._privpropdict = {
}
menu._privelemdict = {
}
double_integer._superclassnames = []
double_integer._privpropdict = {
}
double_integer._privelemdict = {
}
type_element_info._superclassnames = []
type_element_info._privpropdict = {
}
type_element_info._privelemdict = {
}
type_event_info._superclassnames = []
type_event_info._privpropdict = {
}
type_event_info._privelemdict = {
}
extended_real._superclassnames = []
extended_real._privpropdict = {
}
extended_real._privelemdict = {
}
fixed._superclassnames = []
fixed._privpropdict = {
}
fixed._privelemdict = {
}
fixed_point._superclassnames = []
fixed_point._privpropdict = {
}
fixed_point._privelemdict = {
}
fixed_rectangle._superclassnames = []
fixed_rectangle._privpropdict = {
}
fixed_rectangle._privelemdict = {
}
type_class_info._superclassnames = []
type_class_info._privpropdict = {
}
type_class_info._privelemdict = {
}
location_reference._superclassnames = []
location_reference._privpropdict = {
}
location_reference._privelemdict = {
}
long_fixed_point._superclassnames = []
long_fixed_point._privpropdict = {
}
long_fixed_point._privelemdict = {
}
long_fixed_rectangle._superclassnames = []
long_fixed_rectangle._privpropdict = {
}
long_fixed_rectangle._privelemdict = {
}
long_fixed._superclassnames = []
long_fixed._privpropdict = {
}
long_fixed._privelemdict = {
}
long_point._superclassnames = []
long_point._privpropdict = {
}
long_point._privelemdict = {
}
long_rectangle._superclassnames = []
long_rectangle._privpropdict = {
}
long_rectangle._privelemdict = {
}
machine_location._superclassnames = []
machine_location._privpropdict = {
}
machine_location._privelemdict = {
}
unsigned_integer._superclassnames = []
unsigned_integer._privpropdict = {
}
unsigned_integer._privelemdict = {
}
null._superclassnames = []
null._privpropdict = {
}
null._privelemdict = {
}
type_property_info._superclassnames = []
type_property_info._privpropdict = {
}
type_property_info._privelemdict = {
}
type_parameter_info._superclassnames = []
type_parameter_info._privpropdict = {
}
type_parameter_info._privelemdict = {
}
bounding_rectangle._superclassnames = []
bounding_rectangle._privpropdict = {
}
bounding_rectangle._privelemdict = {
}
small_integer._superclassnames = []
small_integer._privpropdict = {
}
small_integer._privelemdict = {
}
small_real._superclassnames = []
small_real._privpropdict = {
}
small_real._privelemdict = {
}
scrap_styles._superclassnames = []
scrap_styles._privpropdict = {
}
scrap_styles._privelemdict = {
}
type_suite_info._superclassnames = []
type_suite_info._privpropdict = {
}
type_suite_info._privelemdict = {
}
target_id._superclassnames = []
target_id._privpropdict = {
}
target_id._privelemdict = {
}
dash_style._superclassnames = []
dash_style._privpropdict = {
}
dash_style._privelemdict = {
}
pixel_map_record._superclassnames = []
pixel_map_record._privpropdict = {
}
pixel_map_record._privelemdict = {
}
RGB16_color._superclassnames = []
RGB16_color._privpropdict = {
}
RGB16_color._privelemdict = {
}
RGB96_color._superclassnames = []
RGB96_color._privpropdict = {
}
RGB96_color._privelemdict = {
}
rotation._superclassnames = []
rotation._privpropdict = {
}
rotation._privelemdict = {
}
version._superclassnames = []
version._privpropdict = {
}
version._privelemdict = {
}

#
# Indices of types declared in this module
#
_classdeclarations = {
    'EPS ' : PostScript_picture,
    'QDpt' : point,
    'TEXT' : string,
    'TIFF' : TIFF_picture,
    'aete' : application_dictionary,
    'aeut' : system_dictionary,
    'clrt' : color_table,
    'cmen' : menu_item,
    'cmnu' : menu,
    'comp' : double_integer,
    'elin' : type_element_info,
    'evin' : type_event_info,
    'exte' : extended_real,
    'fixd' : fixed,
    'fpnt' : fixed_point,
    'frct' : fixed_rectangle,
    'gcli' : type_class_info,
    'insl' : location_reference,
    'lfpt' : long_fixed_point,
    'lfrc' : long_fixed_rectangle,
    'lfxd' : long_fixed,
    'lpnt' : long_point,
    'lrct' : long_rectangle,
    'mLoc' : machine_location,
    'magn' : unsigned_integer,
    'null' : null,
    'pinf' : type_property_info,
    'pmin' : type_parameter_info,
    'qdrt' : bounding_rectangle,
    'shor' : small_integer,
    'sing' : small_real,
    'styl' : scrap_styles,
    'suin' : type_suite_info,
    'targ' : target_id,
    'tdas' : dash_style,
    'tpmm' : pixel_map_record,
    'tr16' : RGB16_color,
    'tr96' : RGB96_color,
    'trot' : rotation,
    'vers' : version,
}

_propdeclarations = {
}

_compdeclarations = {
}

_enumdeclarations = {
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <title>React demo</title>
    <link rel="stylesheet" href="/assets/css/style.css">
    <link rel="shortcut icon" href="/assets/img/favicon.ico">


text:
function kern = lfmvKernParamInit(kern)

% LFMVKERNPARAMINIT LFMV kernel parameter initialisation.
%
%	Description:
%	The kernel is designed to interoperate with the multiple output block
%	kernel so that f(t) can be inferred given several different
%	instantiations of x(t).
%
%	The parameters (m, c, delta and k) are constrained positive.
%
%
%	KERN = LFMVKERNPARAMINIT(KERN) initialises the latent force model
%	kernel structure with some default parameters.
%	 Returns:
%	  KERN - the kernel structure with the default parameters placed in.
%	 Arguments:
%	  KERN - the kernel structure which requires initialisation.
%
%
%	See also
%	KERNCREATE, KERNPARAMINIT, LFMKERNCOMPUTE

%	Copyright (c) 2010 Mauricio A. Alvarez

% A wrapper that calls lfmKernParamInit to initialize the parameters of the
% model.

kern = lfmKernParamInit(kern);


text:
<!DOCTYPE html>

  <title>dnd-multi-backend Examples</title>

Example is not working


text:
#pragma once

#ifndef GEODE_PARTITIONRESOLVER_H_
#define GEODE_PARTITIONRESOLVER_H_

#include "SharedPtr.hpp"
#include "Cacheable.hpp"
#include <string>

namespace apache {
namespace geode {
namespace client {

class EntryEvent;

/**
* Implementers of interface PartitionResolver enable custom
* partitioning on the PartitionedRegion.
* 1. The Key class or callback arg can implement PartitionResolver interface to
* enable custom partitioning OR
* 2. Configure your own PartitionResolver class in partition attributes (For
* instance when the Key is a primitive type or String) Implement the
* appropriate equals - For all implementations, you need to be sure to code the
* class equals method so it properly verifies equality for the
* PartitionResolver implementation. This might mean verifying that class names
* are the same or that the returned routing objects are the same etc.. When you
* initiate the partitioned region on multiple nodes, Geode uses the equals
* method to ensure you are using the same PartitionResolver implementation for
* all of the nodes for the region.
* Geode uses the routing object's hashCode to determine where the data is
* being managed. Say, for example, you want to colocate all Trades by month and
* year.The key is implemented by TradeKey class which also implements the
* PartitionResolver interface.
* public class TradeKey implements PartitionResolver {

* &nbsp &nbsp private String tradeID;

* &nbsp &nbsp private Month month ;

* &nbsp &nbsp private Year year ;

*
* &nbsp &nbsp public TradingKey(){ }

* &nbsp &nbsp public TradingKey(Month month, Year year){

* &nbsp &nbsp &nbsp &nbsp this.month = month;

* &nbsp &nbsp &nbsp &nbsp this.year = year;

* &nbsp &nbsp }

* &nbsp &nbsp public Serializable getRoutingObject(EntryOperation
* opDetails){

* &nbsp &nbsp &nbsp &nbsp return this.month + this.year;

* &nbsp &nbsp }
 }

*
* In the example above, all trade entries with the same month and year are
* guaranteed to be colocated.
*/
class CPPCACHE_EXPORT PartitionResolver : public SharedBase {
  /**
  * @brief public methods
  */

 public:
  /**
  * @brief destructor
  */
  virtual ~PartitionResolver();

  /**
  * Returns the name of the PartitionResolver
  * @return String name
  */
  virtual const char* getName();

  /**
  * @param opDetails the detail of the entry event
  * @throws RuntimeException - any exception thrown will terminate the operation
  * and the exception will be passed to the
  * calling thread.
  * @return object associated with entry event which allows the Partitioned
  * Region to store associated data together
  */
  virtual CacheableKeyPtr getRoutingObject(const EntryEvent& opDetails) = 0;

 protected:
  /**
  * @brief constructors
  */
  PartitionResolver();

 private:
  // never implemented.
  PartitionResolver(const PartitionResolver& other);
  void operator=(const PartitionResolver& other);
};
}  // namespace client
}  // namespace geode
}  // namespace apache

#endif  // GEODE_PARTITIONRESOLVER_H_


text:
package seedu.taskitty.ui;

import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.MenuItem;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCombination;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import seedu.taskitty.commons.core.Config;
import seedu.taskitty.commons.core.GuiSettings;
import seedu.taskitty.commons.events.ui.ExitAppRequestEvent;
import seedu.taskitty.logic.Logic;
import seedu.taskitty.model.UserPrefs;
import seedu.taskitty.model.task.Task;

/**
 * The Main Window. Provides the basic application layout containing
 * a menu bar and space where other JavaFX elements can be placed.
 */
public class MainWindow extends UiPart {

    private static final String ICON = "/images/Tasks-icon.png";
    private static final String FXML = "MainWindow.fxml";
    public static final int MIN_HEIGHT = 650;
    public static final int MIN_WIDTH = 750;

    private Logic logic;

    // Independent Ui parts residing in this Ui container

    private ResultDisplay resultDisplay;
    private static StatusBarFooter statusBarFooter;
    private CommandBox commandBox;
    private Config config;

    // Handles to elements of this Ui container
    private VBox rootLayout;
    private Scene scene;

    @FXML
    private AnchorPane commandBoxPlaceholder;

    @FXML
    private MenuItem helpMenuItem;

    @FXML
    private MenuItem undoMenuItem;

    @FXML
    private MenuItem redoMenuItem;

    @FXML
    private MenuItem viewMenuItem;

    @FXML
    private MenuItem viewAllMenuItem;

    @FXML
    private MenuItem viewDoneMenuItem;

    @FXML
    private MenuItem exitMenuItem;

    @FXML
    private MenuItem clearMenuItem;

    //@@author A0130853L
    @FXML
    private AnchorPane taskListPanelPlaceholder;

    @FXML
    private AnchorPane deadlineListPanelPlaceholder;

    @FXML
    private AnchorPane eventListPanelPlaceholder;

    //@@author
    @FXML
    private ImageView catImage;
    @FXML
    private AnchorPane resultDisplayPlaceholder;

    @FXML
    private AnchorPane statusbarPlaceholder;

    @Override
    public void setNode(Node node) {
        rootLayout = (VBox) node;
    }

    @Override
    public String getFxmlPath() {
        return FXML;
    }

    public static MainWindow load(Stage primaryStage, Config config, UserPrefs prefs, Logic logic) {

        MainWindow mainWindow = UiPartLoader.loadUiPart(primaryStage, new MainWindow());
        mainWindow.configure(config.getAppTitle(), config.getTaskManagerName(), config, prefs, logic);
        return mainWindow;
    }

    private void configure(String appTitle, String taskManagerName, Config config, UserPrefs prefs,
                           Logic logic) {

        //Set dependencies
        this.logic = logic;
        this.config = config;

        //Configure the UI
        setTitle(appTitle);
        setIcon(ICON);
        setWindowMinSize();
        setWindowDefaultSize(prefs);
        scene = new Scene(rootLayout);
        primaryStage.setScene(scene);

        setAccelerators();
    }

    //@@author A0139052L
    private void setAccelerators() {
        helpMenuItem.setAccelerator(KeyCombination.valueOf("F1"));
        exitMenuItem.setAccelerator(KeyCombination.valueOf("Esc"));
        undoMenuItem.setAccelerator(KeyCombination.valueOf("Ctrl + Shift + U"));
        redoMenuItem.setAccelerator(KeyCombination.valueOf("Ctrl + Shift + Y"));
        viewMenuItem.setAccelerator(KeyCombination.valueOf("Ctrl + Shift + T"));
        viewAllMenuItem.setAccelerator(KeyCombination.valueOf("Ctrl + Shift + L"));
        viewDoneMenuItem.setAccelerator(KeyCombination.valueOf("Ctrl + Shift + D"));
        clearMenuItem.setAccelerator(KeyCombination.valueOf("Ctrl + Shift + C"));
    }

    //@@author
    public void fillInnerParts() {

        TaskListPanel.load(primaryStage, getTaskListPlaceholder(),
                logic.getFilteredTaskList(), new TaskListPanel(), Task.TASK_COMPONENT_COUNT);
        TaskListPanel.load(primaryStage, getDeadlineListPlaceholder(),
                logic.getFilteredDeadlineList(), new TaskListPanel(), Task.DEADLINE_COMPONENT_COUNT);
        TaskListPanel.load(primaryStage, getEventListPlaceholder(),
                logic.getFilteredEventList(), new TaskListPanel(), Task.EVENT_COMPONENT_COUNT);
        resultDisplay = ResultDisplay.load(primaryStage, getResultDisplayPlaceholder());
        statusBarFooter = StatusBarFooter.load(primaryStage, getStatusbarPlaceholder(),
                config.getTaskManagerFilePath());
        commandBox = CommandBox.load(primaryStage, getCommandBoxPlaceholder(), resultDisplay, this, logic);
    }

    //@@author A0135793W
    public static StatusBarFooter getStatusBarFooter() {
        return statusBarFooter;
    }

    //@@author
    private AnchorPane getCommandBoxPlaceholder() {
        return commandBoxPlaceholder;
    }

    private AnchorPane getStatusbarPlaceholder() {
        return statusbarPlaceholder;
    }

    private AnchorPane getResultDisplayPlaceholder() {
        return resultDisplayPlaceholder;
    }

    public ImageView getCatImage() {
        return catImage;
    }

    //@@author A0130853L
    private AnchorPane getTaskListPlaceholder() {
        return taskListPanelPlaceholder;
    }

    private AnchorPane getDeadlineListPlaceholder() {
        return deadlineListPanelPlaceholder;
    }

    private AnchorPane getEventListPlaceholder() {
        return eventListPanelPlaceholder;
    }

    //@@author
    public void hide() {
        primaryStage.hide();
    }

    private void setTitle(String appTitle) {
        primaryStage.setTitle(appTitle);
    }

    /**
     * Sets the default size based on user preferences.
     */
    protected void setWindowDefaultSize(UserPrefs prefs) {
        primaryStage.setHeight(prefs.getGuiSettings().getWindowHeight());
        primaryStage.setWidth(prefs.getGuiSettings().getWindowWidth());
        if (prefs.getGuiSettings().getWindowCoordinates() != null) {
            primaryStage.setX(prefs.getGuiSettings().getWindowCoordinates().getX());
            primaryStage.setY(prefs.getGuiSettings().getWindowCoordinates().getY());
        }
    }

    private void setWindowMinSize() {
        primaryStage.setMinHeight(MIN_HEIGHT);
        primaryStage.setMinWidth(MIN_WIDTH);
    }

    /**
     * Returns the current size and the position of the main Window.
     */
    public GuiSettings getCurrentGuiSetting() {
        return new GuiSettings(primaryStage.getWidth(), primaryStage.getHeight(),
                (int) primaryStage.getX(), (int) primaryStage.getY());
    }

    @FXML
    public void handleHelp() {
        HelpWindow helpWindow = HelpWindow.load(primaryStage);
        helpWindow.show();
    }

    public void show() {
        primaryStage.show();
    }

    //@@author A0139052L
    @FXML
    public void handleUndo() {
        commandBox.handleCommands("undo");
    }

    @FXML
    public void handleRedo() {
        commandBox.handleCommands("redo");
    }

    @FXML
    public void handleView() {
        commandBox.handleCommands("view");
    }

    @FXML
    public void handleViewAll() {
        commandBox.handleCommands("view all");
    }

    @FXML
    public void handleViewDone() {
        commandBox.handleCommands("view done");
    }

    @FXML
    public void handleClear() {
        commandBox.handleCommands("clear");
    }

    //@@author A0130853L
    /**
     *  Initialises the list to show today's events upon UI initialisation
     * */
    public void initialiseList() {
        logic.initialiseList();
    }

    //@@author
    /**
     * Closes the application.
     */
    @FXML
    private void handleExit() {
        raise(new ExitAppRequestEvent());
    }

}


text:
#if !defined(SPIRIT_ALTERNATIVE_FEB_05_2007_1153AM)
#define SPIRIT_ALTERNATIVE_FEB_05_2007_1153AM

#include <boost/spirit/home/qi/detail/alternative_function.hpp>
#include <boost/spirit/home/support/attribute_transform.hpp>
#include <boost/spirit/home/support/detail/what_function.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/as_variant.hpp>
#include <boost/fusion/include/any.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/mpl.hpp>
#include <boost/fusion/include/for_each.hpp>
#include <boost/fusion/include/push_front.hpp>
#include <boost/variant.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/end.hpp>
#include <boost/mpl/find_if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>

namespace boost { namespace spirit { namespace qi
{
    struct alternative
    {
        template <typename T>
        struct transform_child : mpl::identity<T> {};

        template <typename All, typename Filtered>
        struct build_container
        {
            // if the original attribute list does not contain any unused
            // attributes it is used, otherwise a single unused_type is
            // pushed to the front the list. This is to make sure that if
            // there is an unused in the list it is the first one.
            typedef typename
                mpl::find_if<All, is_same<mpl::_, unused_type> >::type
            unused_;

            typedef typename
                mpl::eval_if<
                    is_same<unused_, typename mpl::end<All>::type>,
                    mpl::identity<All>,
                    fusion::result_of::push_front<Filtered, unused_type>
                >::type
            attribute_sequence;

            // Ok, now make a variant over the attribute_sequence. It's
            // a pity that make_variant_over does not support forward MPL
            // sequences. We use our own conversion metaprogram (as_variant).
            typedef typename
                as_variant<attribute_sequence>::type
            type;
        };

        template <typename Component, typename Context, typename Iterator>
        struct attribute :
            build_fusion_sequence<alternative, Component, Iterator, Context>
        {
        };

        template <
            typename Component
          , typename Iterator, typename Context
          , typename Skipper, typename Attribute>
        static bool parse(
            Component const& component
          , Iterator& first, Iterator const& last
          , Context& context, Skipper const& skipper
          , Attribute& attr)
        {
            detail::alternative_function<Iterator, Context, Skipper, Attribute>
                f(first, last, context, skipper, attr);

            // return true if *any* of the parsers succeed
            return fusion::any(component.elements, f);
        }

        template <typename Component, typename Context>
        static std::string what(Component const& component, Context const& ctx)
        {
            std::string result = "alternatives[";
            fusion::for_each(component.elements,
                spirit::detail::what_function<Context>(result, ctx));
            result += "]";
            return result;
        }
    };
}}}

#endif


text:
FOUNDATION_EXPORT double HDNotificationViewVersionNumber;

//! Project version string for HDNotificationView.
FOUNDATION_EXPORT const unsigned char HDNotificationViewVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <HDNotificationView/PublicHeader.h>


text:
import os
from glob import glob
from vlpp.utils import add_suffix
from vlpp.registration import estimatePet2Anat

def main():
    anat = "${anat}"
    pet = "${pet}"
    output = "${participant}${suffix.pet2anat}"

    if "${transitional}" == "false":
        estimatePet2Anat(pet, anat, output=output)

    else:
        transitionalPet = glob("${transitional}/tmp/*tmp-estimate.nii.gz")[0]
        estimatePet2Anat(pet, transitionalPet, output=output)

if __name__ == '__main__':
    main()


text:
package org.apache.ignite.internal;

import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;

import java.util.*;
import java.util.concurrent.*;

import static java.util.concurrent.TimeUnit.*;

/**
 * Task deployment tests.
 */
public class GridDeploymentMultiThreadedSelfTest extends GridCommonAbstractTest {
    /** */
    private static final int THREAD_CNT = 20;

    /** */
    private static final int EXEC_CNT = 30000;

    /**
     * @throws Exception If failed.
     */
    public void testDeploy() throws Exception {
        try {
            final Ignite ignite = startGrid(0);

            ignite.compute().localDeployTask(GridDeploymentTestTask.class, GridDeploymentTestTask.class.getClassLoader());

            assert ignite.compute().localTasks().get(GridDeploymentTestTask.class.getName()) != null;

            ignite.compute().undeployTask(GridDeploymentTestTask.class.getName());

            final CyclicBarrier barrier = new CyclicBarrier(THREAD_CNT, new Runnable() {
                private int iterCnt;

                @Override public void run() {
                    try {
                        ignite.compute().undeployTask(GridDeploymentTestTask.class.getName());

                        assert ignite.compute().localTasks().get(GridDeploymentTestTask.class.getName()) == null;

                        if (++iterCnt % 100 == 0)
                            info("Iterations count: " + iterCnt);
                    }
                    catch (IgniteException e) {
                        U.error(log, "Failed to undeploy task message.", e);

                        fail("See logs for details.");
                    }
                }
            });

            GridTestUtils.runMultiThreaded(new Callable<Object>() {
                @Override public Object call() throws Exception {
                    try {
                        for (int i = 0; i < EXEC_CNT; i++) {
                            barrier.await(2000, MILLISECONDS);

                            ignite.compute().localDeployTask(GridDeploymentTestTask.class,
                                GridDeploymentTestTask.class.getClassLoader());

                            assert ignite.compute().localTasks().get(GridDeploymentTestTask.class.getName()) != null;
                        }
                    }
                    catch (Exception e) {
                        U.error(log, "Test failed.", e);

                        throw e;
                    }
                    finally {
                        info("Thread finished.");
                    }

                    return null;
                }
            }, THREAD_CNT, "grid-load-test-thread");
        }
        finally {
            stopAllGrids();
        }
    }

    /**
     * Test task.
     */
    private static class GridDeploymentTestTask extends ComputeTaskAdapter<Object, Object> {
        /** {@inheritDoc} */
        @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
            assert false;

            return Collections.emptyMap();
        }

        /** {@inheritDoc} */
        @Override public Object reduce(List<ComputeJobResult> results) {
            return null;
        }
    }
}


text:
package org.logbuddy.logger;

import static java.lang.String.format;
import static org.logbuddy.LogBuddyException.check;

import java.time.Clock;
import java.time.ZonedDateTime;

import org.logbuddy.Logger;
import org.logbuddy.Message;

public class TimeLogger implements Logger {
  private final Clock clock;
  private final Logger logger;

  private TimeLogger(Clock clock, Logger logger) {
    this.clock = clock;
    this.logger = logger;
  }

  public static Logger time(Clock clock, Logger logger) {
    check(clock != null);
    check(logger != null);
    return new TimeLogger(clock, logger);
  }

  public void log(Message message) {
    logger.log(message.attribute(ZonedDateTime.now(clock)));
  }

  public String toString() {
    return format("time(%s, %s)", clock, logger);
  }
}


text:
from mod_pywebsocket import handshake

def web_socket_do_extra_handshake(request):
    raise handshake.AbortedByUserException("abort for test")

def web_socket_transfer_data(request):
    raise handshake.AbortedByUserException("abort for test")

# vi:sts=4 sw=4 et


text:
package xid

import "golang.org/x/sys/unix"

func readPlatformMachineID() (string, error) {
	return unix.Sysctl("kern.hostuuid")
}


text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you 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.

using System;
using Org.Apache.REEF.Common.Context;
using Org.Apache.REEF.Common.Services;
using Org.Apache.REEF.Common.Tasks;
using Org.Apache.REEF.Driver;
using Org.Apache.REEF.Driver.Context;
using Org.Apache.REEF.Driver.Evaluator;
using Org.Apache.REEF.Driver.Task;
using Org.Apache.REEF.Tang.Annotations;
using Org.Apache.REEF.Tang.Util;
using Org.Apache.REEF.Tests.Functional.Common.Task;
using Org.Apache.REEF.Utilities.Logging;
using Xunit;

namespace Org.Apache.REEF.Tests.Functional.Failure.User
{
    [Collection("FunctionalTests")]
    public sealed class ServiceConstructorExceptionTest : ReefFunctionalTest
    {
        private static readonly Logger Logger = Logger.GetLogger(typeof(ServiceConstructorExceptionTest));
        private static readonly string FailedEvaluatorReceived = "FailedEvaluatorReceived";
        private static readonly string ActiveContextReceived = "ActiveContextReceived";
        private static readonly string FailedContextReceived = "FailedContextReceived";
        private static readonly string RunningTaskReceived = "RunningTaskReceived";
        private static readonly string CompletedTaskReceived = "CompletedTaskReceived";
        private static readonly string Context0 = "Context0";
        private static readonly string Context1 = "Context1";
        private static readonly string Context2 = "Context2";
        private static readonly string TaskId = "TaskId";
        private static readonly string TaskRunningMessage = "TaskRunningMessage";

        /// <summary>
        /// This test tests that an Exception in the constructor of a Service object triggers a FailedContext event
        /// on a non-root Context. Also tests that an Exception in the constructor of a Service object triggers a FailedEvaluator
        /// event on a root Context. Upon failing the non-root context, we submit a Task to the failed context's parent
        /// to verify that a Task can still be run on the parent context.
        /// </summary>
        [Fact]
        [Trait("Priority", "1")]
        [Trait("Category", "FunctionalGated")]
        [Trait("Description",
            "Test Exception in the constructor of a Service object and validate that we receive either a FailedContext event " +
            "in the case of non-root contexts, or a FailedEvaluator event in the case of the root context.")]
        public void TestServiceConstructorExceptionOnLocalRuntime()
        {
            string testFolder = DefaultRuntimeFolder + TestId;
            TestRun(
                DriverConfiguration.ConfigurationModule
                    .Set(DriverConfiguration.OnDriverStarted, GenericType<ServiceConstructorExceptionDriver>.Class)
                    .Set(DriverConfiguration.OnEvaluatorFailed, GenericType<ServiceConstructorExceptionDriver>.Class)
                    .Set(DriverConfiguration.OnEvaluatorAllocated, GenericType<ServiceConstructorExceptionDriver>.Class)
                    .Set(DriverConfiguration.OnContextActive, GenericType<ServiceConstructorExceptionDriver>.Class)
                    .Set(DriverConfiguration.OnContextFailed, GenericType<ServiceConstructorExceptionDriver>.Class)
                    .Set(DriverConfiguration.OnTaskRunning, GenericType<ServiceConstructorExceptionDriver>.Class)
                    .Set(DriverConfiguration.OnTaskCompleted, GenericType<ServiceConstructorExceptionDriver>.Class)
                    .Build(),
                typeof(ServiceConstructorExceptionDriver), 1, "serviceConstructorExceptionTest", "local", testFolder);

            ValidateSuccessForLocalRuntime(numberOfContextsToClose: 1, numberOfTasksToFail: 0, numberOfEvaluatorsToFail: 1, testFolder: testFolder);
            ValidateMessagesSuccessfullyLoggedForDriver(
                new[] { FailedEvaluatorReceived, ActiveContextReceived, RunningTaskReceived, CompletedTaskReceived }, testFolder, 1);
            CleanUp(testFolder);
        }

        private sealed class ServiceConstructorExceptionDriver :
            IObserver<IDriverStarted>,
            IObserver<IAllocatedEvaluator>,
            IObserver<IActiveContext>,
            IObserver<IFailedContext>,
            IObserver<IFailedEvaluator>,
            IObserver<IRunningTask>,
            IObserver<ICompletedTask>
        {
            private readonly object _lock = new object();
            private readonly IEvaluatorRequestor _requestor;
            private bool _shouldFailOnRootContext = true;

            [Inject]
            private ServiceConstructorExceptionDriver(IEvaluatorRequestor requestor)
            {
                _requestor = requestor;
            }

            public void OnNext(IDriverStarted value)
            {
                _requestor.Submit(_requestor.NewBuilder().SetNumber(2).Build());
            }

            public void OnNext(IFailedEvaluator value)
            {
                // We should expect 0 failed contexts here, since the Evaluator fails
                // to instantiate the RootContext.
                Assert.Equal(0, value.FailedContexts.Count);
                Logger.Log(Level.Info, FailedEvaluatorReceived);
            }

            /// <summary>
            /// Submits two contexts, one that fails the Evaluator and another that allows for
            /// Context Stacking.
            /// </summary>
            public void OnNext(IAllocatedEvaluator value)
            {
                lock (_lock)
                {
                    if (_shouldFailOnRootContext)
                    {
                        // Failing config.
                        var ctxConf = ContextConfiguration.ConfigurationModule
                            .Set(ContextConfiguration.Identifier, Context0)
                            .Build();

                        var serviceConf = ServiceConfiguration.ConfigurationModule
                            .Set(ServiceConfiguration.Services, GenericType<ServiceConstructorExceptionService>.Class)
                            .Build();

                        value.SubmitContextAndService(ctxConf, serviceConf);
                        _shouldFailOnRootContext = false;
                    }
                    else
                    {
                        // Context stacking config.
                        value.SubmitContext(
                            ContextConfiguration.ConfigurationModule
                                .Set(ContextConfiguration.Identifier, Context1)
                                .Build());
                    }
                }
            }

            /// <summary>
            /// Submits the failing Context config on the non-failing Context.
            /// </summary>
            public void OnNext(IActiveContext value)
            {
                lock (_lock)
                {
                    Logger.Log(Level.Info, ActiveContextReceived);
                    Assert.False(_shouldFailOnRootContext);

                    var ctxConf = ContextConfiguration.ConfigurationModule
                        .Set(ContextConfiguration.Identifier, Context2)
                        .Build();

                    var serviceConf = ServiceConfiguration.ConfigurationModule
                        .Set(ServiceConfiguration.Services, GenericType<ServiceConstructorExceptionService>.Class)
                        .Build();

                    value.SubmitContextAndService(ctxConf, serviceConf);
                }
            }

            /// <summary>
            /// Only Context2 is expected as the FailedContext.
            /// Context0 should trigger a FailedEvaluator directly.
            /// Submit a Task on to the parent of Context2 (Context1) and make sure
            /// that it runs to completion.
            /// </summary>
            public void OnNext(IFailedContext value)
            {
                Assert.Equal(Context2, value.Id);
                Assert.True(value.ParentContext.IsPresent(), "Expected " + Context2 + " to have parent of " + Context1);

                if (value.ParentContext.IsPresent())
                {
                    // Submit Task on the good Context, i.e. the FailedContext's parent.
                    Assert.Equal(Context1, value.ParentContext.Value.Id);
                    value.ParentContext.Value.SubmitTask(
                        TaskConfiguration.ConfigurationModule
                            .Set(TaskConfiguration.Identifier, TaskId)
                            .Set(TaskConfiguration.Task, GenericType<ServiceConstructorExceptionTestTask>.Class)
                            .Build());
                }

                Logger.Log(Level.Info, FailedContextReceived);
            }

            public void OnNext(IRunningTask value)
            {
                Assert.Equal(TaskId, value.Id);
                Assert.Equal(Context1, value.ActiveContext.Id);
                Logger.Log(Level.Info, RunningTaskReceived);
            }

            public void OnNext(ICompletedTask value)
            {
                Assert.Equal(TaskId, value.Id);
                Logger.Log(Level.Info, CompletedTaskReceived);
                value.ActiveContext.Dispose();
            }

            public void OnError(Exception error)
            {
            }

            public void OnCompleted()
            {
            }
        }

        /// <summary>
        /// A test service class that is not injectable.
        /// </summary>
        private sealed class ServiceConstructorExceptionService
        {
            /// <summary>
            /// Not injectable on purpose to make Service injection fail.
            /// </summary>
            private ServiceConstructorExceptionService()
            {
            }
        }

        /// <summary>
        /// A Test Task class that simply logs a Task running message.
        /// </summary>
        private sealed class ServiceConstructorExceptionTestTask : LoggingTask
        {
            [Inject]
            private ServiceConstructorExceptionTestTask()
                : base(TaskRunningMessage)
            {
            }
        }
    }
}


text:
using Digirati.IIIF.Model.JsonLD;
using Newtonsoft.Json;

namespace Digirati.IIIF.Model.Extension
{
    public class SearchResultAnnotationResource : JSONLDBase
    {
        public override string Type
        {
            get { return "dctypes:Text"; }
        }

        // these are not yet in the presentation context
        [JsonProperty(Order = 10, PropertyName = "chars")]
        public string Chars { get; set; }

        [JsonProperty(Order = 21, PropertyName = "before")]
        public string Before { get; set; }

        [JsonProperty(Order = 22, PropertyName = "after")]
        public string After { get; set; }

        [JsonProperty(Order = 30, PropertyName = "resultIndex")]
        public int ResultIndex { get; set; }
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

/**
 *
 * @author stavad
 */
public interface Calculator {

    Double calcPriceWithTva(Double price, Double tvaProct);

}


text:
inputFile=$1

[[ ! -f $inputFile ]] && echo "Error: Input file does not exist: ${inputFile}" 1>&2 && exit 1

maxResults=100
variantClassifications="COULD_NOT_DETERMINE FIVE_PRIME_FLANK START_CODON_INS DE_NOVO_START_IN_FRAME DE_NOVO_START_OUT_FRAME FIVE_PRIME_UTR FRAME_SHIFT_DEL FRAME_SHIFT_INS IGR INTRON IN_FRAME_DEL IN_FRAME_INS LINCRNA MISSENSE NONSENSE NONSTOP RNA SILENT SPLICE_SITE START_CODON_DEL START_CODON_SNP THREE_PRIME_UTR"

let numVcs=$( echo "${variantClassifications}" | tr ' ' '\n' | wc -l | sed 's#^[\t ]*##g' )

rawHeaderFile=$( mktemp )
tmpHeaderFile=$( mktemp )
tmpCountFile=$( mktemp )
tmpVcfFile=$( mktemp )
tmpSortedVcFile=$( mktemp )
tmpFile2=$( mktemp )

#rawHeaderFile=rawHeaderFile.txt
#tmpHeaderFile=tmpHeaderFile.txt
#tmpCountFile=tmpCountFile.txt
#tmpVcfFile=tmpVcfFile.txt
#tmpSortedVcFile=tmpSortedVcfFile.txt
#tmpFile2=tmpFile2.txt

#rm -f ${tmpHeaderFile} ${tmpVcfFile} ${rawHeaderFile} ${tmpFile2} ${tmpCountFile}

echo "Beginning extraction of up to ${maxResults} of each variant classification (total #VCs: ${numVcs})..." 1>&2

# Get the VCF header:
echo -n '    Copying Header Core ... ' 1>&2
grep '^#' ${inputFile} > ${rawHeaderFile}
grep -v '#contig=<' ${rawHeaderFile} | grep -v '^#CHROM' > $tmpHeaderFile
echo 'DONE!' 1>&2

# Get the variants:
i=1
for variantClassification in ${variantClassifications} ; do
	printf "    Processing %-23s (%2d of %d) ... " "${variantClassification}" "$i" "$numVcs" 1>&2
	grep "|${variantClassification}|" ${inputFile} | grep -v "^#" | head -n ${maxResults} > $tmpCountFile
	numFound=$( wc -l ${tmpCountFile} | awk '{print $1}' )
	cat ${tmpCountFile} >> ${tmpVcfFile}
	printf 'DONE%s (Found: %2d)\n' '!' "${numFound}" 1>&2
	let i=$i+1
done

# Sort VCF records:
sort -nk2 ${tmpVcfFile} > ${tmpSortedVcFile}

# Get the contig names from the variants:
grep -v "^#" ${tmpVcfFile} | awk '{print $1}' | sort | uniq > ${tmpFile2}

## check for chr in contig names in the sequence dictionary:
#grep '^#*contig=<ID' ${rawHeaderFile} | grep 'ID=chr' > /dev/null
#r=$?
#seqDictHasChr=false
#[ $r -eq 0 ] && seqDictHasChr=true
#
## Check for chr in contig names in the variants:
#grep -v '^#' ${tmpFile2} | head -n 1 | awk '{print $1}' | grep '^chr'  > /dev/null
#r=$?
#variantHasChr=false
#[ $r -eq 0 ] && variantHasChr=true
#
## Now generate the contigs in order:
## Get new contig values if the contig names don't match:
#if $seqDictHasChr ^ $variantHasChr; then
#	grep -v "^#" ${tmpVcfFile} | awk '{print $1}' | sort -tr -nk2 | uniq > ${tmpFile2}
#fi
#
#while read contig ; do
#	if $seqDictHasChr && ! $variantHasChr ; then
#		grep "#*contig=<ID=chr${contig}," ${rawHeaderFile}
#	elif ! $seqDictHasChr && $variantHasChr ; then
#		contig=$(echo ${contig} | sed 's#chr##g' )
#		grep "#*contig=<ID=${contig}," ${rawHeaderFile}
#	else
#		grep "#*contig=<ID=${contig}," ${rawHeaderFile}
#	fi
#done < ${tmpFile2} >> ${tmpHeaderFile}

# Add the sequence dictionary to the new file:
grep "#*contig=<ID=" ${rawHeaderFile} >> ${tmpHeaderFile}

# Assemble our output:
cat ${tmpHeaderFile}
echo -e '#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO'
while read contig ; do
	grep "^${contig}\t" ${tmpSortedVcFile}
done < ${tmpFile2} | awk '{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $5 "\t.\tPASS\t."}'

# Clean our garbage - we are not barbarians.
rm -f ${tmpHeaderFile} ${tmpVcfFile} ${rawHeaderFile} ${tmpFile2} ${tmpCountFile}
echo 'Extraction Complete!' 1>&2


text:
package rxscala

import java.util.concurrent.TimeUnit
import java.util.Date
import rxscala.observables.Observable

/**
 * This package contains all classes that RxScala users need.
 *
 * It mirrors the structure of package `rx`, but implementation classes that RxScala users
 * will not need are left out.
 */
object `package` {

  /**
   * Allows to construct observables in a similar way as futures.
   *
   * Example:
   *
   * {{{
   * implicit val scheduler = Schedulers.threadPoolForIO
   * val o: Observable[List[Friend]] = observable {
   *    session.getFriends
   * }
   * o.subscribe(
   *   friendList => println(friendList),
   *   err => println(err.getMessage)
   * )
   * }}}
   */
  def observable[T](body: => T)(implicit scheduler: Scheduler): Observable[T] = {
    Observable(1).observeOn(scheduler).map(_ => body)
  }
}


text:
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">

        </button>
        Homes for the Holidays!

        Login
        Member's Map

View Map

Gallery

Fireside Chat

Spread the Cheer!

FAQ

 Homes for the Holidays

 Love Christmas Lights? Find the Best Displays in your Area!

        View the Map
        Spread the Cheer

 View Lights in your Area

  <ui-gmap-google-map center="map.center" zoom="map.zoom" control="map.control" options="options">

    <ui-gmap-marker ng-repeat="(markerId, list) in mc.Marker"
            coords="list" idkey="markerId" icon="marker.bulbicon" options="marker.options">
      <ui-gmap-window isIconVisibleOnClick="true">

{{list.address}}

{{list.message}}
{{list.signature}}
{{list.rating}}

      </ui-gmap-window>
    </ui-gmap-marker>

  </ui-gmap-google-map>

Center this Map!

 By an Address

            <input class="input-large" id="address" placeholder="Type address here to center the map.">
            <input type="submit" class="btn btn-success" value="Recenter by Address" ng-click="mc.centerbyAddress()">

              <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
              {{addressStatus}}

  By Your Location

              <button class="btn btn-info" ng-click="mc.centerbyGeolocation()">Recenter by Geolocation</button>

 Accurate, but will take a few seconds to load.

                {{setProgress}}% Complete

 By Default Coordinates

              <button class="btn btn-success" ng-click="mc.refreshMap()">Recenter by Defaults</button>

 Christmas Fireside Chat

      Login to Join the Conversation

 Top Decorations Gallery

 A winter wonderland for animals

 A Christmas Beach House

 Santa's Workshop

Spread the Cheer!

Register to Share a House you Love!

  <form name="loginForm" class= "form-inline" ng-submit="mc.register()" novalidate>

      Email Address
      <input class="form-control" type="email" placeholder="Step 1: Add an Email" ng-model="mc.email" required>

      Password
      <input class="form-control" type="password" placeholder="Step 2: Add a Password"ng-model="mc.password" required>

Register

  </form>

Feedback about our Site

 "I wanted to show my daughter the lights in our area. This site makes it easy!"

        Cheerful Mom

 "I had no idea what beautiful displays my neighbors have created until the site showed these listings."

        Awed Fellow Homeowner

 "This site is only useful once a year."

        Yearly Lights Consumer

Frequently Asked Questions

            What is this site about?

            To show listings of houses that have been decorated for the holidays.

          Who puts up these listings?

          Anyone who is registered can add a home to the lights map. Registration is as simple as entering your email and adding a password to create an account.


text:
namespace DagreTests {
  const gDagre = new dagre.graphlib.Graph();
  gDagre.setGraph({})
    .setDefaultEdgeLabel(function(){ return ; })
    .setNode("a", {})
    .setEdge("b", "c")
    .setEdge("c", "d", {class: "class"});

  dagre.layout(gDagre);
}


text:
<?php

declare(strict_types=1);

namespace Czim\Filter\ParameterFilters;

use Czim\Filter\Contracts\FilterInterface;
use Czim\Filter\Contracts\ParameterFilterInterface;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Query\Builder;

/**
 * @template TModel of \Illuminate\Database\Eloquent\Model
 *
 * @implements ParameterFilterInterface<TModel>
 */
class NotEmpty implements ParameterFilterInterface
{
    /**
     * @param string|null $table
     * @param string|null $column if given, overrules the attribute name
     */
    public function __construct(
        protected readonly ?string $table = null,
        protected readonly ?string $column = null,
    ) {
    }

    /**
     * @param string                                 $name
     * @param mixed                                  $value
     * @param TModel|Builder|EloquentBuilder<TModel> $query
     * @param FilterInterface<TModel>                $filter
     * @return TModel|Builder|EloquentBuilder<TModel>
     */
    public function apply(
        string $name,
        mixed $value,
        Model|Builder|EloquentBuilder $query,
        FilterInterface $filter,
    ): Model|Builder|EloquentBuilder {
        $column = (! empty($this->table) ? $this->table . '.' : null)
            . (! empty($this->column) ? $this->column : $name);

        return $query
            ->whereNotNull($column)
            ->where($column, '!=', '');
    }
}


text:
/*
 * MethodScript Apps
 * This is the api for the apps.methodscript.com server. This provides various public functionality for users of the MethodScript programming language.
 *
 * OpenAPI spec version: 1.0.0
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package io.swagger.client.api;

import io.swagger.client.ApiCallback;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.ProgressRequestBody;
import io.swagger.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MetaApi {
    private ApiClient apiClient;

    public MetaApi() {
        this(Configuration.getDefaultApiClient());
    }

    public MetaApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    /**
     * Build call for pingGet
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call pingGetCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/ping";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "text/plain"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {

        };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] {  };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call pingGetValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        com.squareup.okhttp.Call call = pingGetCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Pings the server to check its status
     *
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public String pingGet() throws ApiException {
        ApiResponse<String> resp = pingGetWithHttpInfo();
        return resp.getData();
    }

    /**
     * Pings the server to check its status
     *
     * @return ApiResponse<String>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<String> pingGetWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = pingGetValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Pings the server to check its status (asynchronously)
     *
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     */
    public com.squareup.okhttp.Call pingGetAsync(final ApiCallback<String> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        com.squareup.okhttp.Call call = pingGetValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for rootGet
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call rootGetCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {

        };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] {  };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call rootGetValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        com.squareup.okhttp.Call call = rootGetCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * List services on this server
     * Lists the services that are available on this server. In general, clients must load this page first to determine supported services, and ensure that graceful fallbacks are provided if expected services are missing.
     * @return List<String>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<String> rootGet() throws ApiException {
        ApiResponse<List<String>> resp = rootGetWithHttpInfo();
        return resp.getData();
    }

    /**
     * List services on this server
     * Lists the services that are available on this server. In general, clients must load this page first to determine supported services, and ensure that graceful fallbacks are provided if expected services are missing.
     * @return ApiResponse<List<String>>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<String>> rootGetWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = rootGetValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * List services on this server (asynchronously)
     * Lists the services that are available on this server. In general, clients must load this page first to determine supported services, and ensure that graceful fallbacks are provided if expected services are missing.
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     */
    public com.squareup.okhttp.Call rootGetAsync(final ApiCallback<List<String>> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        com.squareup.okhttp.Call call = rootGetValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}


text:
package docker

import (
	"fmt"
	"github.com/mgutz/logxi/v1"
	"github.com/docker/engine-api/client"
	"github.com/docker/engine-api/types"
	"github.com/docker/engine-api/types/container"
	"github.com/docker/engine-api/types/filters"
	"github.com/docker/engine-api/types/network"
	"golang.org/x/net/context"
	/*
	"github.com/Sirupsen/logrus"
	*/
	"strconv"
	"os"
)

const scapeVersion = 1
const dockerVersion = "v1.22"
const dockerDaemon = "unix:///var/run/docker.sock"
const imageName = "dmp42/scape-go:testing"
const userAgent = "scape-go/1.0"

var cli *client.Client
// var log *logrus.Logger
var logger log.Logger
var ctx context.Context

func init() {
	logger = log.NewLogger(log.NewConcurrentWriter(os.Stdout), "docker")
	/*
	log = logrus.New()
	logger.Formatter = &logrus.TextFormatter{}
	logger.Out = os.Stdout
	logger.Level = logrus.DebugLevel
	*/

	defaultHeaders := map[string]string{"User-Agent": userAgent}
	var err error
	cli, err = client.NewClient(dockerDaemon, dockerVersion, nil, defaultHeaders)
	if err != nil {
		logger.Fatal("Failed to setup docker!", "err", err)
	}
}

// Selector is a high level construct to easily select scape containers
type Selector struct {
	Name string
	URL  string
	Path string
	//	Tags string
}

// Select returns a list of scape containers matching the passed Selector
func Select(selector Selector, running bool) []types.Container {
	logger.Debug("Entering Select with selector ", selector)
	args := filters.NewArgs()

	// Filter just our containers
	args.Add("label", "com.dmp42.scape")

	// Any optional argument passed, add them
	if selector.Name != "" {
		args.Add("name", selector.Name)
	}

	/*
		if selector.Tags != "" {
			args.Add("label", fmt.Sprintf("com.dmp42.scape.tags=%s", selector.Tags))
		}
	*/

	if selector.URL != "" {
		args.Add("label", fmt.Sprintf("com.dmp42.scape.url=%s", selector.URL))
	}

	if selector.Path != "" {
		args.Add("label", fmt.Sprintf("com.dmp42.scape.path=%s", selector.Path))
	}

	options := types.ContainerListOptions{All: !running, Filter: args}
	containers, err := cli.ContainerList(context.Background(), options)
	if err != nil {
		log.Fatal("Failed to run docker list command!", "err", err)
	}
	logger.Debug("Exiting Select with containers ", containers)
	return containers
}

// Stop lets you stop a scape container
func Stop(container types.Container) {
	logger.Debug("Entering Stop container ", container)
	cli.ContainerStop(context.Background(), container.ID, 0)
	logger.Debug("Exiting Stop")
}

// Remove lets you delete a scape container
func Remove(container types.Container) {
	logger.Debug("Entering Remove with container ", container)
	cli.ContainerRemove(context.Background(), types.ContainerRemoveOptions{
		ContainerID: container.ID,
		/*
			RemoveVolumes: true,
			RemoveLinks:   true,
		*/
		Force: true,
	})
	logger.Debug("Exiting Remove")
}

// Run starts a new scape container
func Run(selector Selector) {
	logger.Debug("Entering Run with selector ", selector)
	cc := container.Config{
		Image: imageName,
		Labels: map[string]string{
			"com.dmp42.scape": strconv.Itoa(scapeVersion),
			//			"com.dmp42.scape.tags": selector.Tags,
			"com.dmp42.scape.url":  selector.URL,
			"com.dmp42.scape.path": selector.Path,
		},
		Entrypoint: []string{"bash"},
		Env: []string{},
		Tty: true,
	}
	chc := container.HostConfig{
		Binds: []string{selector.Path + ":/src"},
	}
	response, err := cli.ContainerCreate(context.Background(), &cc, &chc, &network.NetworkingConfig{}, selector.Name)
	if err != nil {
		panic(err)
	}
	err = cli.ContainerStart(context.Background(), response.ID)
	if err != nil {
		panic(err)
	}
	logger.Debug("Exiting Run")
}

// Exec runs a command inside a running scape container
func Exec(selector Selector, cmd []string) {
	logger.Debug("Entering Exec with selector ", selector, " cmd ", cmd)
	ec := types.ExecConfig{
		Container:    selector.Name,
		AttachStdout: true,
		AttachStderr: true,
		AttachStdin:  true,
		Cmd:          cmd,
	}

	/*		User         string   // User that will run the command
			Privileged   bool     // Is the container in privileged mode
			Tty          bool     // Attach standard streams to a tty.
			Detach       bool     // Execute in detach mode
			DetachKeys   string   // Escape keys for detach
			Cmd          []string // Execution commands and args*/

	_, err := cli.ContainerExecCreate(context.Background(), ec)
	if err != nil {
		panic(err)
	}
	logger.Debug("Exiting Exec")
}

/*	err = cli.ContainerExecStart(context.Background(), resp.ID, config types.ExecStartCheck)
	if err != nil {
		panic(err)
	}*/

/*	resp, err = cli.ContainerExecAttach(context.Background(), resp.ID, ec)
	if err != nil {
		panic(err)
	}*/

/*
func FromName(name string) types.Container{
	logger.Debug("Entering FromName with container ", name)
	c := Select(&Selector{Name: name}, true)
	if len(c) > 0 {
		return c[0]
	}
	return nil
}
*/


text:
package org.elasticsearch.bootstrap;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.apache.lucene.util.Constants;
import org.elasticsearch.cluster.metadata.Metadata;
import org.elasticsearch.common.io.PathUtils;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.AbstractBootstrapCheckTestCase;
import org.elasticsearch.test.MockLogAppender;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Predicate;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class MaxMapCountCheckTests extends AbstractBootstrapCheckTestCase {

    // initialize as if the max map count is under the limit, tests can override by setting maxMapCount before executing the check
    private final AtomicLong maxMapCount = new AtomicLong(randomIntBetween(1, Math.toIntExact(BootstrapChecks.MaxMapCountCheck.LIMIT) - 1));
    private final BootstrapChecks.MaxMapCountCheck check = new BootstrapChecks.MaxMapCountCheck() {
        @Override
        long getMaxMapCount() {
            return maxMapCount.get();
        }
    };

    private void assertFailure(final BootstrapCheck.BootstrapCheckResult result) {
        assertTrue(result.isFailure());
        assertThat(
                result.getMessage(),
                equalTo(
                        "max virtual memory areas vm.max_map_count [" + maxMapCount.get() + "] is too low, "
                                + "increase to at least [" + BootstrapChecks.MaxMapCountCheck.LIMIT + "]"));
    }

    public void testMaxMapCountCheckBelowLimit() {
        assertFailure(check.check(emptyContext));
    }

    public void testMaxMapCountCheckBelowLimitAndMemoryMapAllowed() {
        /*
         * There are two ways that memory maps are allowed:
         *  - by default
         *  - mmap is explicitly allowed
         * We want to test that if mmap is allowed then the max map count check is enforced.
         */
        final List<Settings> settingsThatAllowMemoryMap = new ArrayList<>();
        settingsThatAllowMemoryMap.add(Settings.EMPTY);
        settingsThatAllowMemoryMap.add(Settings.builder().put("node.store.allow_mmap", true).build());

        for (final Settings settingThatAllowsMemoryMap : settingsThatAllowMemoryMap) {
            assertFailure(check.check(createTestContext(settingThatAllowsMemoryMap, Metadata.EMPTY_METADATA)));
        }
    }

    public void testMaxMapCountCheckNotEnforcedIfMemoryMapNotAllowed() {
        // nothing should happen if current vm.max_map_count is under the limit but mmap is not allowed
        final Settings settings = Settings.builder().put("node.store.allow_mmap", false).build();
        final BootstrapContext context = createTestContext(settings, Metadata.EMPTY_METADATA);
        final BootstrapCheck.BootstrapCheckResult result = check.check(context);
        assertTrue(result.isSuccess());
    }

    public void testMaxMapCountCheckAboveLimit() {
        // nothing should happen if current vm.max_map_count exceeds the limit
        maxMapCount.set(randomIntBetween(Math.toIntExact(BootstrapChecks.MaxMapCountCheck.LIMIT) + 1, Integer.MAX_VALUE));
        final BootstrapCheck.BootstrapCheckResult result = check.check(emptyContext);
        assertTrue(result.isSuccess());
    }

    public void testMaxMapCountCheckMaxMapCountNotAvailable() {
        // nothing should happen if current vm.max_map_count is not available
        maxMapCount.set(-1);
        final BootstrapCheck.BootstrapCheckResult result = check.check(emptyContext);
        assertTrue(result.isSuccess());
    }

    public void testGetMaxMapCountOnLinux() {
        if (Constants.LINUX) {
            final BootstrapChecks.MaxMapCountCheck check = new BootstrapChecks.MaxMapCountCheck();
            assertThat(check.getMaxMapCount(), greaterThan(0L));
        }
    }

    public void testGetMaxMapCount() throws IOException, IllegalAccessException {
        final long procSysVmMaxMapCount = randomIntBetween(1, Integer.MAX_VALUE);
        final BufferedReader reader = mock(BufferedReader.class);
        when(reader.readLine()).thenReturn(Long.toString(procSysVmMaxMapCount));
        final Path procSysVmMaxMapCountPath = PathUtils.get("/proc/sys/vm/max_map_count");
        BootstrapChecks.MaxMapCountCheck check = new BootstrapChecks.MaxMapCountCheck() {
            @Override
            BufferedReader getBufferedReader(Path path) throws IOException {
                assertEquals(path, procSysVmMaxMapCountPath);
                return reader;
            }
        };

        assertThat(check.getMaxMapCount(), equalTo(procSysVmMaxMapCount));
        verify(reader).close();

        {
            reset(reader);
            final IOException ioException = new IOException("fatal");
            when(reader.readLine()).thenThrow(ioException);
            final Logger logger = LogManager.getLogger("testGetMaxMapCountIOException");
            final MockLogAppender appender = new MockLogAppender();
            appender.start();
            appender.addExpectation(
                    new ParameterizedMessageLoggingExpectation(
                            "expected logged I/O exception",
                            "testGetMaxMapCountIOException",
                            Level.WARN,
                            "I/O exception while trying to read [{}]",
                            new Object[] { procSysVmMaxMapCountPath },
                            e -> ioException == e));
            Loggers.addAppender(logger, appender);
            assertThat(check.getMaxMapCount(logger), equalTo(-1L));
            appender.assertAllExpectationsMatched();
            verify(reader).close();
            Loggers.removeAppender(logger, appender);
            appender.stop();
        }

        {
            reset(reader);
            when(reader.readLine()).thenReturn("eof");
            final Logger logger = LogManager.getLogger("testGetMaxMapCountNumberFormatException");
            final MockLogAppender appender = new MockLogAppender();
            appender.start();
            appender.addExpectation(
                    new ParameterizedMessageLoggingExpectation(
                            "expected logged number format exception",
                            "testGetMaxMapCountNumberFormatException",
                            Level.WARN,
                            "unable to parse vm.max_map_count [{}]",
                            new Object[] { "eof" },
                            e -> e instanceof NumberFormatException && e.getMessage().equals("For input string: \"eof\"")));
            Loggers.addAppender(logger, appender);
            assertThat(check.getMaxMapCount(logger), equalTo(-1L));
            appender.assertAllExpectationsMatched();
            verify(reader).close();
            Loggers.removeAppender(logger, appender);
            appender.stop();
        }

    }

    private static class ParameterizedMessageLoggingExpectation implements MockLogAppender.LoggingExpectation {

        private boolean saw = false;

        private final String name;
        private final String loggerName;
        private final Level level;
        private final String messagePattern;
        private final Object[] arguments;
        private final Predicate<Throwable> throwablePredicate;

        private ParameterizedMessageLoggingExpectation(
                final String name,
                final String loggerName,
                final Level level,
                final String messagePattern,
                final Object[] arguments,
                final Predicate<Throwable> throwablePredicate) {
            this.name = name;
            this.loggerName = loggerName;
            this.level = level;
            this.messagePattern = messagePattern;
            this.arguments = arguments;
            this.throwablePredicate = throwablePredicate;
        }

        @Override
        public void match(final LogEvent event) {
            if (event.getLevel().equals(level) &&
                    event.getLoggerName().equals(loggerName) &&
                    event.getMessage() instanceof ParameterizedMessage) {
                final ParameterizedMessage message = (ParameterizedMessage)event.getMessage();
                saw = message.getFormat().equals(messagePattern) &&
                        Arrays.deepEquals(arguments, message.getParameters()) &&
                        throwablePredicate.test(event.getThrown());
            }
        }

        @Override
        public void assertMatched() {
            assertTrue(name, saw);
        }

    }

    public void testMaxMapCountCheckRead() throws IOException {
        final String rawProcSysVmMaxMapCount = Long.toString(randomIntBetween(1, Integer.MAX_VALUE));
        final BufferedReader reader = mock(BufferedReader.class);
        when(reader.readLine()).thenReturn(rawProcSysVmMaxMapCount);
        final BootstrapChecks.MaxMapCountCheck check = new BootstrapChecks.MaxMapCountCheck();
        assertThat(check.readProcSysVmMaxMapCount(reader), equalTo(rawProcSysVmMaxMapCount));
    }

    public void testMaxMapCountCheckParse() {
        final long procSysVmMaxMapCount = randomIntBetween(1, Integer.MAX_VALUE);
        final BootstrapChecks.MaxMapCountCheck check = new BootstrapChecks.MaxMapCountCheck();
        assertThat(check.parseProcSysVmMaxMapCount(Long.toString(procSysVmMaxMapCount)), equalTo(procSysVmMaxMapCount));
    }

}


text:
using System;
using System.Windows.Forms;

namespace FastGrid.Sample
{
	public static class Program
	{
		public static int Main (string []args)
		{
			Application.Run (new MainForm ());
			return 0;
		}
	}
}


text:
package org.jhaws.common.web.wicket.spectrum;

import org.jhaws.common.web.wicket.CssResourceReference;
import org.jhaws.common.web.wicket.JavaScriptResourceReference;
import org.jhaws.common.web.wicket.WicketApplication;

/**
 * @see http://bgrins.github.io/spectrum/#why
 */
public class Spectrum {
    public static final String RESOURCE_I18N_PATH = "i18n/";

    public static JavaScriptResourceReference SPECTRUM_JS = new JavaScriptResourceReference(Spectrum.class, "spectrum.js");

    public static CssResourceReference SPECTRUM_CSS = new CssResourceReference(Spectrum.class, "spectrum.css");

    public static JavaScriptResourceReference SPECTRUM_I18N_JS = new JavaScriptResourceReference(Spectrum.class, RESOURCE_I18N_PATH + "jquery.spectrum.js").addJavaScriptResourceReferenceDependency(SPECTRUM_JS);

    static {
        try {
            SPECTRUM_JS.addJavaScriptResourceReferenceDependency(WicketApplication.get().getJavaScriptLibrarySettings().getJQueryReference());
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}


text:
package com.javaeye.lonlysky.lforum.comm.utils.des;

/**
 * @author tianya
 *
 * 简单的DES加密算法
 */
import java.security.NoSuchAlgorithmException;
import java.security.Security;

import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

/**
 * DES加密的,文件中共有两个方法,加密、解密
 *
 */
@SuppressWarnings("unused")
public class DES2 {
	private String Algorithm = "DES";
	private KeyGenerator keygen;
	private SecretKey deskey;
	private Cipher cipher;
	private byte[] encryptorData;
	private byte[] decryptorData;

	/**
	 * 初始化 DES 实例
	 */
	public DES2() {
		init();
	}

	/**
	 * 初始化 DES 加密算法的一些参数
	 */
	public void init() {
		Security.addProvider(new com.sun.crypto.provider.SunJCE());
		try {
			keygen = KeyGenerator.getInstance(Algorithm);
			byte key[] = "12312345".getBytes();
			deskey = new SecretKeySpec(key, "DES");
			//  deskey = keygen.generateKey();
			for (int i = 0; i < deskey.getEncoded().length; i++) {
				System.out.println(deskey.getEncoded()[i]);
			}
			cipher = Cipher.getInstance(Algorithm);
		} catch (NoSuchAlgorithmException ex) {
			ex.printStackTrace();
		} catch (NoSuchPaddingException ex) {
			ex.printStackTrace();
		}
	}

	/**
	 * 对 byte[] 进行加密
	 * @param datasource 要加密的数据
	 * @return 返回加密后的 byte 数组
	 */
	public byte[] createEncryptor(byte[] datasource) {
		try {
			cipher.init(Cipher.ENCRYPT_MODE, deskey);
			encryptorData = cipher.doFinal(datasource);
		} catch (java.security.InvalidKeyException ex) {
			ex.printStackTrace();
		} catch (javax.crypto.BadPaddingException ex) {
			ex.printStackTrace();
		} catch (javax.crypto.IllegalBlockSizeException ex) {
			ex.printStackTrace();
		}
		return encryptorData;
	}

	/**
	 * 将字符串加密
	 *
	* @param datasource
	* @return
	* @throws Exception
	*/
	public byte[] createEncryptor(String datasource) throws Exception {
		return createEncryptor(datasource.getBytes());
	}

	/**
	 * 对 datasource 数组进行解密
	 * @param datasource 要解密的数据
	 * @return 返回加密后的 byte[]
	 */
	public byte[] createDecryptor(byte[] datasource) {
		try {
			cipher.init(Cipher.DECRYPT_MODE, deskey);
			decryptorData = cipher.doFinal(datasource);
		} catch (java.security.InvalidKeyException ex) {
			ex.printStackTrace();
		} catch (javax.crypto.BadPaddingException ex) {
			ex.printStackTrace();
		} catch (javax.crypto.IllegalBlockSizeException ex) {
			ex.printStackTrace();
		}
		return decryptorData;
	}

	/**
	 *
	 * 将 DES 加密过的 byte数组转换为字符串
	 *
	* @param dataByte
	* @return
	*/
	public String byteToString(byte[] dataByte) {
		String returnStr = null;
		BASE64Encoder be = new BASE64Encoder();
		returnStr = be.encode(dataByte);
		return returnStr;
	}

	/**
	 *
	 * 将字符串转换为DES算法可以解密的byte数组
	 *
	* @param dataByte
	* @return
	* @throws Exception
	*/
	public byte[] stringToByte(String datasource) throws Exception {
		BASE64Decoder bd = new BASE64Decoder();
		byte[] sorData = bd.decodeBuffer(datasource);
		return sorData;
	}

	/**
	 * 输出 byte数组
	 *
	* @param data
	*/
	public void printByte(byte[] data) {
		System.out.println("*********开始输出字节流**********");
		System.out.println("字节流: " + data.toString());
		for (int i = 0; i < data.length; i++) {
			System.out.println("第 " + i + "字节为:" + data[i]);
		}
		System.out.println("*********结束输出字节流**********");
	}

	/**
	 * 解密指定加密数据
	 * @return 解密数据
	 */
	public static String decode(String code) {
		DES2 des = new DES2();
		try {
			byte[] stringToByte = des.stringToByte(code);
			byte[] decryptorByte = des.createDecryptor(stringToByte);
			return new String(decryptorByte);
		} catch (Exception e) {
			return code;
		}
	}

	/**
	 * 加密指定字符串
	 * @param str 字符串
	 * @return 加密数据
	 */
	public static String encode(String str) {
		DES2 des = new DES2();
		try {
			byte[] encryptorByte = des.createEncryptor(str);
			return des.byteToString(encryptorByte);
		} catch (Exception e) {
			return str;
		}
	}

	public static void main(String args[]) throws Exception {
		String string = "我是中国人";
		System.out.println("加密前:"+string);
		String code = encode(string);
		System.out.println("加密后:"+code);
		System.out.println("解密后:"+decode(code));
	}

}


text:
var Mongoose = require('mongoose');

var VenueSchema = new Mongoose.Schema({
  	"name": String,
	"description": String,
	"imageURL": String,
	"favorited": Boolean,
	"address": String,
	"telephone": String,
	"hours": String,
	"website": String,
	"open": String,
	"closed": String,
	"latitude": String,
	"longitude": String,
	"category": String
});

exports.Venue = Mongoose.model('Venue', VenueSchema);

var AlertSchema = new Mongoose.Schema({
  	"venue": String,
	"alert": String,
	"severity": String,
	"timestamp": { type: Date, default: Date.now },
	"pretty_timestamp": {type: String, default: "just now"},
	"status": String
});

exports.Alert = Mongoose.model('Alert', AlertSchema);


text:
'use strict';

/**
* Create an iterator which generates an interleaved sequence of even integers.
*
* @module @stdlib/math/iter/sequences/even-integers
*
* @example
* var iterEvenIntegersSeq = require( '@stdlib/math/iter/sequences/even-integers' );
*
* var iter = iterEvenIntegersSeq();
*
* var v = iter.next().value;
* // returns 0
*
* v = iter.next().value;
* // returns 2
*
* v = iter.next().value;
* // returns -2
*
* // ...
*/

// MODULES //

var main = require( './main.js' );

// EXPORTS //

module.exports = main;


text:
package ee.pardiralli.converters;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import java.sql.Timestamp;
import java.time.LocalDateTime;

@Converter(autoApply = true)
public class LocalDateTimeConverter implements AttributeConverter<LocalDateTime, Timestamp> {

    @Override
    public java.sql.Timestamp convertToDatabaseColumn(java.time.LocalDateTime attribute) {
        return attribute == null ? null : java.sql.Timestamp.valueOf(attribute);
    }

    @Override
    public java.time.LocalDateTime convertToEntityAttribute(java.sql.Timestamp dbData) {
        return dbData == null ? null : dbData.toLocalDateTime();
    }
}


text:
CREATE TABLE "users" (
  "id" SERIAL NOT NULL,
  "email" VARCHAR(256) NOT NULL,
  "name" VARCHAR(128) NOT NULL,
  "created_at" TIMESTAMP NOT NULL DEFAULT (now() at time zone 'utc'),
  "updated_at" TIMESTAMP,
  "deleted_at" TIMESTAMP,
  PRIMARY KEY ("id")
);

CREATE UNIQUE INDEX "unique_user_emails" ON "users" ("email") WHERE ("deleted_at" IS NULL AND "email" != '');

CREATE TABLE "sessions" (
  "key" VARCHAR NOT NULL,
  "user_id" INTEGER NOT NULL REFERENCES users("id") ON DELETE CASCADE,
  "expires_at" TIMESTAMP NOT NULL,
  PRIMARY KEY ("key")
);

-- things
CREATE TABLE "things" (
  "id" SERIAL NOT NULL,
  "content" JSON NOT NULL,
  "created_at" TIMESTAMP NOT NULL DEFAULT (now() at time zone 'utc'),
  "updated_at" TIMESTAMP,
  "deleted_at" TIMESTAMP,
  PRIMARY KEY ("id")
);

-- +goose Down
DROP TABLE IF EXISTS "things";
DROP TABLE IF EXISTS "sessions";
DROP TABLE IF EXISTS "users";


text:
import * as assert from 'power-assert';
import * as mocha from "mocha";
import * as uap from '../dist/uaparser.min.js';
import * as yaml from 'js-yaml';
import * as path from 'path';
import * as fs from 'fs';
import { UATestCase, OSTestCase, DeviceTestCase } from './models.spec'

const testsDir = path.join('uap-core', 'tests/');
const tests = {
  'os': path.join(testsDir + 'test_os.yaml'),
  'device': path.join(testsDir + 'test_device.yaml'),
  'ua': path.join(testsDir + 'test_ua.yaml')
};

const optionalTestsDir = path.join('test', 'resource/');
const optionalTests = {
  'os': path.join(optionalTestsDir + 'optional_os.yaml'),
  'device': path.join(optionalTestsDir + 'optional_device.yaml'),
  'ua': path.join(optionalTestsDir + 'optional_ua.yaml')
};

const optionalFilePath = path.join('test', 'resource', 'optional_regexes.yaml');
const optionalPattern = parseYaml(optionalFilePath);

describe('Embedded Pattern Matching', () => {
  it('OS tests (UAP Core Test Resource)', () => {
    const fixtures = <OSTestCase[]>(parseYaml(tests.os)).test_cases;
    fixtures.forEach(element => {
      const testcase = new OSTestCase(element);
      const result = uap().parse(testcase.user_agent_string);
      assert.equal(result.os.family, testcase.family);
      assert.equal(result.os.major, testcase.major);
      assert.equal(result.os.minor, testcase.minor);
      assert.equal(result.os.patch, testcase.patch);
      assert.equal(result.os.patchMinor, testcase.patch_minor);
    });
  });

  it('Devices tests (UAP Core Test Resource)', () => {
    const fixtures = <DeviceTestCase[]>(parseYaml(tests.device)).test_cases;
    fixtures.forEach(element => {
      const testcase = new DeviceTestCase(element);
      const result = uap().parse(testcase.user_agent_string);
      assert.equal(result.device.family, testcase.family);
      assert.equal(result.device.brand, testcase.brand);
      assert.equal(result.device.model, testcase.model);
    });
  });

  it('UA tests (UAP Core Test Resource)', () => {
    const fixtures = <UATestCase[]>(parseYaml(tests.ua)).test_cases;
    fixtures.forEach(element => {
      const testcase = new UATestCase(element);
      const result = uap().parse(testcase.user_agent_string);
      assert.equal(result.ua.family, testcase.family);
      assert.equal(result.ua.major, testcase.major);
      assert.equal(result.ua.minor, testcase.minor);
      assert.equal(result.ua.patch, testcase.patch);
    });
  });
});

describe('Optional Pattern Matching',  () => {
  it('OS tests (UAP Core Test Resource)', () => {
    const fixtures = <OSTestCase[]>(parseYaml(tests.os)).test_cases;
    fixtures.forEach(element => {
      const testcase = new OSTestCase(element);
      const result = uap(optionalPattern).parse(testcase.user_agent_string);
      assert.equal(result.os.family, testcase.family);
      assert.equal(result.os.major, testcase.major);
      assert.equal(result.os.minor, testcase.minor);
      assert.equal(result.os.patch, testcase.patch);
      assert.equal(result.os.patchMinor, testcase.patch_minor);
    });
  });

  it('OS tests (Optional Resource)', () => {
    const fixtures = <OSTestCase[]>(parseYaml(optionalTests.os).test_cases);
    fixtures.forEach(element => {
      const testcase = new OSTestCase(element);
      const result = uap(optionalPattern).parse(testcase.user_agent_string);
      assert.equal(result.os.family, testcase.family);
      assert.equal(result.os.major, testcase.major);
      assert.equal(result.os.minor, testcase.minor);
      assert.equal(result.os.patch, testcase.patch);
      assert.equal(result.os.patchMinor, testcase.patch_minor);
    });
  });

  it('Devices tests (UAP Core Test Resource)', () => {
    const fixtures = <DeviceTestCase[]>(parseYaml(tests.device)).test_cases;
    fixtures.forEach(element => {
      const testcase = new DeviceTestCase(element);
      const result = uap(optionalPattern).parse(testcase.user_agent_string);
      assert.equal(result.device.family, testcase.family);
      assert.equal(result.device.brand, testcase.brand);
      assert.equal(result.device.model, testcase.model);
    });
  });

  it('Device tests (Optional Resource', () => {
    const fixtures = <DeviceTestCase[]>(parseYaml(optionalTests.device)).test_cases;
    fixtures.forEach(element => {
      const testcase = new DeviceTestCase(element);
      const result = uap(optionalPattern).parse(testcase.user_agent_string);
      assert.equal(result.device.family, testcase.family);
      assert.equal(result.device.brand, testcase.brand);
      assert.equal(result.device.model, testcase.model);
    });
  });

  it('UA tests (UAP Core Test Resource)', () => {
    const fixtures = <UATestCase[]>(parseYaml(tests.ua)).test_cases;
    fixtures.forEach(element => {
      const testcase = new UATestCase(element);
      const result = uap(optionalPattern).parse(testcase.user_agent_string);
      assert.equal(result.ua.family, testcase.family);
      assert.equal(result.ua.major, testcase.major);
      assert.equal(result.ua.minor, testcase.minor);
      assert.equal(result.ua.patch, testcase.patch);
    });
  });

  it('UA tests (Optional Resource)', () => {
    const fixtures = <UATestCase[]>(parseYaml(optionalTests.ua)).test_cases;
    fixtures.forEach(element => {
      const testcase = new UATestCase(element);
      const result = uap(optionalPattern).parse(testcase.user_agent_string);
      assert.equal(result.ua.family, testcase.family);
      assert.equal(result.ua.major, testcase.major);
      assert.equal(result.ua.minor, testcase.minor);
      assert.equal(result.ua.patch, testcase.patch);
    });
  });
});

function parseYaml(fileName: string) {
  const file = fs.readFileSync(fileName);
  return yaml.load(file.toString(), { schema: yaml.FAILSAFE_SCHEMA });
}


text:
package main

import (
	"errors"
	"flag"
	"fmt"
	"io/ioutil"
	"os"
	b "scummatlas/binaryutils"
	s "scummatlas/script"
)

func main() {
	var infile string
	var isDebug bool

	flag.StringVar(&infile, "in", "REQUIRED", "File to parse")
	flag.BoolVar(&isDebug, "debug", false, "Show offsets and do not beautify conditionals")
	flag.Parse()

	if infile == "REQUIRED" {
		fmt.Println("missing compulsory parameter\n")
		flag.PrintDefaults()
		os.Exit(1)
	}

	data, err := ioutil.ReadFile(infile)
	if err != nil {
		fmt.Println("Can't read the file", infile)
		os.Exit(1)
	}

	script, err := parseScript(data)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
	if isDebug {
		fmt.Println(script.Debug())
	} else {
		fmt.Println(script.Print())
	}
}

func parseScript(data []byte) (s.Script, error) {
	blockType := b.FourCharString(data, 0)
	var script s.Script
	initialOffset := -1
	switch blockType {
	case "SCRP", "VERB":
		initialOffset = 8
	case "LSCR":
		initialOffset = 9
	}
	if initialOffset == -1 {
		return nil, errors.New(blockType + "is not a supported script block")
	}
	script = s.ParseScriptBlock(data[initialOffset:])
	return script, nil
}


text:
const _ = require('underscore');

const AbilityDsl = require('./abilitydsl.js');
const DelayedEffect = require('./DelayedEffect.js');
const GameObject = require('./GameObject');
const TerminalCondition = require('./TerminalCondition.js');

const { Locations, Durations, Stages } = require('./Constants');

// This class is inherited by Ring and BaseCard and also represents Framework effects

class EffectSource extends GameObject {
    constructor(game, name = 'Framework effect') {
        super(game, name);
    }

    /**
     * Applies an immediate effect which lasts until the end of the current
     * duel.
     */
    untilEndOfDuel(propertyFactory) {
        var properties = propertyFactory(AbilityDsl);
        this.addEffectToEngine(Object.assign({ duration: Durations.UntilEndOfDuel, location: Locations.Any }, properties));
    }

    /**
     * Applies an immediate effect which lasts until the end of the current
     * conflict.
     */
    untilEndOfConflict(propertyFactory) {
        var properties = propertyFactory(AbilityDsl);
        this.addEffectToEngine(Object.assign({ duration: Durations.UntilEndOfConflict, location: Locations.Any }, properties));
    }

    /**
     * Applies an immediate effect which lasts until the end of the phase.
     */
    untilEndOfPhase(propertyFactory) {
        var properties = propertyFactory(AbilityDsl);
        this.addEffectToEngine(Object.assign({ duration: Durations.UntilEndOfPhase, location: Locations.Any }, properties));
    }

    /**
     * Applies an immediate effect which lasts until the end of the round.
     */
    untilEndOfRound(propertyFactory) {
        var properties = propertyFactory(AbilityDsl);
        this.addEffectToEngine(Object.assign({ duration: Durations.UntilEndOfRound, location: Locations.Any }, properties));
    }

    /**
     * Applies a lasting effect which lasts until an event contained in the
     * `until` property for the effect has occurred.
     */
    lastingEffect(propertyFactory) {
        let properties = propertyFactory(AbilityDsl);
        this.addEffectToEngine(Object.assign({ duration: Durations.Custom, location: Locations.Any }, properties));
    }

    /**
     * Applies a delayed effect
     */
    delayedEffect(propertyFactory) {
        let effect = new DelayedEffect(this.game, this, propertyFactory(AbilityDsl));
        this.game.effectEngine.addDelayedEffect(effect);
        return effect;
    }

    /**
     * Applies a terminal condition
     */
    terminalCondition(propertyFactory) {
        let effect = new TerminalCondition(this.game, this, propertyFactory(AbilityDsl));
        this.game.effectEngine.addTerminalCondition(effect);
        return effect;
    }

    /*
     * Adds a persistent/lasting/delayed effect to the effect engine
     * @param {Object} properties - properties for the effect - see Effects/Effect.js
     */
    addEffectToEngine(properties) {
        let effect = properties.effect;
        properties = _.omit(properties, Stages.Effect);
        if(Array.isArray(effect)) {
            return effect.map(factory => this.game.effectEngine.add(factory(this.game, this, properties)));
        }
        return [this.game.effectEngine.add(effect(this.game, this, properties))];
    }

    removeEffectFromEngine(effectArray) {
        this.game.effectEngine.unapplyAndRemove(effect => effectArray.includes(effect));
    }

    removeLastingEffects() {
        this.game.effectEngine.removeLastingEffects(this);
    }
}

module.exports = EffectSource;