text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace CMS.Client.Admin {

    public partial class editadmin {

        /// <summary>
        /// imgIcon control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Image imgIcon;

        /// <summary>
        /// litModules control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Literal litModules;

        /// <summary>
        /// btn_home control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink btn_home;

        /// <summary>
        /// btn_editpage control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink btn_editpage;

        /// <summary>
        /// HyperLink1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink HyperLink1;

        /// <summary>
        /// btn_add control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink btn_add;

        /// <summary>
        /// ImageButton1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.ImageButton ImageButton1;

        /// <summary>
        /// btn_edit control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink btn_edit;

        /// <summary>
        /// ImageButton3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.ImageButton ImageButton3;

        /// <summary>
        /// HyperLink3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink HyperLink3;

        /// <summary>
        /// error control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Literal error;

        /// <summary>
        /// Label15 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label15;

        /// <summary>
        /// rdbLoginType control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RadioButtonList rdbLoginType;

        /// <summary>
        /// Label2 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label2;

        /// <summary>
        /// txtAdminName control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox txtAdminName;

        /// <summary>
        /// RequiredFieldValidator1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;

        /// <summary>
        /// lblAdminPass control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label lblAdminPass;

        /// <summary>
        /// txtAdminPass control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox txtAdminPass;

        /// <summary>
        /// Label3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label3;

        /// <summary>
        /// txtAdminEmail control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox txtAdminEmail;

        /// <summary>
        /// RegularExpressionValidator1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator1;

        /// <summary>
        /// RequiredFieldValidator3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator3;

        /// <summary>
        /// Label7 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label7;

        /// <summary>
        /// txtFullName control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox txtFullName;

        /// <summary>
        /// RequiredFieldValidator5 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator5;

        /// <summary>
        /// Label8 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label8;

        /// <summary>
        /// txtBirth control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::Telerik.Web.UI.RadDatePicker txtBirth;

        /// <summary>
        /// Label9 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label9;

        /// <summary>
        /// rdbSex control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RadioButtonList rdbSex;

        /// <summary>
        /// Label10 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label10;

        /// <summary>
        /// txtPhone control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox txtPhone;

        /// <summary>
        /// Label11 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label11;

        /// <summary>
        /// txtAddress control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox txtAddress;

        /// <summary>
        /// Label12 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label12;

        /// <summary>
        /// txtNickYahoo control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox txtNickYahoo;

        /// <summary>
        /// Label13 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label13;

        /// <summary>
        /// txtNickSkype control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox txtNickSkype;

        /// <summary>
        /// Label14 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label14;

        /// <summary>
        /// txtAvatar control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.FileUpload txtAvatar;

        /// <summary>
        /// RegularExpressionValidator3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator3;

        /// <summary>
        /// uploadPreview control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlImage uploadPreview;

        /// <summary>
        /// Label5 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label5;

        /// <summary>
        /// rdbList control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RadioButtonList rdbList;

        /// <summary>
        /// Label6 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label6;

        /// <summary>
        /// chklist control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.CheckBoxList chklist;

        /// <summary>
        /// hddAdmin_Username control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HiddenField hddAdmin_Username;

        /// <summary>
        /// hdd_Created control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HiddenField hdd_Created;

        /// <summary>
        /// hdd_log control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HiddenField hdd_log;

        /// <summary>
        /// hddPass control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HiddenField hddPass;

        /// <summary>
        /// hddImageThumb control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HiddenField hddImageThumb;
    }
}


text:
export * from './constants';
export * from './models';
export * from './preview';

if (module && module.hot && module.hot.decline) {
  module.hot.decline();
}

redpajama_set_name: RedPajamaGithub


text:
package org.amdatu.remote.discovery;

import org.apache.felix.dm.DependencyActivatorBase;
import org.osgi.framework.BundleContext;
/**
 * Activator that does not use any form of discovery encryption.
 * @author Sudohenk
 *
 */
public abstract class AbstractNoEncryptionActivator extends DependencyActivatorBase {

    public void initEncryption(BundleContext context) throws Exception {

    }
    /**
     * Simply returns the input string.
     * @param plaintext
     * @return plaintext
     * @throws Exception
     */
    public String encrypt(String plaintext) throws Exception {
        return plaintext;
    }
    /**
     * Simply returns the input string.
     * @param ciphertext
     * @return ciphertext (which should be plaintext, if encryption() was used).
     * @throws Exception
     */
    public String decrypt(String ciphertext) throws Exception {
        return ciphertext;
    }
}


text: export * from './IPOTask';


text:
require 'spec_helper'

module Flatter
  module MappingSpec
    class A
      include ActiveModel::Model

      attr_accessor :a1, :a2, :a3, :a4
    end

    class MapperA < Mapper
      map :a1, attr2: :a2
      map :a4, writer: false
    end
  end

  describe Mapper::Mapping do
    let(:model)  { MappingSpec::A.new(a1: 'a1', a2: 'a2', a3: 'a3', a4: 'a4') }
    let(:mapper) { MappingSpec::MapperA.new(model) }

    describe '#mappings' do
      it 'returns hash of defined mappings' do
        expect(mapper.mappings).to be_a Hash
        expect(mapper.mappings).to include 'a1', 'attr2'
      end
    end

    specify '#mapping_names' do
      expect(mapper.mapping_names).to match_array %w(a1 attr2 a4)
    end

    specify '#writable_mapping_names' do
      expect(mapper.writable_mapping_names).to match_array %w(a1 attr2)
    end

    describe 'reading' do
      it 'reads values from target object' do
        expect(mapper.read).to eq('a1' => 'a1', 'attr2' => 'a2', 'a4' => 'a4')
      end

      it 'can be read via brackets' do
        expect(mapper[:a1]).to eq 'a1'
      end
    end

    describe 'writing' do
      it 'propagates values to target' do
        mapper.write(a1: 'a12', attr2: 'a22')

        expect(model.a1).to eq 'a12'
        expect(model.a2).to eq 'a22'
      end

      it 'ignores unmapped values' do
        expect{ mapper.write(a3: 'a32') }.not_to change{ model.a3 }
      end

      it 'can be written via brackets' do
        mapper[:attr2] = 'a22'
        expect(model.a2).to eq 'a22'
      end
    end
  end
end


text:
package io.jenetics.internal.util;

import java.util.Arrays;
import java.util.Objects;

/**
 * Static methods for simple and efficient hash-code calculation.
 *
 * @author Franz Wilhelmstötter
 * @version 4.3
 * @since 4.3
 */
public final class Hashes {

	private static final int P1 = 47;
	private static final int P2 = 103;
	private static final int P3 = 197;

	private Hashes() {
	}

	public static int hash(final Object value, final int seed) {
		return seed + P2*Objects.hashCode(value) + P3;
	}

	public static int hash(final Object value) {
		return hash(value, P1);
	}

	public static int hash(final Object[] value, final int seed) {
		return seed + P2*Arrays.hashCode(value) + P3;
	}

	public static int hash(final Object[] value) {
		return hash(value, P1);
	}

	public static int hash(final byte value, final int seed) {
		return seed + P2*Byte.hashCode(value) + P3;
	}

	public static int hash(final byte value) {
		return hash(value, P1);
	}

	public static int hash(final byte[] value, final int seed) {
		return seed + P2*Arrays.hashCode(value) + P3;
	}

	public static int hash(final byte[] value) {
		return hash(value, P1);
	}

	public static int hash(final char value, final int seed) {
		return seed + P2*Character.hashCode(value) + P3;
	}

	public static int hash(final char value) {
		return hash(value, P1);
	}

	public static int hash(final char[] value, final int seed) {
		return seed + P2*Arrays.hashCode(value) + P3;
	}

	public static int hash(final char[] value) {
		return hash(value, P1);
	}

	public static int hash(final short value, final int seed) {
		return seed + P2*Short.hashCode(value) + P3;
	}

	public static int hash(final short value) {
		return hash(value, P1);
	}

	public static int hash(final short[] value, final int seed) {
		return seed + P2*Arrays.hashCode(value) + P3;
	}

	public static int hash(final short[] value) {
		return hash(value, P1);
	}

	public static int hash(final int value, final int seed) {
		return seed + P2*Integer.hashCode(value) + P3;
	}

	public static int hash(final int value) {
		return hash(value, P1);
	}

	public static int hash(final int[] value, final int seed) {
		return seed + P2*Arrays.hashCode(value) + P3;
	}

	public static int hash(final int[] value) {
		return hash(value, P1);
	}

	public static int hash(final long value, final int seed) {
		return seed + P2*Long.hashCode(value) + P3;
	}

	public static int hash(final long value) {
		return hash(value, P1);
	}

	public static int hash(final long[] value, final int seed) {
		return seed + P2*Arrays.hashCode(value) + P3;
	}

	public static int hash(final long[] value) {
		return hash(value, P1);
	}

	public static int hash(final float value, final int seed) {
		return seed + P2*Float.hashCode(value) + P3;
	}

	public static int hash(final float value) {
		return hash(value, P1);
	}

	public static int hash(final float[] value, final int seed) {
		return seed + P2*Arrays.hashCode(value) + P3;
	}

	public static int hash(final float[] value) {
		return hash(value, P1);
	}

	public static int hash(final double value, final int seed) {
		return seed + P2*Double.hashCode(value) + P3;
	}

	public static int hash(final double value) {
		return hash(value, P1);
	}

	public static int hash(final double[] value, final int seed) {
		return seed + P2*Arrays.hashCode(value) + P3;
	}

	public static int hash(final double[] value) {
		return hash(value, P1);
	}

}


text:
@class VIMQuantityQuota;
@class VIMSizeQuota;

@interface VIMUploadQuota : VIMModelObject

@property (nonatomic, strong, nullable) VIMQuantityQuota *quantityQuota;
@property (nonatomic, strong, nullable) VIMSizeQuota *sizeQuota;

@end


text:
package eu.tobiasheine.bitcoinwatcher.di;

import javax.inject.Singleton;

import dagger.Component;
import eu.tobiasheine.bitcoinwatcher.BitcoinWatcherApplication;
import eu.tobiasheine.bitcoinwatcher.SettingsActivity;
import eu.tobiasheine.bitcoinwatcher.dao.storage.IStorage;
import eu.tobiasheine.bitcoinwatcher.price_sync.BitcoinPriceHandler;
import eu.tobiasheine.bitcoinwatcher.price_sync.ISynchronization;
import eu.tobiasheine.bitcoinwatcher.price_sync.SyncAdapter;
import eu.tobiasheine.bitcoinwatcher.price_sync.SyncService;
import eu.tobiasheine.bitcoinwatcher.price_sync.notifications.IHandheldNotifications;
import eu.tobiasheine.bitcoinwatcher.price_sync.notifications.IWearableNotifications;
import eu.tobiasheine.bitcoinwatcher.settings.ISettings;
import eu.tobiasheine.bitcoinwatcher.widget.BitcoinWatcherWidgetProvider;

@Singleton
@Component(modules = {
        BitcoinModule.class,
        ContextModule.class,
        SettingsModule.class,
        StorageModule.class,
        SynchronizationModule.class,
        NotificationsModule.class}
)
public interface Dependencies {

    void inject(BitcoinWatcherWidgetProvider widgetProvider);

    void inject(SettingsActivity settingsActivity);

    void inject(SyncService syncService);

    void inject(BitcoinPriceHandler bitcoinPriceHandler);

    void inject(SyncAdapter syncAdapter);

    ISettings getSettings();

    ISynchronization getSynchronization();

}


text:
import { createServer } from 'http';
import { assets } from '../../../scripts';

const server = createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/html' });

  let loadedAssets = { js: [] };

  try {
    // do not use require because webpack can't figure out expression
    loadedAssets = assets();
  } catch (e) {
    console.error(e);
  }

  res.end(`

        <title>Spust!!</title>

Hello World

        ${loadedAssets.js.map(script => `<script src="${script}"></script>`).join('\n')}

  `);
});

const PORT = parseInt(process.env.PORT || 3000, 10);

server.listen(PORT, '0.0.0.0', () => console.log(`listening on ${PORT}`));

export default server;


text:
        <?php $username = $this->session->userdata('emp_name');?>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    Toggle navigation

                </button>
                Mirad Jewelries

                    Deactivations

                            Clients 25

                            Categories 8

                            Products 14

                            Administrators 2

                            View All

                    Messages

MarekaWilly

 Yesterday at 4:32 PM

Just started on admin module

Likhanga Leslie

 Yesterday at 7:27 PM

Almost done with the work ?

Kirika Jeremiah

 Yesterday at 9:57 PM

Got the work from GitHub

                            Read All New Messages

                    Notifications

                            New System Client

                            Complaint Stock Manager

                            Suugestion Manager

                            View All

                     <?php echo $username ;?>

                            <a href="<?php echo base_url(). 'stockmanager/viewemployee/'.$this->session->userdata('emp_id')?>"> Profile

                             Inbox

                            <a href="<?php echo base_url(). 'admin/logout'?>"> Log Out


text:
require 'rubygems'

if RUBY_VERSION >= '1.9'
  require 'time'
  require 'date'
  require 'active_support/time'
else
  require 'active_support'
  require 'active_support/core_ext'
end

require 'test/unit'
require 'shoulda'
require 'timecop'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'quarter_time'

class Test::Unit::TestCase
end


text:
/**
 * Test gulp-deploy-ftp
 */

var File = require('vinyl');
var assert = require('assert');
var es = require('event-stream');
var mock = require('mockery');

var MockFtp = require('./mocks/mock_ftp');
var gulpDeployFtp = require('../index');

mock.registerMock('ftp', MockFtp);

var options = {
  user: 'test',
  password: 'test',
  filename: '000',
  port: 12345,
  host: 'localhost'
};

describe('Test gulp-deploy-ftp', function () {
  before(function () {
    mock.enable();
  });
  describe('in stream mode', function () {
    it('should be ok', function (done) {
      var file = new File({
        path: options.filename,
        contents: es.readArray(['hello world'])
      });

      gulpDeployFtp(options).write(file);
      done();
    });
  });
  describe('in buffer mode', function () {
    it('should be ok', function (done) {
      var file = new File({
        path: options.filename,
        contents: new Buffer('hello world')
      });

      gulpDeployFtp(options).write(file);
      done();
    });
  });
  after(function () {
    mock.disable();
  });
});


text:
import * as React from 'react';
import Box from '@mui/material/Box';
import ClickAwayListener from '@mui/material/ClickAwayListener';
import { SxProps } from '@mui/system';

export default function LeadingClickAway() {
  const [open, setOpen] = React.useState(false);

  const handleClick = () => {
    setOpen((prev) => !prev);
  };

  const handleClickAway = () => {
    setOpen(false);
  };

  const styles: SxProps = {
    position: 'absolute',
    top: 28,
    right: 0,
    left: 0,
    zIndex: 1,
    border: '1px solid',
    p: 1,
    bgcolor: 'background.paper',
  };

  return (
    <ClickAwayListener
      mouseEvent="onMouseDown"
      touchEvent="onTouchStart"
      onClickAway={handleClickAway}
    >
      <Box sx={{ position: 'relative' }}>
        <button type="button" onClick={handleClick}>
          Open menu dropdown
        </button>
        {open ? (
          <Box sx={styles}>
            Click me, I will stay visible until you click outside.
          </Box>
        ) : null}
      </Box>
    </ClickAwayListener>
  );
}


text:
//// [unspecializedConstraints.ts]
module ts {
    interface Map<T> {
        [index: string]: T;
    }

    interface Equals<T> {
        equals(other: T): boolean;
    }

    class Symbol {
    }

    class Type extends Symbol {
        equals(that: Type): boolean {
            if (this === that) return true;
            if (!(this.isObjectType() && that.isObjectType())) return false;
            var propCount = that.getPropertyCount();
            if (propCount !== this.getPropertyCount()) return false;
            var sigCount = that.getSignatureCount();
            if (sigCount !== this.getSignatureCount()) return false;
            if (propCount) {
                for (var i = 0; i < propCount; i++) {
                    var thisProp = this.getProperty(i);
                    var thatProp = that.getPropertyByName(thisProp.name);
                    if (!(thatProp && thisProp.flags === thatProp.flags && thisProp.type.equals(thatProp.type))) return false;
                }
            }
            if (sigCount) {
                if (!setEquals(this.getSignatures(), that.getSignatures())) return false;
            }
            return true;
        }
        getProperties(): Property[] {
            return [];
        }
        getProperty(index: number): Property {
            return undefined;
        }
        getPropertyByName(name: string): Property {
            return undefined;
        }
        getPropertyCount(): number {
            return 0;
        }
        getSignature(index: number): Signature {
            return undefined;
        }
        getSignatureCount(): number {
            return 0;
        }
        getSignatures(): Signature[] {
            return [];
        }
        isPrimitive(): boolean {
            return false;
        }
        isObjectType(): boolean {
            return false;
        }
        isTypeParameter(): boolean {
            return false;
        }
        isSubTypeOf(type: Type) {
        }
    }

    class Property extends Symbol {
        constructor(public name: string, public type: Type, public flags: PropertyFlags) {
            super();
        }
        equals(other: Property): boolean {
            return this.name === other.name &&
                this.flags === other.flags &&
                this.type.equals(other.type);
        }
    }

    enum PropertyFlags {
        Optional = 1,
        Private = 2
    }

    class Signature extends Symbol {
        constructor(public typeParameters: TypeParameter[], public parameters: Parameter[], public returnType: Type) {
            super();
        }
        equalsNoReturn(other: Signature): boolean {
            return this.parameters.length === other.parameters.length &&
                this.typeParameters.length === other.typeParameters.length &&
                arrayEquals(this.parameters, other.parameters) &&
                arrayEquals(this.typeParameters, other.typeParameters);
        }
        equals(other: Signature): boolean {
            return this.equalsNoReturn(other) &&
                this.returnType.equals(other.returnType);
        }
    }

    class Parameter extends Symbol {
        constructor(public name: string, public type: Type, public flags: ParameterFlags) {
            super();
        }
        equals(other: Parameter) {
            return this.name === other.name &&
                this.flags === other.flags &&
                this.type.equals(other.type);
        }
    }

    enum ParameterFlags {
        Optional = 1,
        Rest = 2
    }

    var hasOwnProperty = Object.prototype.hasOwnProperty;

    function getProperty<T>(map: Map<T>, key: string): T {
        if (!hasOwnProperty.call(map, key)) return undefined;
        return map[key];
    }

    function hasProperty<T>(map: Map<T>, key: string): boolean {
        return hasOwnProperty.call(map, key);
    }

    function arrayContains<T extends Equals<T>>(a: T[], item: T): boolean {
        var len = a.length;
        for (var i = 0; i < len; i++) {
            if (item.equals(a[i])) return true;
        }
        return false;
    }

    function arrayEquals<T extends Equals<T>>(a: T[], b: T[]): boolean {
        var len = a.length;
        if (b.length !== len) return false;
        for (var i = 0; i < len; i++) {
            if (!a[i].equals(b[i])) return false;
        }
        return true;
    }

    function setEquals<T extends Equals<T>>(a: T[], b: T[]): boolean {
        var len = a.length;
        if (b.length !== len) return false;
        for (var i = 0; i < len; i++) {
            if (!arrayContains(b, a[i])) return false;
        }
        return true;
    }
}

//// [unspecializedConstraints.js]
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var ts;
(function (ts) {
    var Symbol = /** @class */ (function () {
        function Symbol() {
        }
        return Symbol;
    }());
    var Type = /** @class */ (function (_super) {
        __extends(Type, _super);
        function Type() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        Type.prototype.equals = function (that) {
            if (this === that)
                return true;
            if (!(this.isObjectType() && that.isObjectType()))
                return false;
            var propCount = that.getPropertyCount();
            if (propCount !== this.getPropertyCount())
                return false;
            var sigCount = that.getSignatureCount();
            if (sigCount !== this.getSignatureCount())
                return false;
            if (propCount) {
                for (var i = 0; i < propCount; i++) {
                    var thisProp = this.getProperty(i);
                    var thatProp = that.getPropertyByName(thisProp.name);
                    if (!(thatProp && thisProp.flags === thatProp.flags && thisProp.type.equals(thatProp.type)))
                        return false;
                }
            }
            if (sigCount) {
                if (!setEquals(this.getSignatures(), that.getSignatures()))
                    return false;
            }
            return true;
        };
        Type.prototype.getProperties = function () {
            return [];
        };
        Type.prototype.getProperty = function (index) {
            return undefined;
        };
        Type.prototype.getPropertyByName = function (name) {
            return undefined;
        };
        Type.prototype.getPropertyCount = function () {
            return 0;
        };
        Type.prototype.getSignature = function (index) {
            return undefined;
        };
        Type.prototype.getSignatureCount = function () {
            return 0;
        };
        Type.prototype.getSignatures = function () {
            return [];
        };
        Type.prototype.isPrimitive = function () {
            return false;
        };
        Type.prototype.isObjectType = function () {
            return false;
        };
        Type.prototype.isTypeParameter = function () {
            return false;
        };
        Type.prototype.isSubTypeOf = function (type) {
        };
        return Type;
    }(Symbol));
    var Property = /** @class */ (function (_super) {
        __extends(Property, _super);
        function Property(name, type, flags) {
            var _this = _super.call(this) || this;
            _this.name = name;
            _this.type = type;
            _this.flags = flags;
            return _this;
        }
        Property.prototype.equals = function (other) {
            return this.name === other.name &&
                this.flags === other.flags &&
                this.type.equals(other.type);
        };
        return Property;
    }(Symbol));
    var PropertyFlags;
    (function (PropertyFlags) {
        PropertyFlags[PropertyFlags["Optional"] = 1] = "Optional";
        PropertyFlags[PropertyFlags["Private"] = 2] = "Private";
    })(PropertyFlags || (PropertyFlags = {}));
    var Signature = /** @class */ (function (_super) {
        __extends(Signature, _super);
        function Signature(typeParameters, parameters, returnType) {
            var _this = _super.call(this) || this;
            _this.typeParameters = typeParameters;
            _this.parameters = parameters;
            _this.returnType = returnType;
            return _this;
        }
        Signature.prototype.equalsNoReturn = function (other) {
            return this.parameters.length === other.parameters.length &&
                this.typeParameters.length === other.typeParameters.length &&
                arrayEquals(this.parameters, other.parameters) &&
                arrayEquals(this.typeParameters, other.typeParameters);
        };
        Signature.prototype.equals = function (other) {
            return this.equalsNoReturn(other) &&
                this.returnType.equals(other.returnType);
        };
        return Signature;
    }(Symbol));
    var Parameter = /** @class */ (function (_super) {
        __extends(Parameter, _super);
        function Parameter(name, type, flags) {
            var _this = _super.call(this) || this;
            _this.name = name;
            _this.type = type;
            _this.flags = flags;
            return _this;
        }
        Parameter.prototype.equals = function (other) {
            return this.name === other.name &&
                this.flags === other.flags &&
                this.type.equals(other.type);
        };
        return Parameter;
    }(Symbol));
    var ParameterFlags;
    (function (ParameterFlags) {
        ParameterFlags[ParameterFlags["Optional"] = 1] = "Optional";
        ParameterFlags[ParameterFlags["Rest"] = 2] = "Rest";
    })(ParameterFlags || (ParameterFlags = {}));
    var hasOwnProperty = Object.prototype.hasOwnProperty;
    function getProperty(map, key) {
        if (!hasOwnProperty.call(map, key))
            return undefined;
        return map[key];
    }
    function hasProperty(map, key) {
        return hasOwnProperty.call(map, key);
    }
    function arrayContains(a, item) {
        var len = a.length;
        for (var i = 0; i < len; i++) {
            if (item.equals(a[i]))
                return true;
        }
        return false;
    }
    function arrayEquals(a, b) {
        var len = a.length;
        if (b.length !== len)
            return false;
        for (var i = 0; i < len; i++) {
            if (!a[i].equals(b[i]))
                return false;
        }
        return true;
    }
    function setEquals(a, b) {
        var len = a.length;
        if (b.length !== len)
            return false;
        for (var i = 0; i < len; i++) {
            if (!arrayContains(b, a[i]))
                return false;
        }
        return true;
    }
})(ts || (ts = {}));


text:
view = Backbone.View.extend({
    initialize: function(options) {
        _.bindAll(this, 'render');
        this.render().trigger('attach');
    },
    render: function() {
        this.el = templates.Error(this.options);
        return this;
    }
});


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PcapDotNet.Base;
using PcapDotNet.Packets.Ethernet;
using PcapDotNet.Packets.IpV4;
using PcapDotNet.Packets.TestUtils;
using PcapDotNet.Packets.Transport;

namespace PcapDotNet.Packets.Test
{
    /// <summary>
    /// Summary description for DataSegmentTests.
    /// </summary>
    [TestClass]
    [ExcludeFromCodeCoverage]
    public class DataSegmentTests
    {
        /// <summary>
        /// Gets or sets the test context which provides
        /// information about and functionality for the current test run.
        /// </summary>
        public TestContext TestContext { get; set; }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        public void ToHexadecimalStringTest()
        {
            byte[] input = new byte[] {1, 2, 3, 4, 5, 6};
            Assert.AreEqual(HexEncoding.Instance.GetString(input), new DataSegment(input).ToHexadecimalString());
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
        public void DecodeNullEncodingTest()
        {
            Assert.IsNotNull(new DataSegment(new byte[1]).Decode(null));
            Assert.Fail();
        }
   }
}


text:
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.Options;

namespace Microsoft.AspNetCore.Builder;

/// <summary>
/// Extension methods for enabling <see cref="HttpMethodOverrideMiddleware"/>.
/// </summary>
public static class HttpMethodOverrideExtensions
{
    /// <summary>
    /// Allows incoming POST request to override method type with type specified in header. This middleware
    /// is used when a client is limited to sending GET or POST methods but wants to invoke other HTTP methods.
    /// By default, the X-HTTP-Method-Override request header is used to specify the HTTP method being tunneled.
    /// </summary>
    /// <param name="builder">The <see cref="IApplicationBuilder"/> instance this method extends.</param>
    public static IApplicationBuilder UseHttpMethodOverride(this IApplicationBuilder builder)
    {
        if (builder == null)
        {
            throw new ArgumentNullException(nameof(builder));
        }

        return builder.UseMiddleware<HttpMethodOverrideMiddleware>();
    }

    /// <summary>
    /// Allows incoming POST request to override method type with type specified in form. This middleware
    /// is used when a client is limited to sending GET or POST methods but wants to invoke other HTTP methods.
    /// </summary>
    /// <param name="builder">The <see cref="IApplicationBuilder"/> instance this method extends.</param>
    /// <param name="options">
    /// The <see cref="HttpMethodOverrideOptions"/> which indicates which form type specifies the override method.
    /// </param>
    public static IApplicationBuilder UseHttpMethodOverride(this IApplicationBuilder builder, HttpMethodOverrideOptions options)
    {
        if (builder == null)
        {
            throw new ArgumentNullException(nameof(builder));
        }
        if (options == null)
        {
            throw new ArgumentNullException(nameof(options));
        }

        return builder.UseMiddleware<HttpMethodOverrideMiddleware>(Options.Create(options));
    }
}


text:
namespace MassTransit.StructureMapIntegration
{
    using Context;
    using GreenPipes;
    using Scoping;
    using Scoping.ConsumerContexts;
    using StructureMap;
    using Util;

    public class StructureMapConsumerScopeProvider :
        IConsumerScopeProvider
    {
        readonly IContainer _container;

        public StructureMapConsumerScopeProvider(IContainer container)
        {
            _container = container;
        }

        public void Probe(ProbeContext context)
        {
            context.Add("provider", "structuremap");
        }

        public IConsumerScopeContext GetScope(ConsumeContext context)
        {
            if (context.TryGetPayload<IContainer>(out var existingContainer))
                return new ExistingConsumerScopeContext(context);

            var container = _container.CreateNestedContainer(context);
            try
            {
                var proxy = new ConsumeContextProxyScope(context);

                var consumerContainer = container;
                proxy.GetOrAddPayload(() => consumerContainer);

                return new CreatedConsumerScopeContext<IContainer>(consumerContainer, proxy);
            }
            catch
            {
                container.Dispose();

                throw;
            }
        }

        public IConsumerScopeContext<TConsumer, T> GetScope<TConsumer, T>(ConsumeContext<T> context) where TConsumer : class where T : class
        {
            if (context.TryGetPayload<IContainer>(out var existingContainer))
            {
                var consumer = existingContainer.GetInstance<TConsumer>();
                if (consumer == null)
                    throw new ConsumerException($"Unable to resolve consumer type '{TypeMetadataCache<TConsumer>.ShortName}'.");

                ConsumerConsumeContext<TConsumer, T> consumerContext = context.PushConsumer(consumer);

                return new ExistingConsumerScopeContext<TConsumer, T>(consumerContext);
            }

            var container = _container.CreateNestedContainer(context);
            try
            {
                var consumer = container.GetInstance<TConsumer>();
                if (consumer == null)
                    throw new ConsumerException($"Unable to resolve consumer type '{TypeMetadataCache<TConsumer>.ShortName}'.");

                ConsumerConsumeContext<TConsumer, T> consumerContext = context.PushConsumerScope(consumer, container);

                return new CreatedConsumerScopeContext<IContainer, TConsumer, T>(container, consumerContext);
            }
            catch
            {
                container.Dispose();

                throw;
            }
        }
    }
}


text:
class CreateSelecaoAdminScoreEvaluationDisciplines < ActiveRecord::Migration
  def change
    create_table(:selecao_admin_score_evaluation_disciplines, :id => false) do |t|
      t.references :score_evaluation
      t.references :discipline

      t.timestamps
    end
    add_index :selecao_admin_score_evaluation_disciplines, :score_evaluation_id, :name => 'sa_score_evaluation_disciplines_score_evaluation_id'
    add_index :selecao_admin_score_evaluation_disciplines, :discipline_id, :name => 'sa_score_evaluation_disciplines_discipline_id'
  end
end


text: export declare function index(): void;


text:
#include <stdio.h>

#define NAME "GIGATHINK, INC."
#define ADDRESS "101 Megabuk Plaza"
#define PLACE "Megapolis, CA 94904"
#define WIDTH 40

void starbar(void);		/* prototype the function */

int main(void)
{
	starbar();

	printf("%s\n", NAME);
	printf("%s\n", ADDRESS);
	printf("%s\n", PLACE);

	starbar();		/* use the function */

	return 0;
}

void starbar(void)		/* define the function */
{
	int count;

	for (count = 1; count <= WIDTH; count++) putchar('*');

	putchar('\n');
}


text:
.. highlight:: python
   :linenothreshold: 5

Writing an exporter plugin
==========================

An Exporter is a method to export the product and order data in pretix for later use in another
program.

In this document, we will walk through the creation of an exporter output plugin step by step.

Please read :ref:`Creating a plugin <pluginsetup>` first, if you haven't already.

Exporter registration
---------------------

The exporter API does not make a lot of usage from signals, however, it does use a signal to get a list of
all available exporters. Your plugin should listen for this signal and return the subclass of
``pretix.base.exporter.BaseExporter``
that we'll provide in this plugin::

    from django.dispatch import receiver

    from pretix.base.signals import register_data_exporter

    @receiver(register_data_exporter, dispatch_uid="exporter_myexporter")
    def register_data_exporter(sender, **kwargs):
        from .exporter import MyExporter
        return MyExporter

The exporter class
------------------

.. class:: pretix.base.exporter.BaseExporter

   The central object of each exporter is the subclass of ``BaseExporter``.

   .. py:attribute:: BaseExporter.event

      The default constructor sets this property to the event we are currently
      working for.

   .. autoattribute:: identifier

      This is an abstract attribute, you **must** override this!

   .. autoattribute:: verbose_name

      This is an abstract attribute, you **must** override this!

   .. autoattribute:: export_form_fields

   .. automethod:: render

      This is an abstract method, you **must** override this!


text:
This is an asynchronous node js client for the Vault of Satoshi API.

It exposes all the API methods found here: https://www.cryptsy.com/pages/api

Credit:

This package is modeled after the npm-crypsty-api which can be found here: https://github.com/nothingisdead/npm-cryptsy-api


text:
// The all including header file for the ESP (Emitter Sprite Particle) Engine API

// Utility classes and functions for the ESP library
#include "ESPUtil.h"

// Effectors
#include "ESPEffector.h"
#include "ESPParticleAccelEffector.h"
#include "ESPParticleColourEffector.h"
#include "ESPMultiColourEffector.h"
#include "ESPMultiAlphaEffector.h"
#include "ESPAnimatedAlphaEffector.h"
#include "ESPParticleScaleEffector.h"
#include "ESPParticleRotateEffector.h"
#include "ESPParticleMagneticEffector.h"

// Event Handlers
#include "ESPEmitterEventHandler.h"

// Emitters and particles
#include "ESPEmitter.h"
#include "ESPPointEmitter.h"
#include "ESPVolumeEmitter.h"
#include "ESPLineEmitter.h"
#include "ESPPointToPointBeam.h"
#include "ESPBeam.h"
#include "ESPParticle.h"
#include "ESPOnomataParticle.h"
#include "ESPShaderParticle.h"
#include "ESPAnimatedSpriteParticle.h"
#include "ESPRandomTextureParticle.h"
#include "ESPAnimatedCurveParticle.h"
#include "ESPMeshParticle.h"


text:
package com.blazebit.persistence.view.impl.metamodel;

import com.blazebit.persistence.parser.PathTargetResolvingExpressionVisitor;
import com.blazebit.persistence.view.AttributeFilterProvider;
import com.blazebit.persistence.view.InverseRemoveStrategy;
import com.blazebit.persistence.view.LockMode;
import com.blazebit.persistence.view.impl.UpdatableExpressionVisitor;
import com.blazebit.persistence.view.impl.collection.ListFactory;
import com.blazebit.persistence.view.impl.collection.MapFactory;
import com.blazebit.persistence.view.impl.collection.PluralObjectFactory;
import com.blazebit.persistence.view.impl.collection.SetFactory;
import com.blazebit.persistence.view.impl.collection.SortedMapFactory;
import com.blazebit.persistence.view.impl.collection.SortedSetFactory;
import com.blazebit.persistence.view.metamodel.AttributeFilterMapping;
import com.blazebit.persistence.view.metamodel.BasicType;
import com.blazebit.persistence.view.metamodel.ManagedViewType;
import com.blazebit.persistence.view.metamodel.MethodAttribute;
import com.blazebit.persistence.view.metamodel.Type;
import com.blazebit.reflection.ReflectionUtils;

import javax.persistence.metamodel.Attribute;
import javax.persistence.metamodel.ManagedType;
import javax.persistence.metamodel.SingularAttribute;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;

/**
 *
 * @author Christian Beikov
 * @since 1.0.0
 */
public abstract class AbstractMethodAttribute<X, Y> extends AbstractAttribute<X, Y> implements MethodAttribute<X, Y> {

    private final int attributeIndex;
    private final String name;
    private final Method javaMethod;
    private final Method setterMethod;
    private final Map<String, AttributeFilterMapping<X, ?>> filterMappings;

    protected AbstractMethodAttribute(ManagedViewTypeImplementor<X> viewType, MethodAttributeMapping mapping, int attributeIndex, MetamodelBuildingContext context, EmbeddableOwner embeddableMapping) {
        super(viewType, mapping, context, embeddableMapping);
        this.attributeIndex = attributeIndex;
        this.name = mapping.getName();
        this.javaMethod = mapping.getMethod();
        this.setterMethod = mapping.getSetterMethod();

        if (mapping.getAttributeFilterProviders() == null) {
            this.filterMappings = Collections.emptyMap();
        } else {
            Map<String, AttributeFilterMapping<X, ?>> filterMappings = new HashMap<>();
            for (Map.Entry<String, Class<? extends AttributeFilterProvider<?>>> entry : mapping.getAttributeFilterProviders().entrySet()) {
                filterMappings.put(entry.getKey(), new AttributeFilterMappingImpl<>(this, entry.getKey(), (Class<? extends AttributeFilterProvider<Object>>) entry.getValue()));
            }

            this.filterMappings = Collections.unmodifiableMap(filterMappings);
        }
    }

    public Set<ManagedViewType<?>> getViewTypes() {
        Type<?> elementType = getElementType();
        if (elementType instanceof ManagedViewType<?>) {
            Set<Type<?>> updateCascadeAllowedSubtypes = getUpdateCascadeAllowedSubtypes();
            Set<Type<?>> persistCascadeAllowedSubtypes = getPersistCascadeAllowedSubtypes();
            Set<Type<?>> readOnlyAllowedSubtypes = getReadOnlyAllowedSubtypes();
            Set<ManagedViewType<?>> viewTypes = new HashSet<>(persistCascadeAllowedSubtypes.size() + updateCascadeAllowedSubtypes.size() + readOnlyAllowedSubtypes.size() + 1);
            viewTypes.add((ManagedViewType<?>) elementType);
            viewTypes.addAll((Collection<? extends ManagedViewType<?>>) (Collection<?>) persistCascadeAllowedSubtypes);
            viewTypes.addAll((Collection<? extends ManagedViewType<?>>) (Collection<?>) updateCascadeAllowedSubtypes);
            viewTypes.addAll((Collection<? extends ManagedViewType<?>>) (Collection<?>) readOnlyAllowedSubtypes);
            return viewTypes;
        }

        return Collections.emptySet();
    }

    @Override
    protected Class<?>[] getTypeArguments() {
        return ReflectionUtils.getResolvedMethodReturnTypeArguments(getDeclaringType().getJavaType(), getJavaMethod());
    }

    protected int determineDirtyStateIndex(int dirtyStateIndex) {
        if (isUpdatable() || isMutable() && (isPersistCascaded() || isUpdateCascaded())) {
            return dirtyStateIndex;
        }

        return -1;
    }

    protected Set<Type<?>> determinePersistSubtypeSet(Type<?> superType, Set<ManagedViewTypeImplementor<?>> subtypes1, Set<ManagedViewTypeImplementor<?>> subtypes2, MetamodelBuildingContext context) {
        Class<?> superTypeClass = superType.getJavaType();
        Set<Type<?>> set = new HashSet<>(subtypes1.size() + subtypes2.size());
        if (superType.getMappingType() == Type.MappingType.BASIC && context.getEntityMetamodel().getManagedType(superType.getJavaType()) != null
                || superType.getMappingType() != Type.MappingType.BASIC && ((ManagedViewType<?>) superType).isCreatable()) {
            set.add(superType);
        }
        addToPersistSubtypeSet(set, superTypeClass, subtypes1, context, false);
        addToPersistSubtypeSet(set, superTypeClass, subtypes2, context, true);
        return Collections.unmodifiableSet(set);
    }

    protected Set<Type<?>> determineUpdateSubtypeSet(Type<?> superType, Set<ManagedViewTypeImplementor<?>> subtypes1, Set<ManagedViewTypeImplementor<?>> subtypes2, MetamodelBuildingContext context) {
        Class<?> superTypeClass = superType.getJavaType();
        Set<Type<?>> set = new HashSet<>(subtypes1.size() + subtypes2.size());
        if (superType.getMappingType() == Type.MappingType.BASIC && ((BasicType<?>) superType).getUserType().isMutable()
                || superType.getMappingType() != Type.MappingType.BASIC && ((ManagedViewType<?>) superType).isUpdatable()) {
            set.add(superType);
        }
        addToUpdateSubtypeSet(set, superTypeClass, subtypes1, context, false);
        addToUpdateSubtypeSet(set, superTypeClass, subtypes2, context, true);
        return Collections.unmodifiableSet(set);
    }

    private void addToPersistSubtypeSet(Set<Type<?>> set, Class<?> superType, Set<ManagedViewTypeImplementor<?>> subtypes, MetamodelBuildingContext context, boolean failIfNotCreatable) {
        for (ManagedViewTypeImplementor<?> type : subtypes) {
            Class<?> c = type.getJavaType();
            if (c == superType) {
                continue;
            }

            if (!superType.isAssignableFrom(c)) {
                context.addError("Invalid subtype [" + c.getName() + "] in updatable mapping is not a subtype of declared attribute element type [" + superType.getName() + "] in the " + getLocation());
            }

            if (type.isCreatable()) {
                set.add(type);
            } else if (failIfNotCreatable) {
                context.addError("Invalid subtype [" + c.getName() + "] in updatable mapping is not creatable in the " + getLocation());
            }
        }
    }

    private void addToUpdateSubtypeSet(Set<Type<?>> set, Class<?> superType, Set<ManagedViewTypeImplementor<?>> subtypes, MetamodelBuildingContext context, boolean failIfNotUpdatable) {
        for (ManagedViewTypeImplementor<?> type : subtypes) {
            Class<?> c = type.getJavaType();
            if (c == superType) {
                continue;
            }

            if (!superType.isAssignableFrom(c)) {
                context.addError("Invalid subtype [" + c.getName() + "] in updatable mapping is not a subtype of declared attribute element type [" + superType.getName() + "] in the " + getLocation());
            }

            if (type.isUpdatable()) {
                set.add(type);
            } else if (failIfNotUpdatable) {
                context.addError("Invalid subtype [" + c.getName() + "] in updatable mapping is not updatable in the " + getLocation());
            }
        }
    }

    protected boolean determineMutable(Type<?> elementType) {
        if (isUpdatable()) {
            return true;
        }
        if (elementType == null) {
            return false;
        }

        // Essentially, the checks for whether the type is updatable etc. have been done during update cascade determination already
        return isUpdateCascaded();
    }

    protected final PluralObjectFactory<? extends Collection<?>> createCollectionFactory(MetamodelBuildingContext context) {
        Class<?> pluralContainerType = getPluralContainerType(context);
        if (pluralContainerType == null) {
            return null;
        }
        if (SortedSet.class.isAssignableFrom(pluralContainerType)) {
            return SortedSetFactory.INSTANCE;
        } else if (Set.class.isAssignableFrom(pluralContainerType)) {
            return SetFactory.INSTANCE;
        } else {
            return ListFactory.INSTANCE;
        }
    }

    protected final PluralObjectFactory<? extends Map<?, ?>> createMapFactory(MetamodelBuildingContext context) {
        Class<?> pluralContainerType = getPluralContainerType(context);
        if (pluralContainerType == null) {
            return null;
        }
        if (SortedMap.class.isAssignableFrom(pluralContainerType)) {
            return SortedMapFactory.INSTANCE;
        } else {
            return MapFactory.INSTANCE;
        }
    }

    private Class<?> getPluralContainerType(MetamodelBuildingContext context) {
        if (isMutable() && (declaringType.isUpdatable() || declaringType.isCreatable())) {
            if (mapping == null) {
                switch (getCollectionType()) {
                    case MAP:
                        return Map.class;
                    case SET:
                        return Set.class;
                    case LIST:
                        return List.class;
                    case COLLECTION:
                        return Collection.class;
                    default:
                        return null;
                }
            }
            if (mappingExpression != null) {
                UpdatableExpressionVisitor visitor = new UpdatableExpressionVisitor(context.getEntityMetamodel(), getDeclaringType().getEntityClass(), isUpdatable(), getDeclaringType().getEntityViewRootTypes());
                try {
                    mappingExpression.accept(visitor);
                    Map<Attribute<?, ?>, javax.persistence.metamodel.Type<?>> possibleTargets = visitor.getPossibleTargets();

                    if (possibleTargets.size() > 1) {
                        context.addError("Multiple possible target type for the mapping in the " + getLocation() + ": " + possibleTargets);
                    }
                    return possibleTargets.values().iterator().next().getJavaType();
                } catch (IllegalArgumentException ex) {
                    context.addError("There is an error for the " + getLocation() + ": " + ex.getMessage());
                }
            }
        }

        return null;
    }

    protected boolean determineOptimisticLockProtected(MethodAttributeMapping mapping, MetamodelBuildingContext context, boolean mutable) {
        Boolean isOptimisticLockProtected = mapping.getOptimisticLockProtected();
        if (isOptimisticLockProtected != null) {
            // The user explicitly annotated the attribute
            if (!declaringType.isUpdatable() && !declaringType.isCreatable()) {
                context.addError("The usage of @OptimisticLock is only allowed on updatable or creatable entity view types! Invalid definition on the " + mapping.getErrorLocation());
            }
            return isOptimisticLockProtected;
        } else if (!mutable) {
            // Can only be protected when it's actually mutable
            return false;
        } else {
            // At this point, the declaring type must be updatable or creatable
            // Since the attribute can only be mutable if the declaring type is
            if (declaringType instanceof ViewTypeImpl<?>) {
                ViewTypeImpl<?> owner = (ViewTypeImpl<?>) declaringType;
                // Only the lock modes AUTO and OPTIMISTIC will make this attribute protected by that lock
                if (owner.getLockMode() == LockMode.AUTO || owner.getLockMode() == LockMode.OPTIMISTIC) {
                    // NOTE: By default, we protect every mutable attribute by an optimistic lock
                    // This is different than what JPA does, which only protects "owned" attributes
                    // but entity views are different. Since entity views are designed for a specific use case
                    // it is unlikely that it contains mutable attributes that shouldn't be lock protected.
                    // Why would attributes be mutable for a use case, but not be part of the same consistency view?
                    // They wouldn't, as that doesn't make sense. We'd rather let users occasionally see an optimistic lock exception
                    // than they facing a possible data loss just because of the way they map something in the JPA entity model.
                    // Another alternative for the user is to handle the optimistic lock exception and thanks to the change model
                    // they can even implement a merge strategy to apply changes based on their own rules
                    return true;
                } else {
                    return false;
                }
            } else {
                // Flat view types don't have a lock mode of their own, but are assumed to inherit locks from parents
                return true;
            }
        }
    }

    @Override
    public void checkAttribute(ManagedType<?> managedType, MetamodelBuildingContext context) {
        super.checkAttribute(managedType, context);
        if (isUpdatable() && declaringType.isUpdatable()) {
            String mappedBy = getMappedBy();
            if (mappedBy != null && getInverseRemoveStrategy() == InverseRemoveStrategy.SET_NULL) {
                Type<?> elementType = getElementType();
                ManagedType<?> elementJpaType;
                if (elementType instanceof ManagedViewTypeImplementor<?>) {
                    elementJpaType = ((ManagedViewTypeImplementor<?>) elementType).getJpaManagedType();
                } else {
                    elementJpaType = ((BasicTypeImpl<?>) elementType).getManagedType();
                }
                Map<String, String> writableMappedByMappings = getWritableMappedByMappings();
                if (writableMappedByMappings == null) {
                    Attribute<?, ?> attribute = elementJpaType.getAttribute(mappedBy);
                    // SET_NULL for plural attributes i.e. @ManyToMany is like removing just the join table entry
                    // So we just care about singular attributes here
                    if (attribute instanceof SingularAttribute<?, ?>) {
                        if (!((SingularAttribute<?, ?>) attribute).isOptional()) {
                            context.addError("Illegal use of the remove strategy SET_NULL for non-nullable mapped by attribute '" + mappedBy + "' at " + getLocation() + " Use a different strategy via @MappingInverse(removeStrategy = InverseRemoveStrategy...)");
                        }
                    }
                } else {
                    PathTargetResolvingExpressionVisitor visitor = new PathTargetResolvingExpressionVisitor(context.getEntityMetamodel(), elementJpaType, null);
                    for (String value : writableMappedByMappings.values()) {
                        visitor.clear();
                        context.getTypeValidationExpressionFactory().createPathExpression(value).accept(visitor);
                        Map<Attribute<?, ?>, javax.persistence.metamodel.Type<?>> possibleTargets = visitor.getPossibleTargets();
                        if (possibleTargets.size() > 1) {
                            context.addError("Multiple possible target type for the mapping in the " + getLocation() + ": " + possibleTargets);
                        }
                        Attribute<?, ?> attribute = possibleTargets.keySet().iterator().next();
                        if (attribute instanceof SingularAttribute<?, ?>) {
                            if (!((SingularAttribute<?, ?>) attribute).isOptional()) {
                                context.addError("Illegal use of the remove strategy SET_NULL for non-nullable mapped by attribute '" + mappedBy + "' because writable mapping '" + value + "' is non-optional at " + getLocation() + " Use a different strategy via @MappingInverse(removeStrategy = InverseRemoveStrategy...)");
                            }
                        }
                    }

                }
            }
        }
    }

    protected static String getAttributeName(Method getterOrSetter) {
        String name = getterOrSetter.getName();
        StringBuilder sb = new StringBuilder(name.length());
        int index = name.startsWith("is") ? 2 : 3;
        char firstAttributeNameChar = name.charAt(index);
        return sb.append(Character.toLowerCase(firstAttributeNameChar))
                .append(name, index + 1, name.length())
                .toString();
    }

    @Override
    public String getLocation() {
        return MethodAttributeMapping.getLocation(getName(), getJavaMethod());
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public Method getJavaMethod() {
        return javaMethod;
    }

    @Override
    public boolean needsDirtyTracker() {
        return isUpdatable() || isUpdateCascaded() && !getUpdateCascadeAllowedSubtypes().isEmpty();
    }

    @Override
    public boolean hasDirtyStateIndex() {
        return getDirtyStateIndex() != -1;
    }

    public Method getSetterMethod() {
        return setterMethod;
    }

    public int getAttributeIndex() {
        return attributeIndex;
    }

    @SuppressWarnings("unchecked")
    public Y getValue(Object o) {
        try {
            return (Y) javaMethod.invoke(o);
        } catch (Exception e) {
            throw new IllegalArgumentException("Couldn't get value!", e);
        }
    }

    public abstract int getDirtyStateIndex();

    public boolean isUpdatableOnly() {
        return hasDirtyStateIndex() && !isPersistCascaded() && !isUpdateCascaded();
    }

    public abstract Map<String, String> getWritableMappedByMappings();

    protected final Set<Class<?>> createAllowedSubtypesSet() {
        Set<Type<?>> readOnlyAllowedSubtypes = getReadOnlyAllowedSubtypes();
        Set<Type<?>> persistAllowedSubtypes = getPersistCascadeAllowedSubtypes();
        Set<Type<?>> updateAllowedSubtypes = getUpdateCascadeAllowedSubtypes();
        Set<Class<?>> allowedSubtypes = new HashSet<>(readOnlyAllowedSubtypes.size() + persistAllowedSubtypes.size() + updateAllowedSubtypes.size());
        for (Type<?> t : readOnlyAllowedSubtypes) {
            allowedSubtypes.add(t.getJavaType());
        }
        for (Type<?> t : persistAllowedSubtypes) {
            allowedSubtypes.add(t.getJavaType());
        }
        for (Type<?> t : updateAllowedSubtypes) {
            allowedSubtypes.add(t.getJavaType());
        }
        return Collections.unmodifiableSet(allowedSubtypes);
    }

    protected final Set<Class<?>> createParentRequiringUpdateSubtypesSet() {
        Set<Type<?>> readOnlyAllowedSubtypes = getReadOnlyAllowedSubtypes();
        Set<Type<?>> persistAllowedSubtypes = getPersistCascadeAllowedSubtypes();
        Set<Type<?>> updateAllowedSubtypes = getUpdateCascadeAllowedSubtypes();
        Set<Class<?>> allowedSubtypes = new HashSet<>(readOnlyAllowedSubtypes.size());
        for (Type<?> t : readOnlyAllowedSubtypes) {
            if (t instanceof ManagedViewTypeImplementor<?>) {
                ManagedViewTypeImplementor<?> viewType = (ManagedViewTypeImplementor<?>) t;
                if (viewType.isUpdatable() && !updateAllowedSubtypes.contains(t) || viewType.isCreatable() && !persistAllowedSubtypes.contains(t)) {
                    allowedSubtypes.add(t.getJavaType());
                }
            }
        }
        return Collections.unmodifiableSet(allowedSubtypes);
    }

    protected final Set<Class<?>> createParentRequiringCreateSubtypesSet() {
        Set<Type<?>> readOnlyAllowedSubtypes = getReadOnlyAllowedSubtypes();
        Set<Type<?>> persistAllowedSubtypes = getPersistCascadeAllowedSubtypes();
        Set<Type<?>> updateAllowedSubtypes = getUpdateCascadeAllowedSubtypes();
        Set<Class<?>> allowedSubtypes = new HashSet<>(readOnlyAllowedSubtypes.size());
        for (Type<?> t : readOnlyAllowedSubtypes) {
            if (t instanceof ManagedViewTypeImplementor<?>) {
                ManagedViewTypeImplementor<?> viewType = (ManagedViewTypeImplementor<?>) t;
                if (viewType.isUpdatable() && !updateAllowedSubtypes.contains(t) || viewType.isCreatable() && !persistAllowedSubtypes.contains(t)) {
                    allowedSubtypes.add(t.getJavaType());
                }
            }
        }
        return Collections.unmodifiableSet(allowedSubtypes);
    }

    @Override
    public boolean isOptimizeCollectionActionsEnabled() {
        // For now, we optimize collection actions only when optimistic lock protected
        return isOptimisticLockProtected();
    }

    @Override
    public MemberType getMemberType() {
        return MemberType.METHOD;
    }

    @Override
    public AttributeFilterMapping<X, ?> getFilter(String filterName) {
        return filterMappings.get(filterName);
    }

    @Override
    public Set<AttributeFilterMapping<X, ?>> getFilters() {
        return new SetView<AttributeFilterMapping<X, ?>>(filterMappings.values());
    }

    public static String extractAttributeName(Class<?> viewType, Method m, MetamodelBootContext context) {
        String attributeName;

        // We only support bean style getters
        if (ReflectionUtils.isSetter(m)) {
            attributeName = getAttributeName(m);
            Method getter = ReflectionUtils.getGetter(viewType, attributeName);

            if (getter == null) {
                context.addError("The setter '" + m.getName() + "' from the entity view '" + viewType.getName() + "' has no corresponding getter!");
                return null;
            }

            if (ReflectionUtils.getResolvedMethodParameterTypes(viewType, m)[0] != ReflectionUtils.getResolvedMethodReturnType(viewType, getter)) {
                context.addError("The setter '" + m.getName() + "' of the class '" + viewType.getName()
                    + "' must accept an argument of the same type as it's corresponding getter returns!");
                return null;
            }

            for (Annotation annotation : m.getAnnotations()) {
                if (annotation.annotationType().getPackage().getName().startsWith("com.blazebit.persistence.view")) {
                    context.addError("The setter '" + m.getName() + "' of the class '" + viewType.getName()
                            + "' has entity view annotations, but these annotations must be on the getter only!");
                    break;
                }
            }

            return null;
        } else if (!ReflectionUtils.isGetter(m)) {
            context.addError("The given method '" + m.getName() + "' from the entity view '" + viewType.getName()
                + "' is no bean style getter or setter!");
            return null;
        } else {
            attributeName = getAttributeName(m);
        }

        if (m.getExceptionTypes().length > 0) {
            context.addError("The given method '" + m.getName() + "' from the entity view '" + viewType.getName() + "' must not throw an exception!");
            return null;
        }

        return attributeName;
    }
}


text:
package com.humbinal.premiere.data

import com.humbinal.premiere.context.WebSparkContext
import org.apache.spark.rdd.RDD
import org.apache.spark.storage.StorageLevel

import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer

class CacheRDD extends Serializable {

  val CACHE: mutable.HashMap[String, RDD[(Long, Array[Double])]] = mutable.HashMap.empty[String, RDD[(Long, Array[Double])]]

  def cacheToMem(): Long = {
    val sc = WebSparkContext.getContext()

    val arrBuff: ArrayBuffer[(Long, Array[Double])] = mutable.ArrayBuffer.empty[(Long, Array[Double])]
    var i = 0
    while (i < 10000) {
      var j = 0
      val arrBuff2: ArrayBuffer[Double] = mutable.ArrayBuffer.empty[Double]
      while (j < 128) {
        arrBuff2.+=(util.Random.nextDouble())
        j = j + 1
      }
      arrBuff.+=((i, arrBuff2.toArray))
      i = i + 1
    }

    //val list: List[(Long, Array[Double])] = List((1L, Array(0.3, 0.4)), (2L, Array(0.5, 0.6)))

    val rdd: RDD[(Long, Array[Double])] = sc.parallelize(arrBuff)
    //val subRdd: RDD[(Long, Array[Double])] = rdd.map(data => data)

    rdd.checkpoint()

    rdd.persist(StorageLevel.MEMORY_ONLY).setName("cached_rdd")
    //rdd.checkpoint()
    CACHE.put("test", rdd)
    rdd.count()
  }

  def getData(): RDD[(Long, Array[Double])] = {
    CACHE.getOrElse("test", null)
  }

}

object CacheRDD extends Serializable {
  private var _instance: CacheRDD = _

  def cache(): Long = {
    if (null == _instance) {
      _instance = new CacheRDD()
    }
    _instance.cacheToMem()
  }

  def get(): RDD[(Long, Array[Double])] = {
    _instance.getData()
  }
}