text:
package org.camunda.spin.plugin.variables;

import java.io.Serializable;

public class JavaSerializable implements Serializable {

  private String stringProperty;

  private int intProperty;

  private boolean booleanProperty;

  public JavaSerializable() {

  }

  public JavaSerializable(String stringProperty, int intProperty, boolean booleanProperty) {
    this.stringProperty = stringProperty;
    this.intProperty = intProperty;
    this.booleanProperty = booleanProperty;
  }

  public String getStringProperty() {
    return stringProperty;
  }

  public void setStringProperty(String stringProperty) {
    this.stringProperty = stringProperty;
  }

  public int getIntProperty() {
    return intProperty;
  }

  public void setIntProperty(int intProperty) {
    this.intProperty = intProperty;
  }

  public boolean getBooleanProperty() {
    return booleanProperty;
  }

  public void setBooleanProperty(boolean booleanProperty) {
    this.booleanProperty = booleanProperty;
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + (booleanProperty ? 1231 : 1237);
    result = prime * result + intProperty;
    result = prime * result + ((stringProperty == null) ? 0 : stringProperty.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    JavaSerializable other = (JavaSerializable) obj;
    if (booleanProperty != other.booleanProperty)
      return false;
    if (intProperty != other.intProperty)
      return false;
    if (stringProperty == null) {
      if (other.stringProperty != null)
        return false;
    } else if (!stringProperty.equals(other.stringProperty))
      return false;
    return true;
  }

}


text:
import numpy
import six

from chainer.backends import cuda
from chainer import function_node
from chainer.utils import type_check
import chainerx

class Accuracy(function_node.FunctionNode):

    def __init__(self, ignore_label=None):
        self.ignore_label = ignore_label

    def check_type_forward(self, in_types):
        type_check._argname(in_types, ('x', 't'))
        x_type, t_type = in_types

        type_check.expect(
            x_type.dtype.kind == 'f',
            t_type.dtype.kind == 'i'
        )

        t_ndim = type_check.eval(t_type.ndim)
        type_check.expect(
            x_type.ndim >= t_type.ndim,
            x_type.shape[0] == t_type.shape[0],
            x_type.shape[2: t_ndim + 1] == t_type.shape[1:]
        )
        for i in six.moves.range(t_ndim + 1, type_check.eval(x_type.ndim)):
            type_check.expect(x_type.shape[i] == 1)

    def forward_chainerx(self, inputs):
        return self._forward(chainerx, inputs)

    def forward_cpu(self, inputs):
        return self._forward(numpy, inputs)

    def forward_gpu(self, inputs):
        return self._forward(cuda.cupy, inputs)

    def _forward(self, xp, inputs):
        y, t = inputs

        if self.ignore_label is not None:
            mask = (t == self.ignore_label)
            ignore_cnt = mask.sum()

            # will always be true when the true label is ignore_label
            # TODO(henry0312)
            #   If cupy.where returns indexes, we could make the code better.
            #   Also, we would need Advanced Indexing.
            pred = xp.where(mask, self.ignore_label,
                            y.argmax(axis=1).reshape(t.shape))
            count = (pred == t).sum() - ignore_cnt
            total = t.size - ignore_cnt

            if xp is numpy:
                # Avoid warning of `divide by zero`
                if total == 0:
                    acc = xp.asarray(0.0, dtype=y.dtype)
                else:
                    acc = xp.asarray(float(count) / total, dtype=y.dtype)
            else:
                acc = xp.where(total == 0,
                               xp.asarray(0.0, dtype=y.dtype),
                               xp.asarray(count / total, dtype=y.dtype))
        else:
            pred = y.argmax(axis=1).reshape(t.shape)
            if xp is chainerx:
                # TODO(niboshi): ChainerX mean() does not support dtype
                # argument. Support it.
                acc = xp.asarray((pred == t).astype(y.dtype, False).mean())
            else:
                acc = xp.asarray((pred == t).mean(dtype=y.dtype))
        return acc,

def accuracy(y, t, ignore_label=None):
    """Computes multiclass classification accuracy of the minibatch.

    Args:
        y (:class:`~chainer.Variable` or :ref:`ndarray`):
            Array whose (i, j, k, ...)-th element indicates the score of
            the class j at the (i, k, ...)-th sample.
            The prediction label :math:`\\hat t` is calculated by the formula
            :math:`\\hat t(i, k, ...) = \\operatorname{\\mathrm{argmax}}_j \
y(i, j, k, ...)`.
        t (:class:`~chainer.Variable` or :ref:`ndarray`):
            Array of ground truth labels.
        ignore_label (int or None): Skip calculating accuracy
            if the true label is ``ignore_label``.

    Returns:
        ~chainer.Variable: A variable holding a scalar array of the accuracy.

    .. note:: This function is non-differentiable.

    .. admonition:: Example

        We show the most common case, when ``y`` is the two dimensional array.

        >>> y = np.array([[0.1, 0.7, 0.2], # prediction label is 1
        ...               [8.0, 1.0, 2.0], # prediction label is 0
        ...               [-8.0, 1.0, 2.0], # prediction label is 2
        ...               [-8.0, -1.0, -2.0]]) # prediction label is 1
        >>> t = np.array([1, 0, 2, 1], np.int32)
        >>> F.accuracy(y, t).array \
# 100% accuracy because all samples are correct
        array(1.)
        >>> t = np.array([1, 0, 0, 0], np.int32)
        >>> F.accuracy(y, t).array \
# 50% accuracy because 1st and 2nd samples are correct.
        array(0.5)
        >>> F.accuracy(y, t, ignore_label=0).array \
# 100% accuracy because of ignoring the 2nd, 3rd and 4th samples.
        array(1.)

    """
    acc, = Accuracy(ignore_label=ignore_label).apply((y, t))
    return acc

redpajama_set_name: RedPajamaGithub


text:
OpenJDK (Open Java Development Kit) is a free and open source implementation of the Java Platform, Standard Edition (Java SE).

### Notes

Current notes are in:

* [java.util](https://github.com/minixalpha/SourceLearning/tree/master/openjdk/notes/openjdk/jdk/src/share/classes/java/util)
* [java.lang](https://github.com/minixalpha/SourceLearning/tree/master/openjdk/notes/openjdk/jdk/src/share/classes/java/lang)
* [java.io](https://github.com/minixalpha/SourceLearning/tree/master/openjdk/notes/openjdk/jdk/src/share/classes/java/io)


text:
package com.cjs.collection;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Test4 {
    public static  void main(String[] args){

        Set<String> set1 = new HashSet<>();
        set1.add(new String("cjs"));
        set1.add(new String("cjs"));

        Iterator<String> it = set1.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }

        Set<Object> set2 = new HashSet<>();
        set2.add(new Object());
        set2.add(new Object());

        Iterator<Object> it2 = set2.iterator();
        while (it2.hasNext()) {
            System.out.println(it2.next());
        }

    }
}


text:
"use strict"
// Sets up a Parse API server for testing.

jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 5000;

global.on_db = (db, callback, elseCallback) => {
  if (process.env.PARSE_SERVER_TEST_DB == db) {
    return callback();
  } else if (!process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
    return callback();
  }
  if (elseCallback) {
    return elseCallback();
  }
}

if (global._babelPolyfill) {
  console.error('We should not use polyfilled tests');
  process.exit(1);
}

var cache = require('../src/cache').default;
var express = require('express');
var facebook = require('../src/authDataManager/facebook');
var ParseServer = require('../src/index').ParseServer;
var path = require('path');
var TestUtils = require('../src/TestUtils');
var MongoStorageAdapter = require('../src/Adapters/Storage/Mongo/MongoStorageAdapter');
const GridStoreAdapter = require('../src/Adapters/Files/GridStoreAdapter').GridStoreAdapter;
const FSAdapter = require('parse-server-fs-adapter');
const PostgresStorageAdapter = require('../src/Adapters/Storage/Postgres/PostgresStorageAdapter');
const RedisCacheAdapter = require('../src/Adapters/Cache/RedisCacheAdapter').default;

const mongoURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase';
const postgresURI = 'postgres://localhost:5432/parse_server_postgres_adapter_test_database';
let databaseAdapter;
// need to bind for mocking mocha

let startDB = () => {};
let stopDB = () => {};

if (process.env.PARSE_SERVER_TEST_DB === 'postgres') {
  databaseAdapter = new PostgresStorageAdapter({
    uri: postgresURI,
    collectionPrefix: 'test_',
  });
} else {
  startDB = require('mongodb-runner/mocha/before').bind({
    timeout: () => {},
    slow: () => {}
  });
  stopDB = require('mongodb-runner/mocha/after');;
  databaseAdapter = new MongoStorageAdapter({
    uri: mongoURI,
    collectionPrefix: 'test_',
  });
}

var port = 8378;

let filesAdapter;

on_db('mongo', () => {
  filesAdapter = new GridStoreAdapter(mongoURI);
}, () => {
  filesAdapter = new FSAdapter();
});

let logLevel;
let silent = true;
if (process.env.VERBOSE) {
  silent = false;
  logLevel = 'verbose';
}
if (process.env.PARSE_SERVER_LOG_LEVEL) {
  silent = false;
  logLevel = process.env.PARSE_SERVER_LOG_LEVEL;
}
// Default server configuration for tests.
var defaultConfiguration = {
  filesAdapter,
  serverURL: 'http://localhost:' + port + '/1',
  databaseAdapter,
  appId: 'test',
  javascriptKey: 'test',
  dotNetKey: 'windows',
  clientKey: 'client',
  restAPIKey: 'rest',
  webhookKey: 'hook',
  masterKey: 'test',
  fileKey: 'test',
  silent,
  logLevel,
  push: {
    'ios': {
      cert: 'prodCert.pem',
      key: 'prodKey.pem',
      production: true,
      bundleId: 'bundleId',
    }
  },
  oauth: { // Override the facebook provider
    facebook: mockFacebook(),
    myoauth: {
      module: path.resolve(__dirname, "myoauth") // relative path as it's run from src
    }
  }
};

if (process.env.PARSE_SERVER_TEST_CACHE === 'redis') {
  defaultConfiguration.cacheAdapter = new RedisCacheAdapter();
}

let openConnections = {};

// Set up a default API server for testing with default configuration.
var app = express();
var api = new ParseServer(defaultConfiguration);
app.use('/1', api);
app.use('/1', (req, res) => {
  fail('should not call next');
});
var server = app.listen(port);
server.on('connection', connection => {
  let key = `${connection.remoteAddress}:${connection.remotePort}`;
  openConnections[key] = connection;
  connection.on('close', () => { delete openConnections[key] });
});
// Allows testing specific configurations of Parse Server
const reconfigureServer = changedConfiguration => {
  return new Promise((resolve, reject) => {
    server.close(() => {
      try {
        let newConfiguration = Object.assign({}, defaultConfiguration, changedConfiguration, {
          __indexBuildCompletionCallbackForTests: indexBuildPromise => indexBuildPromise.then(resolve, reject)
        });
        cache.clear();
        app = express();
        api = new ParseServer(newConfiguration);
        api.use(require('./testing-routes').router);
        app.use('/1', api);
        app.use('/1', (req, res) => {
          fail('should not call next');
        });
        server = app.listen(port);
        server.on('connection', connection => {
          let key = `${connection.remoteAddress}:${connection.remotePort}`;
          openConnections[key] = connection;
          connection.on('close', () => { delete openConnections[key] });
        });
      } catch(error) {
        reject(error);
      }
    });
  });
}

// Set up a Parse client to talk to our test API server
var Parse = require('parse/node');
Parse.serverURL = 'http://localhost:' + port + '/1';

// This is needed because we ported a bunch of tests from the non-A+ way.
// TODO: update tests to work in an A+ way
Parse.Promise.disableAPlusCompliant();

// 10 minutes timeout
beforeAll(startDB, 10*60*1000);

afterAll(stopDB);

beforeEach(done => {
  try {
    Parse.User.enableUnsafeCurrentUser();
  } catch (error) {
    if (error !== 'You need to call Parse.initialize before using Parse.') {
      throw error;
    }
  }
  TestUtils.destroyAllDataPermanently()
  .catch(error => {
    // For tests that connect to their own mongo, there won't be any data to delete.
    if (error.message === 'ns not found' || error.message.startsWith('connect ECONNREFUSED')) {
      return;
    } else {
      fail(error);
      return;
    }
  })
  .then(reconfigureServer)
  .then(() => {
    Parse.initialize('test', 'test', 'test');
    Parse.serverURL = 'http://localhost:' + port + '/1';
    done();
  }, error => {
    Parse.initialize('test', 'test', 'test');
    Parse.serverURL = 'http://localhost:' + port + '/1';
    // fail(JSON.stringify(error));
    done();
  })
});

afterEach(function(done) {
  let afterLogOut = () => {
    if (Object.keys(openConnections).length > 0) {
      fail('There were open connections to the server left after the test finished');
    }
    on_db('postgres', () => {
      TestUtils.destroyAllDataPermanently().then(done, done);
    }, done);
  };
  Parse.Cloud._removeAllHooks();
  databaseAdapter.getAllClasses()
  .then(allSchemas => {
    allSchemas.forEach((schema) => {
      var className = schema.className;
      expect(className).toEqual({ asymmetricMatch: className => {
        if (!className.startsWith('_')) {
          return true;
        } else {
          // Other system classes will break Parse.com, so make sure that we don't save anything to _SCHEMA that will
          // break it.
          return ['_User', '_Installation', '_Role', '_Session', '_Product'].indexOf(className) >= 0;
        }
      }});
    });
  })
  .then(() => Parse.User.logOut())
  .then(afterLogOut, afterLogOut)
});

var TestObject = Parse.Object.extend({
  className: "TestObject"
});
var Item = Parse.Object.extend({
  className: "Item"
});
var Container = Parse.Object.extend({
  className: "Container"
});

// Convenience method to create a new TestObject with a callback
function create(options, callback) {
  var t = new TestObject(options);
  t.save(null, { success: callback });
}

function createTestUser(success, error) {
  var user = new Parse.User();
  user.set('username', 'test');
  user.set('password', 'moon-y');
  var promise = user.signUp();
  if (success || error) {
    promise.then(function(user) {
      if (success) {
        success(user);
      }
    }, function(err) {
      if (error) {
        error(err);
      }
    });
  } else {
    return promise;
  }
}

// Shims for compatibility with the old qunit tests.
function ok(bool, message) {
  expect(bool).toBeTruthy(message);
}
function equal(a, b, message) {
  expect(a).toEqual(b, message);
}
function strictEqual(a, b, message) {
  expect(a).toBe(b, message);
}
function notEqual(a, b, message) {
  expect(a).not.toEqual(b, message);
}
function expectSuccess(params, done) {
  return {
    success: params.success,
    error: function(e) {
      fail('failure happened in expectSuccess');
      done ? done() : null;
    },
  }
}
function expectError(errorCode, callback) {
  return {
    success: function(result) {
      console.log('got result', result);
      fail('expected error but got success');
    },
    error: function(obj, e) {
      // Some methods provide 2 parameters.
      e = e || obj;
      if (!e) {
        fail('expected a specific error but got a blank error');
        return;
      }
      expect(e.code).toEqual(errorCode, e.message);
      if (callback) {
        callback(e);
      }
    },
  }
}

// Because node doesn't have Parse._.contains
function arrayContains(arr, item) {
  return -1 != arr.indexOf(item);
}

// Normalizes a JSON object.
function normalize(obj) {
  if (obj === null || typeof obj !== 'object') {
    return JSON.stringify(obj);
  }
  if (obj instanceof Array) {
    return '[' + obj.map(normalize).join(', ') + ']';
  }
  var answer = '{';
  for (var key of Object.keys(obj).sort()) {
    answer += key + ': ';
    answer += normalize(obj[key]);
    answer += ', ';
  }
  answer += '}';
  return answer;
}

// Asserts two json structures are equal.
function jequal(o1, o2) {
  expect(normalize(o1)).toEqual(normalize(o2));
}

function range(n) {
  var answer = [];
  for (var i = 0; i < n; i++) {
    answer.push(i);
  }
  return answer;
}

function mockFacebookAuthenticator(id, token) {
  var facebook = {};
  facebook.validateAuthData = function(authData) {
    if (authData.id === id && authData.access_token.startsWith(token)) {
      return Promise.resolve();
    } else {
      throw undefined;
    }
  };
  facebook.validateAppId = function(appId, authData) {
    if (authData.access_token.startsWith(token)) {
      return Promise.resolve();
    } else {
      throw undefined;
    }
  };
  return facebook;
}

function mockFacebook() {
  return mockFacebookAuthenticator('8675309', 'jenny');
}

// This is polluting, but, it makes it way easier to directly port old tests.
global.Parse = Parse;
global.TestObject = TestObject;
global.Item = Item;
global.Container = Container;
global.create = create;
global.createTestUser = createTestUser;
global.ok = ok;
global.equal = equal;
global.strictEqual = strictEqual;
global.notEqual = notEqual;
global.expectSuccess = expectSuccess;
global.expectError = expectError;
global.arrayContains = arrayContains;
global.jequal = jequal;
global.range = range;
global.reconfigureServer = reconfigureServer;
global.defaultConfiguration = defaultConfiguration;
global.mockFacebookAuthenticator = mockFacebookAuthenticator;
global.jfail = function(err) {
  fail(JSON.stringify(err));
}

global.it_exclude_dbs = excluded => {
  if (excluded.indexOf(process.env.PARSE_SERVER_TEST_DB) >= 0) {
    return xit;
  } else {
    return it;
  }
}

global.fit_exclude_dbs = excluded => {
  if (excluded.indexOf(process.env.PARSE_SERVER_TEST_DB) >= 0) {
    return xit;
  } else {
    return fit;
  }
}

global.describe_only_db = db => {
  if (process.env.PARSE_SERVER_TEST_DB == db) {
    return describe;
  } else if (!process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
    return describe;
  } else {
    return () => {};
  }
}

var libraryCache = {};
jasmine.mockLibrary = function(library, name, mock) {
  var original = require(library)[name];
  if (!libraryCache[library]) {
    libraryCache[library] = {};
  }
  require(library)[name] = mock;
  libraryCache[library][name] = original;
}

jasmine.restoreLibrary = function(library, name) {
  if (!libraryCache[library] || !libraryCache[library][name]) {
    throw 'Can not find library ' + library + ' ' + name;
  }
  require(library)[name] = libraryCache[library][name];
}


text:
<?php

namespace Opis\Container;

use Psr\Container\NotFoundExceptionInterface;

class NotFoundException extends \RuntimeException implements NotFoundExceptionInterface
{

}


text:
title: String.prototype.indexOf
localeTitle: String.prototype.indexOf
---
## String.prototype.indexOf

El método `indexOf()` devuelve el primer índice en el que se puede encontrar un elemento determinado en la matriz. Si el elemento no está presente, devuelve -1.

**Sintaxis**

```javascript
str.indexOf(searchValue[, fromIndex])
```

### Parámetros

*   **searchValue** Substring que está buscando. Si esto está vacío ( `''` ) y no hay un parámetro `fromIndex` , devolverá 0.

*   **fromIndex** Opcional. El índice en el que desea iniciar la búsqueda. Si el valor `fromIndex` es mayor o igual que la longitud de la cadena, no se busca la cadena y el método devuelve -1. Si `searchValue` es una cadena vacía ( `''` ) y el `fromIndex` es menor que la longitud de la cadena, devolverá el `fromIndex` ; de lo contrario, devolverá la longitud de la cadena. (Un número negativo se tratará como si no hubiera ningún argumento).

### Descripción

El método `indexOf()` verifica la cadena de izquierda a derecha. El índice del primer carácter es 0; El índice del último carácter es `string.length - 1` . El método `searchValue` cada subcadena con `searchValue` utilizando una igualdad estricta ( `===` ), lo que significa que este método `searchValue` mayúsculas y minúsculas. Una vez que encuentra una subcadena que devuelve `true` , devuelve el índice de su primer carácter.

### Ejemplos

```javascript
'Blue Whale'.indexOf('Blue');     // returns  0
 'Blue Whale'.indexOf('Blute');    // returns -1
 'Blue Whale'.indexOf('Whale', 0); // returns  5
 'Blue Whale'.indexOf('Whale', 5); // returns  5
 'Blue Whale'.indexOf('Whale', 7); // returns -1
 'Blue Whale'.indexOf('');         // returns  0
 'Blue Whale'.indexOf('', 9);      // returns  9
 'Blue Whale'.indexOf('', 10);     // returns 10
 'Blue Whale'.indexOf('', 11);     // returns 10
 'Blue Whale'.indexOf('blue');     // returns -1
```

### Más información:

*   Documentación [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) : [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)
*   Documentación de [MSDN](https://docs.microsoft.com/en-us/scripting/javascript/reference/indexof-method-string-javascript) : [MSDN](https://docs.microsoft.com/en-us/scripting/javascript/reference/indexof-method-string-javascript)


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: >
    The production QuantifierPrefix :: { DecimalDigits , }evaluates as follows:
    i) Let i be the MV of DecimalDigits
    ii) Return the two results i and \infty
es5id: 15.10.2.7_A6_T6
description: Execute /x{1,2}x{1,}/.exec("xxxxxxx") and check results
---*/

var __executed = /x{1,2}x{1,}/.exec("xxxxxxx");

var __expected = ["xxxxxxx"];
__expected.index = 0;
__expected.input = "xxxxxxx";

//CHECK#1
if (__executed.length !== __expected.length) {
	$ERROR('#1: __executed = /x{1,2}x{1,}/.exec("xxxxxxx"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);
}

//CHECK#2
if (__executed.index !== __expected.index) {
	$ERROR('#2: __executed = /x{1,2}x{1,}/.exec("xxxxxxx"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);
}

//CHECK#3
if (__executed.input !== __expected.input) {
	$ERROR('#3: __executed = /x{1,2}x{1,}/.exec("xxxxxxx"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);
}

//CHECK#4
for(var index=0; index<__expected.length; index++) {
	if (__executed[index] !== __expected[index]) {
		$ERROR('#4: __executed = /x{1,2}x{1,}/.exec("xxxxxxx"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);
	}
}


text:
require "active_support/core_ext/array/conversions"

module Pundit
  module RSpec
    module Matchers
      extend ::RSpec::Matchers::DSL

      # rubocop:disable Metrics/BlockLength
      matcher :permit do |user, record|
        match_proc = lambda do |policy|
          @violating_permissions = permissions.find_all do |permission|
            !policy.new(user, record).public_send(permission)
          end
          @violating_permissions.empty?
        end

        match_when_negated_proc = lambda do |policy|
          @violating_permissions = permissions.find_all do |permission|
            policy.new(user, record).public_send(permission)
          end
          @violating_permissions.empty?
        end

        failure_message_proc = lambda do |policy|
          was_were = @violating_permissions.count > 1 ? "were" : "was"
          "Expected #{policy} to grant #{permissions.to_sentence} on " \
          "#{record} but #{@violating_permissions.to_sentence} #{was_were} not granted"
        end

        failure_message_when_negated_proc = lambda do |policy|
          was_were = @violating_permissions.count > 1 ? "were" : "was"
          "Expected #{policy} not to grant #{permissions.to_sentence} on " \
          "#{record} but #{@violating_permissions.to_sentence} #{was_were} granted"
        end

        if respond_to?(:match_when_negated)
          match(&match_proc)
          match_when_negated(&match_when_negated_proc)
          failure_message(&failure_message_proc)
          failure_message_when_negated(&failure_message_when_negated_proc)
        else
          match_for_should(&match_proc)
          match_for_should_not(&match_when_negated_proc)
          failure_message_for_should(&failure_message_proc)
          failure_message_for_should_not(&failure_message_when_negated_proc)
        end

        def permissions
          current_example = ::RSpec.respond_to?(:current_example) ? ::RSpec.current_example : example
          current_example.metadata[:permissions]
        end
      end
    end

    module DSL
      def permissions(*list, &block)
        describe(list.to_sentence, permissions: list, caller: caller) { instance_eval(&block) }
      end
    end

    module PolicyExampleGroup
      include Pundit::RSpec::Matchers

      def self.included(base)
        base.metadata[:type] = :policy
        base.extend Pundit::RSpec::DSL
        super
      end
    end
  end
end

RSpec.configure do |config|
  if RSpec::Core::Version::STRING.split(".").first.to_i >= 3
    config.include(
      Pundit::RSpec::PolicyExampleGroup,
      type: :policy,
      file_path: %r{spec/policies}
    )
  else
    config.include(
      Pundit::RSpec::PolicyExampleGroup,
      type: :policy,
      example_group: { file_path: %r{spec/policies} }
    )
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectTasksOptions">
    <TaskOptions isEnabled="false">
      <option name="arguments" value="--fix $FileName$" />
      <option name="checkSyntaxErrors" value="true" />
      <option name="description" />
      <option name="exitCodeBehavior" value="ERROR" />
      <option name="fileExtension" value="js" />
      <option name="immediateSync" value="false" />
      <option name="name" value="ESlint Watcher" />
      <option name="output" value="" />
      <option name="outputFilters">
        <array />
      </option>
      <option name="outputFromStdout" value="false" />
      <option name="program" value="$PROJECT_DIR$/node_modules/.bin/eslint" />
      <option name="scopeName" value="WebSDK" />
      <option name="trackOnlyRoot" value="false" />
      <option name="workingDir" value="$FileDir$" />
      <envs />
    </TaskOptions>
  </component>
</project>


text:
\section{Namespace List}
Here is a list of all documented namespaces with brief descriptions:\begin{DoxyCompactList}
\item\contentsline{section}{\hyperlink{namespace_wintab_d_n}{WintabDN} }{\pageref{namespace_wintab_d_n}}{}
\end{DoxyCompactList}


text:
/**
 * @file angular-sweet-alert
 * @author huangxueliang@baidu.com
*/

'use strict';

angular.module('ngSweetAlert', []).factory('SweetAlert', [
    '$rootScope', '$q', function ($rootScope, $q) {
        var swal = window.swal;

        // public methods
        var self = {

            swal: function (arg1, arg2) {
                var deferrd = $q.defer();

                swal(arg1, function (isConfirm) {
                    if (angular.isFunction(arg2)) {
                        arg2(isConfirm);
                    }

                    if (isConfirm) {
                        deferrd.resolve();
                    }
                    else {
                        deferrd.reject();
                    }
                });

                return deferrd.promise;
            },
            success: function (title, message) {
                $rootScope.$evalAsync(function () {
                    swal(title, message, 'success');
                });
            },
            error: function (title, message) {
                $rootScope.$evalAsync(function () {
                    swal(title, message, 'error');
                });
            },
            warning: function (title, message) {
                $rootScope.$evalAsync(function () {
                    swal(title, message, 'warning');
                });
            },
            info: function (title, message) {
                $rootScope.$evalAsync(function () {
                    swal(title, message, 'info');
                });
            },
            showInputError: function (message) {
		$rootScope.$evalAsync(function () {
    	            swal.showInputError(message);
    	        });
            },
            close: function () {
            	$rootScope.$evalAsync(function (){
    	            swal.close();
    	        });
            }
        };
        return self;
    }
]);


text:
zproxy
======

A proxy that tries to find pieces shared between otherwise unrelated files.

Usage
======

Start hasher on a high-bandwidth host. Start proxy locally, pointing it at the previously-started hasher
and at a directory to be used as a cache.


text:
package routers

import (
	"github.com/astaxie/beego"
)

func init() {

	beego.GlobalControllerRouter["Amoein/Catrin/controllers:UserController"] = append(beego.GlobalControllerRouter["Amoein/Catrin/controllers:UserController"],
		beego.ControllerComments{
			Method: "Post",
			Router: `/`,
			AllowHTTPMethods: []string{"post"},
			Params: nil})

}


text:
import "../styles/globals.css";
import { AppProps } from "next/app";

function MyApp({ Component, pageProps }: AppProps) {
  return <Component {...pageProps} />;
}

export default MyApp;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Haplaria lateritia Torrend

### Remarks
null


text:
<form novalidate [formGroup]="formGroup">

    <sky-input-box>

        URL - ruleset v{{ skyUrlValidationOptions.rulesetVersion }}

      <input
        class="sky-form-control"
        formControlName="url"
        skyId
        #urlInput="skyId"
      />
    </sky-input-box>

  <ng-container *ngIf="urlControl.errors && urlControl.touched">

      URL is required.

      Enter a valid URL in the "http(s)://site.domain" format.

  </ng-container>
</form>

<button
  class="sky-btn sky-btn-default sky-col-picker-btn"
  type="button"
  attr.aria-label="ruleset-toggle-button"
  attr.title="ruleset-toggle-button"
  (click)="toggleRuleset()"
>
   Toggle Ruleset
</button>


text:
//
//  GMSMapView+Overlays.h
//  Google Maps SDK for iOS
//
//  Copyright 2013 Google Inc.
//
//  Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of
//  Service: https://developers.google.com/maps/terms
//

#import <GoogleMaps/GMSMapView.h>

/**
 * GMSMapView (Overlays) offers several methods to obtain specific overlay types
 * currently attached to the map.
 *
 * NOTE: In 1.2 of the Google Maps SDK for iOS, these methods are deprecated.
 * They may not appear in later releases of the SDK. Instead of using these
 * methods, we suggest that you maintain your own references to overlays that
 * you have added to a GMSMapView.
 */
@interface GMSMapView (Overlays)

/** Returns every GMSMarker attached to this GMSMapView. */
- (NSArray *)markers;

/** Returns every GMSGroundOverlay attached to this GMSMapView. */
- (NSArray *)groundOverlays;

/** Returns every GMSPolyline attached to this GMSMapView. */
- (NSArray *)polylines;

@end


text:
package com.checkers.server.beans;

/**
 * ExceptionMessage entity.
 * Applicable as @ExceptionHandler result only
 *
 * @author Pavel_Kuchin
 */
public class ExceptionMessage {
    private Long    code;       //Exception code
    private String  message;    //Short message for developer
    private String  detailsURL; //Detailed description

    public Long getCode() {
        return code;
    }

    public void setCode(Long code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getDetailsURL() {
        return detailsURL;
    }

    public void setDetailsURL(String detailsURL) {
        this.detailsURL = detailsURL;
    }
}


text:
test:
	nodeunit src/SpahQL-edge.js test

.PHONY: test


text:
using System;
using System.Linq;
using PHP.Core;
using PHP.Core.Reflection;
using System.ComponentModel;
using System.Collections;
using System.Runtime.InteropServices;
using System.Diagnostics;

namespace PHP.Library.SPL
{
    #region ReflectionFunctionAbstract

    /// <summary>
    /// A parent class to <see cref="ReflectionFunction"/>.
    /// </summary>
    [ImplementsType]
    public abstract class ReflectionFunctionAbstract : PhpObject, Reflector
    {
        #region Properties

        [PhpVisible]
        public virtual string name
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        #endregion

        #region Constructors

        /// <summary>
        /// For internal purposes only.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        public ReflectionFunctionAbstract(ScriptContext/*!*/context, bool newInstance)
            : base(context, newInstance)
        { }

        /// <summary>
        /// For internal purposes only.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        public ReflectionFunctionAbstract(ScriptContext/*!*/context, DTypeDesc caller)
            : base(context, caller)
        { }

        #endregion

        #region Methods

        [ImplementsMethod]
        private object __clone(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object __clone(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).__clone(stack.Context);
        }

        [ImplementsMethod]
        public virtual object getClosureThis(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getClosureThis(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getClosureThis(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*string*/getDocComment(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getDocComment(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getDocComment(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*int*/getEndLine(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getEndLine(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getEndLine(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*ReflectionExtension*/getExtension(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getExtension(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getExtension(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*string*/getExtensionName(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getExtensionName(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getExtensionName(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*string*/getFileName(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getFileName(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getFileName(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*string*/getName(ScriptContext/*!*/context)
        {
            return this.name;
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getName(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getName(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*string*/getNamespaceName(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getNamespaceName(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getNamespaceName(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*int*/getNumberOfParameters(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getNumberOfParameters(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getNumberOfParameters(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*int*/getNumberOfRequiredParameters(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getNumberOfRequiredParameters(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getNumberOfRequiredParameters(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*array*/getParameters(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getParameters(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getParameters(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*string*/getShortName(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getShortName(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getShortName(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*int*/getStartLine(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getStartLine(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getStartLine(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*array*/getStaticVariables(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getStaticVariables(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).getStaticVariables(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/inNamespace(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object inNamespace(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).inNamespace(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isClosure(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isClosure(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).isClosure(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isDeprecated(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isDeprecated(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).isDeprecated(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isInternal(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isInternal(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).isInternal(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isUserDefined(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isUserDefined(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).isUserDefined(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/returnsReference(ScriptContext/*!*/context)
        {
            throw new NotImplementedException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object returnsReference(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).returnsReference(stack.Context);
        }

        [ImplementsMethod]
        public abstract object __toString(ScriptContext/*!*/context);

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object __toString(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunctionAbstract)instance).__toString(stack.Context);
        }

        #endregion
    }

    #endregion

    #region ReflectionFunction

    /// <summary>
    /// The ReflectionFunction class reports information about a function.
	/// </summary>
    [ImplementsType]
    public class ReflectionFunction : ReflectionFunctionAbstract
    {
        private DRoutineDesc routine;

        #region Constants

        /// <summary>
        /// Indicates deprecated functions.
        /// </summary>
        public const int IS_DEPRECATED = 262144;

        #endregion

        #region Properties

        [PhpVisible]
        public override string name
        {
            get
            {
                return (routine != null) ? routine.MakeFullName() : null;
            }
        }

        #endregion

        #region Constructor

        /// <summary>
        /// For internal purposes only.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        public ReflectionFunction(ScriptContext/*!*/context, bool newInstance)
            : base(context, newInstance)
        { }

        /// <summary>
        /// For internal purposes only.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        public ReflectionFunction(ScriptContext/*!*/context, DTypeDesc caller)
            : base(context, caller)
        { }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object __construct(object instance, PhpStack stack)
        {
            object argument = stack.PeekValue(1);
            stack.RemoveFrame();
            return ((ReflectionFunction)instance).__construct(stack.Context, argument);
        }

        /// <summary>
        /// Constructs a ReflectionFunction object.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="arg">The name of the function to reflect or a closure.</param>
        /// <returns></returns>
        [ImplementsMethod]
        public virtual object __construct(ScriptContext context, object arg)
        {
            string name = PhpVariable.AsString(arg);
            if (!string.IsNullOrEmpty(name))
            {
                routine = context.ResolveFunction(name, null, false);
            }
            else
            {
                PhpException.InvalidArgument("arg");
            }

            if (routine == null)
                PhpException.Throw(PhpError.Error, string.Format("Function {0}() does not exist", name));

            return null;
        }

        #endregion

        [ImplementsMethod]
        public override object __toString(ScriptContext context)
        {
            return string.Format("Function [ function {0} ] {}", this.name);
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public new static object __toString(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunction)instance).__toString(stack.Context);
        }

        //public static string export ( string $name [, string $return ] )

        [ImplementsMethod]
        public virtual object/*Closure*/getClosure(ScriptContext context)
        {
            return new SPL.Closure(context, routine.ArglessStub, null, null);
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getClosure(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunction)instance).getClosure(stack.Context);
        }

        [ImplementsMethod, NeedsArgless]
        public virtual object/*mixed*/invoke(ScriptContext context)
        {
            Debug.Fail("ArgLess should be called instead!");
            throw new InvalidOperationException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object invoke(object instance, PhpStack stack)
        {
            ReflectionFunction func = (ReflectionFunction)instance;
            if (func.routine == null)
            {
                stack.RemoveFrame();
                return false;
            }

            return func.routine.Invoke(null, stack);
        }

        [ImplementsMethod]
        public virtual object/*mixed*/invokeArgs(ScriptContext context, object args)
        {
            if (routine == null)
                return false;

            ICollection values = null;
            IDictionary dict;
            if ((dict = args as IDictionary) != null) values = dict.Values;
            else values = args as ICollection;

            // invoke the routine
            var stack = context.Stack;
            stack.AddFrame(values ?? ArrayUtils.EmptyObjects);
            return routine.Invoke(null, stack);
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object invokeArgs(object instance, PhpStack stack)
        {
            var args = stack.PeekValue(1);
            stack.RemoveFrame();

            return ((ReflectionFunction)instance).invokeArgs(stack.Context, args);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isDisabled(ScriptContext context)
        {
            return false;   // not supported by Phalanger yet
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isDisabled(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionFunction)instance).isDisabled(stack.Context);
        }
    }

    #endregion

    #region ReflectionMethod

    [ImplementsType]
    public class ReflectionMethod : ReflectionFunctionAbstract
    {
        internal DTypeDesc dtype;
        internal DRoutineDesc method;

        #region Constants

        public const int IS_STATIC = 1;
        public const int IS_ABSTRACT = 2;
        public const int IS_FINAL = 4;
        public const int IS_PUBLIC = 256;
        public const int IS_PROTECTED = 512;
        public const int IS_PRIVATE = 1024;

        #endregion

        #region Properties

        [PhpVisible]
        public override string name
        {
            get
            {
                return (method != null) ? method.MakeFullName() : null;
            }
        }

        [PhpVisible]
        public string @class
        {
            get
            {
                return (dtype != null) ? dtype.MakeFullName() : null;
            }
        }

        #endregion

        #region Constructor

        /// <summary>
        /// For internal purposes only.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        public ReflectionMethod(ScriptContext/*!*/context, bool newInstance)
            : base(context, newInstance)
        { }

        /// <summary>
        /// For internal purposes only.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        public ReflectionMethod(ScriptContext/*!*/context, DTypeDesc caller)
            : base(context, caller)
        { }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object __construct(object instance, PhpStack stack)
        {
            object @class = stack.PeekValue(1);
            object methodname = stack.PeekValue(1);
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).__construct(stack.Context, @class, methodname);
        }

        /// <summary>
        /// Constructs a ReflectionFunction object.
        /// </summary>
        [ImplementsMethod]
        public virtual object __construct(ScriptContext context, object @class, object methodname)
        {
            string methodnameStr = PhpVariable.AsString(methodname);

            this.dtype = null;
            this.method = null;

            DObject dobj;

            if ((dobj = (@class as DObject)) != null)
            {
                this.dtype = dobj.TypeDesc;
            }
            else
            {
                var str = PhpVariable.AsString(@class);
                if (str != null)
                    this.dtype = context.ResolveType(str, null, null, null, ResolveTypeFlags.UseAutoload);

                if (this.dtype == null)
                {
                    PhpException.Throw(PhpError.Error, string.Format("Class {0} does not exist", str));
                    return false;
                }
            }

            if (this.dtype.GetMethod(new Name(methodnameStr), dtype, out this.method) == GetMemberResult.NotFound)
            {
                PhpException.Throw(PhpError.Error, string.Format("Method {0}::{1}() does not exist", dtype.MakeFullName(), methodnameStr));
                return false;
            }

            return null;
        }

        #endregion

        //public static string export ( string $class , string $name [, bool $return = false ] )

        [ImplementsMethod]
        public virtual object/*Closure*/getClosure(ScriptContext context, [Optional]object @object)
        {
            if (method == null)
                return false;

            if (@object == Arg.Default)
                @object = null;

            DObject dobj = null;

            // get instance object
            if (method.IsStatic)
            {
                if (@object != null)
                {
                    PhpException.InvalidArgument("object");
                    @object = null;
                }
            }
            else
            {
                dobj = @object as DObject;
                if (dobj == null)
                {
                    PhpException.InvalidArgumentType("object", DObject.PhpTypeName);
                    return false;
                }
            }

            // check whether method can be called on this object
            if (dobj != null)
            {
                if (!this.dtype.IsAssignableFrom(dobj.TypeDesc))
                {
                    PhpException.InvalidArgument("object");
                    return false;
                }
            }

            // create closure that calls the method on specified instance:
            return new SPL.Closure(context, (instance, stack) => method.ArglessStub(dobj, stack), null, null);
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getClosure(object instance, PhpStack stack)
        {
            var @object = stack.PeekValueOptional(1);
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).getClosure(stack.Context, @object);
        }

        [ImplementsMethod]
        public virtual object/*int*/getModifiers(ScriptContext context)
        {
            if (method == null)
                return false;

            int result = 0;

            if (method.IsStatic) result |= IS_STATIC;
            if (method.IsAbstract) result |= IS_ABSTRACT;
            if (method.IsFinal) result |= IS_FINAL;
            if (method.IsPublic) result |= IS_PUBLIC;
            if (method.IsProtected) result |= IS_PROTECTED;
            if (method.IsPrivate) result |= IS_PRIVATE;

            return result;
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getModifiers(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).getModifiers(stack.Context);
        }

        /// <summary>
        /// Gets the method prototype (if there is one).
        /// Prototype is a method of base class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns><see cref="ReflectionMethod"/> or <c>FALSE</c>.</returns>
        [ImplementsMethod]
        public virtual object/*ReflectionMethod*/getPrototype(ScriptContext context)
        {
            if (dtype == null || method == null || dtype.Base == null)
                return false;

            DRoutineDesc prototype;
            if (dtype.Base.GetMethod(method.KnownRoutine.Name, dtype, out prototype) == GetMemberResult.NotFound)
                return false;

            return new ReflectionMethod(context, true)
            {
                dtype = prototype.DeclaringType,
                method = prototype,
            };
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getPrototype(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).getPrototype(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*ReflectionClass*/getDeclaringClass(ScriptContext context)
        {
            if (dtype == null)
                return false;

            return new ReflectionClass(context, true)
            {
                typedesc = dtype
            };
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object getDeclaringClass(object instance, PhpStack stack)
        {
            stack.RemoveFrame();

            return ((ReflectionMethod)instance).getDeclaringClass(stack.Context);
        }

        [ImplementsMethod, NeedsArgless]
        public virtual object/*mixed*/invoke(ScriptContext context, object instance)
        {
            Debug.Fail("ArgLess should be called instead!");
            throw new InvalidOperationException();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object invoke(object instance, PhpStack stack)
        {
            var m = (ReflectionMethod)instance;
            if (m.method == null)
            {
                stack.RemoveFrame();
                return false;
            }

            object obj = stack.PeekValue(1);
            PhpArray args = new PhpArray((stack.ArgCount > 1 ? (stack.ArgCount - 1) : (0)));
            for (int i = 2; i <= stack.ArgCount; i++)
                args.Add(stack.PeekValue(i));
            stack.RemoveFrame();

            //
            return m.invokeArgs(stack.Context, obj, args);
        }

        [ImplementsMethod]
        public virtual object/*mixed*/invokeArgs(ScriptContext context, object instance, object args)
        {
            if (method == null)
                return false;

            var dobj = instance as DObject;
            if (!method.IsStatic)
            {
                if (dobj == null || !this.dtype.IsAssignableFrom(dobj.TypeDesc))    // non static method needs compatible instance
                {
                    PhpException.InvalidArgument("instance");
                    return false;
                }
            }

            ICollection values = null;
            IDictionary dict;
            if ((dict = args as IDictionary) != null) values = dict.Values;
            else values = args as ICollection;

            // invoke the routine
            var stack = context.Stack;
            stack.AddFrame(values ?? ArrayUtils.EmptyObjects);
            stack.LateStaticBindType = dtype;

            return method.Invoke(dobj, stack);
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object invokeArgs(object instance, PhpStack stack)
        {
            var args = stack.PeekValue(1);
            stack.RemoveFrame();

            return ((ReflectionFunction)instance).invokeArgs(stack.Context, args);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isAbstract(ScriptContext context)
        {
            return method != null && method.IsAbstract;
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isAbstract(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).isAbstract(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isConstructor(ScriptContext context)
        {
            return method != null && method.IsConstructor;
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isConstructor(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).isConstructor(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isDestructor(ScriptContext context)
        {
            return method != null && Name.SpecialMethodNames.Destruct.Value.EqualsOrdinalIgnoreCase(method.MakeFullName());
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isDestructor(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).isDestructor(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isFinal(ScriptContext context)
        {
            return method != null && method.IsFinal;
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isFinal(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).isFinal(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isPrivate(ScriptContext context)
        {
            return method != null && method.IsPrivate;
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isPrivate(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).isPrivate(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isProtected(ScriptContext context)
        {
            return method != null && method.IsProtected;
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isProtected(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).isProtected(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isPublic(ScriptContext context)
        {
            return method != null && method.IsPublic;
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isPublic(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).isPublic(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/isStatic(ScriptContext context)
        {
            return method != null && method.IsStatic;
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object isStatic(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).isStatic(stack.Context);
        }

        [ImplementsMethod]
        public virtual object/*bool*/setAccessible(ScriptContext context, object accessible)
        {
            if (this.method == null)
                return false;

            bool baccessible = Core.Convert.ObjectToBoolean(accessible);
            // TODO: remember private method accessibility
            return null;
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public static object setAccessible(object instance, PhpStack stack)
        {
            var accessible = stack.PeekValue(1);
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).setAccessible(stack.Context, accessible);
        }

        [ImplementsMethod]
        public override object/*string*/__toString(ScriptContext context)
        {
            if (method == null)
                return false;

            return string.Format("Method [ {0} method {1} ] {}",
                (method.IsStatic ? "static " : string.Empty) + (method.IsPublic ? "public" : (method.IsProtected ? "protected" : "private")),
                this.name);
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        public new static object __toString(object instance, PhpStack stack)
        {
            stack.RemoveFrame();
            return ((ReflectionMethod)instance).__toString(stack.Context);
        }
    }

    #endregion
}


text:
package org.springframework.boot.loaderapp;

import java.io.File;
import java.net.JarURLConnection;
import java.net.URL;
import java.util.Arrays;

import javax.servlet.ServletContext;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.util.FileCopyUtils;

@SpringBootApplication
public class LoaderTestApplication {

	@Bean
	public CommandLineRunner commandLineRunner(ServletContext servletContext) {
		return (args) -> {
			File temp = new File(System.getProperty("java.io.tmpdir"));
			URL resourceUrl = servletContext.getResource("webjars/jquery/3.5.0/jquery.js");
			JarURLConnection connection = (JarURLConnection) resourceUrl.openConnection();
			String jarName = connection.getJarFile().getName();
			System.out.println(">>>>> jar file " + jarName);
			if(jarName.contains(temp.getAbsolutePath())) {
				System.out.println(">>>>> jar written to temp");
			}
			byte[] resourceContent = FileCopyUtils.copyToByteArray(resourceUrl.openStream());
			URL directUrl = new URL(resourceUrl.toExternalForm());
			byte[] directContent = FileCopyUtils.copyToByteArray(directUrl.openStream());
			String message = (!Arrays.equals(resourceContent, directContent)) ? "NO MATCH"
					: directContent.length + " BYTES";
			System.out.println(">>>>> " + message + " from " + resourceUrl);
		};
	}

	public static void main(String[] args) {
		SpringApplication.run(LoaderTestApplication.class, args).stop();
	}

}


text:
This package enables Teleport auth server to store secrets in
[Firestore](https://cloud.google.com/firestore/docs/) on GCP.

WARNING: Using Firestore involves recurring charge from GCP.

### Building

Firestore backend is not enabled by default. To enable it you have to
compile Teleport with `firestore` build flag.

To build Teleport with Firestore enabled, run:

```
ADDFLAGS='-tags firestore' make teleport
```

### Quick Start

There are currently two Firestore mode options for any given GCP Project; `Native mode` and
`Datastore Mode`. This storage backend uses Real-time updates to keep individual auth instances
in sync and requires Firestore configured in `Native mode`.

Add this storage configuration in `teleport` section of the config file (by default it's `/etc/teleport.yaml`):

```yaml
teleport:
  storage:
    type: firestore
    collection_name: cluster-data
    credentials_path: /var/lib/teleport/firestore_creds
    project_id: gcp-proj-with-firestore-enabled
```

Collections are automatically created by the Firestore APIs and the required indexes are created
by the backend on first start, if they do not exist.

### Encryption

Lifted from [Google docs](https://cloud.google.com/firestore/docs/server-side-encryption); Cloud Firestore automatically
encrypts all data before it is written to disk. There is no setup or configuration required and no need to modify the
way you access the service. The data is automatically and transparently decrypted when read by an authorized user.

With server-side encryption, Google manages the cryptographic keys on your behalf using the same hardened key management
systems that we use for our own encrypted data, including strict key access controls and auditing. Each Cloud Firestore
object's data and metadata is encrypted under the 256-bit Advanced Encryption Standard, and each encryption key is itself
encrypted with a regularly rotated set of master keys.

### Full Properties

The full list of configurable properties for this backend are:

- `credentials_path` (string, path to GCP creds for Firestore, not-required)
- `project_id` (string, project ID, **required**)
- `collection_name` (string, collection for cluster information, **required**)
- `purge_expired_documents_poll_interval` (time duration, poll interval to sweep expired documents, not-required, defaults to `once per minute`)
- `retry_period` (time duration, retry period for all background tasks, not-required, defaults to `10 seconds`)
- `disable_expired_document_purge` (bool, disables expired document purging, not-required, defaults to `false`)
- `buffer_size` (int, buffer size for watched events, not-required, defaults to `1024`)
- `endpoint` (string, firestore client endpoint, not-required, ex: `localhost:8618`)
- `limit_watch_query` (bool, forces the watcher to start querying only for records from current time forward, not-required, defaults to `false`)

### Firestore Client Authentication Options

There are three authentication/authorization modes available;

1. With no `credentialsPath` and no `endpoint` defined, the Firestore clients will use
Google Application Default Credentials for authentication. This only works in cases
where Teleport is installed on GCE instances and have service accounts with IAM role/profile
associations authorizing that GCE instance to use Firestore.
2. With `endpoint` defined, Firestore will create clients no auth, GRPC in-secure, clients pointed
at the specified endpoint. **This is only used for tests, see `Tests` section below.**
3. With `credentialsPath` defined, Firestore will create clients authenticating against
live systems with the Service Account bound to the JSON key file referenced in the option.

### Implementation Details

Firestore Document IDs must be unique, cannot start with periods, and cannot contain forward
slashes. In order to support more straight forward fetching but work within the requirements
of Firestore, Document IDs are SHA1 hashed from the records key.

Realtime updates are consumed across the cluster via Firestore's [ability](https://cloud.google.com/firestore/docs/query-data/listen)
to watch for document updates.

One composite indexes is required for this implementation:

1. `key` ascending, then on `expires` ascending

Composite indexes should be limited to the specific collection set in the
configuration (in the aforementioned example is `cluster-data`).

### Tests

Tests must execute one of two ways:

1. With `gcloud` installed in test infrastructure and the `firestore` emulator enabled
and running to a dynamic port a pre-defined port used in the config.
Ex: `gcloud beta emulators firestore start --host-port=localhost:8618`. This is where the Firestore config
parameter `endpoint` is used.
2. With a service account pointed a test GCP project and or test collections.

### Get Help

This backend has been contributed by https://github.com/joshdurbin


text:
class StaticPagesController < ApplicationController
  skip_before_filter :verify_authenticity_token

  def contact
    if request.post? && verify_recaptcha
      ContactFormMailer.delay.contact_form_email(params[:sender_name], params[:sender_email], params[:message])
      flash[:notice] = "Your message has been sent!"
      redirect_to root_path
    end
  end

  def manage
    raise Pundit::NotAuthorizedError unless !current_user.nil? && current_user.owner?
  end
end


text:
var CoreView = Torso.View.extend({
  initialize: function(args) {
    args = args || {};
    this.template = args.template || function() {return '';};
    this.path = args.path;
  },

  prepare: function() {
    var trail = [];
    if (this.path) {
      // Construct breadcrumb
      var steps = this.path.split('\.');
      var compound = '#';
      for (var i = 0; i < steps.length; i++) {
        if (i !== 0) {
          compound += '.';
        }
        compound += steps[i];
        trail.push({
          name: steps[i],
          route: compound
        });
      }

      // Construct topic list
      var children = _.difference(Object.keys(app.getPathTemplate()),
                                  ['_setup','isTop','_child']);
      var topics = [];
      for (var i = 0; i < children.length; i++) {
        topics.push({
          route: '#' + this.path + '.' + children[i],
          name: children[i],
        })
      }
    }
    return {
      trail: trail,
      topics: topics
    };
  },

  render: function() {
    var context = this.prepare();
    this.$el.html(Templates.decorators.header(context));
    this.$el.find('#main_content').append(this.template(context));
    this.$el.append(Templates.decorators.footer());
    this.delegateEvents();
  }
});


text:
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ghidra.file.formats.bplist;

import ghidra.app.util.bin.ByteProvider;
import ghidra.program.model.address.Address;
import ghidra.program.model.mem.Memory;

import java.io.IOException;

public final class BinaryPropertyListUtil {

	public static boolean isBinaryPropertyList( ByteProvider provider ) throws IOException {
		byte [] bytes = provider.readBytes( 0, BinaryPropertyListConstants.BINARY_PLIST_MAGIC.length( ) );
		String magic = new String( bytes );
		return BinaryPropertyListConstants.BINARY_PLIST_MAGIC.equals( magic );
	}

	public static boolean isBinaryPropertyList( Memory memory, Address address ) {
		byte [] bytes = new byte [ BinaryPropertyListConstants.BINARY_PLIST_MAGIC.length( ) ];
		try {
			memory.getBytes( address, bytes );
		}
		catch ( Exception e ) {
			// ignore
		}
		String magic = new String( bytes );
		return BinaryPropertyListConstants.BINARY_PLIST_MAGIC.equals( magic );
	}

	public static String generateName( int index ) {
		return generateName( index & 0xffffffffL );
	}

	public static String generateName( long index ) {
		return "BPLIST_Index_" + Long.toHexString( index );
	}
}


text:
package com.amazonaws.services.simpleworkflow.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum DecisionType {

    ScheduleActivityTask("ScheduleActivityTask"),
    RequestCancelActivityTask("RequestCancelActivityTask"),
    CompleteWorkflowExecution("CompleteWorkflowExecution"),
    FailWorkflowExecution("FailWorkflowExecution"),
    CancelWorkflowExecution("CancelWorkflowExecution"),
    ContinueAsNewWorkflowExecution("ContinueAsNewWorkflowExecution"),
    RecordMarker("RecordMarker"),
    StartTimer("StartTimer"),
    CancelTimer("CancelTimer"),
    SignalExternalWorkflowExecution("SignalExternalWorkflowExecution"),
    RequestCancelExternalWorkflowExecution("RequestCancelExternalWorkflowExecution"),
    StartChildWorkflowExecution("StartChildWorkflowExecution"),
    ScheduleLambdaFunction("ScheduleLambdaFunction");

    private String value;

    private DecisionType(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return DecisionType corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static DecisionType fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (DecisionType enumEntry : DecisionType.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
layout: model
title: English pipeline_image_classifier_vit_PANDA_ViT ViTForImageClassification from smc
author: John Snow Labs
name: pipeline_image_classifier_vit_PANDA_ViT
date: 2022-10-12
tags: [vit, en, images, open_source, pipeline]
task: Image Classification
language: en
edition: Spark NLP 4.2.1
spark_version: 3.0
supported: true
annotator: PipelineModel
article_header:
  type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

Pretrained VIT  model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.`image_classifier_vit_PANDA_ViT` is a English model originally trained by smc.

## Predicted Entities

`Beningn`, `ISUP 5`, `ISUP 1`, `ISUP 2`, `ISUP 4`, `ISUP 3`

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
<button class="button button-orange" disabled>Open in Colab</button>
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/models/pipeline_image_classifier_vit_PANDA_ViT_en_4.2.1_3.0_1665537271410.zip){:.button.button-orange.button-orange-trans.arr.button-icon}

## How to use

<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}
```python

    pipeline = PretrainedPipeline('pipeline_image_classifier_vit_PANDA_ViT', lang = 'en')
    annotations =  pipeline.transform(imageDF)

```
```scala

    val pipeline = new PretrainedPipeline("pipeline_image_classifier_vit_PANDA_ViT", lang = "en")
    val annotations = pipeline.transform(imageDF)

```
</div>

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|pipeline_image_classifier_vit_PANDA_ViT|
|Type:|pipeline|
|Compatibility:|Spark NLP 4.2.1+|
|License:|Open Source|
|Edition:|Official|
|Language:|en|
|Size:|321.9 MB|

## Included Models

- ImageAssembler
- ViTForImageClassification


text:
<?php

/**
 * @namespace
 */
namespace ShiftContentNew\Type\Field;

use Zend\Di\Locator;
use ShiftContentNew\Module;
use ShiftContentNew\Exception\ConfigurationException;
use ShiftContentNew\Type\Field\Field;
use ShiftContentNew\FieldType\FieldTypeFactory;

/**
 * Field factory
 * Responsible for creation of content type fields and managing their
 * filter and validator attributes.
 *
 * @category    Projectshift
 * @package     ShiftContentNew
 * @subpackage  Type
 */
class FieldFactory
{

    /**
     * Service locator instance
     * @var \Zend\Di\Locator
     */
    protected $locator;

    /**
     * Content module configuration
     * @var array
     */
    protected $config = array();

    /**
     * Field type factory
     * @var \ShiftContentNew\FieldType\FieldTypeFactory
     */
    protected $fieldTypeFactory;

    /**
     * Construct
     * Instantiates field factory. Requires an instance of service locator.
     *
     * @param \Zend\Di\Locator $locator
     * @return void
     */
    public function __construct(Locator $locator)
    {
        $this->locator = $locator;
    }

    /**
     * Set config
     * Allows you to inject arbitrary config to be used within
     *
     * @param array $config
     * @return \ShiftContentNew\Type\Field\FieldFactory
     */
    public function setConfig(array $config)
    {
        $this->config = $config;
        return $this;
    }

    /**
     * Get config
     * Checks if we already have a config injected and returns that.
     * Otherwise obtains config from module bootstrap.
     *
     * @return array
     */
    public function getConfig()
    {
        if(empty($this->config))
            $this->config = Module::getModuleConfig()->toArray();
        return $this->config;
    }

    /**
     * Set field type factory
     * Allows you to inject arbitrary field type factory to be used.
     *
     * @param \ShiftContentNew\FieldType\FieldTypeFactory $fieldTypeFactory
     * @return \ShiftContentNew\Type\Field\FieldFactory
     */
    public function setFieldTypeFactory(FieldTypeFactory $fieldTypeFactory)
    {
        $this->fieldTypeFactory = $fieldTypeFactory;
        return $this;
    }

    /**
     * Get field type factory
     * Returns currently injected field type factory if it was injected or
     * obtains one from service locator.
     *
     * @return \ShiftContentNew\FieldType\FieldTypeFactory
     */
    public function getFieldTypeFactory()
    {
        if(!$this->fieldTypeFactory)
        {
            $this->fieldTypeFactory = $this->locator->get(
                'ShiftContentNew\FieldType\FieldTypeFactory'
            );
        }

        return $this->fieldTypeFactory;
    }

    /**
     * Get field types
     * Returns an array of configured field types.
     * @return array
     */
    public function getFieldTypes()
    {
        $config = $this->getConfig();
        $types = $config['contentFields'];
        return $types;
    }

    /**
     * Get field type
     * Returns field type object if it's configured
     * @param string $className
     * @return \ShiftContentNew\FieldType\AbstractFieldType | null
     */
    public function getFieldType($className)
    {
        $types = $this->getFieldTypes();
        foreach($types as $type)
        {
            if($type == $className)
                return new $className;
        }
    }

    /**
     * Create field
     * Allows to assemble a field by it's type short name. May optionally
     * accept an array data set to populate field upon instantiation.
     *
     * @param string $shortName
     * @param array $data
     * @return \ShiftContentNew\Type\Field\Field | null
     */
    public function createField($shortName, array $data = array())
    {
        $types = $this->getFieldTypes();
        if(!array_key_exists($shortName, $types))
            return;

        return $this->createFieldOfType($types[$shortName], $data);
    }

    /**
     * Create field
     * Creates and configured field by its field type class name. May optionally
     * accept an array data set to populate field upon instantiation.
     *
     * @param string $typeClassName
     * @param array $data
     * @throws \ShiftContentNew\Exception\ConfigurationException
     * @return \ShiftContentNew\Type\Field\Field
     */
    public function createFieldOfType($typeClassName, array $data = array())
    {
        $type = $this->getFieldType($typeClassName);

        if(!$type)
        {
            $error = "Field '$typeClassName' is not configured";
            throw new ConfigurationException($error);
        }

        $field = new Field($data);
        $field->setFieldType($typeClassName);

        $settings = $this->getFieldTypeFactory()->getSettings($type);
        if($settings)
            $field->setSettings($settings);

        return $field;

    }

} //class ends here


text: Author:: Eric Vierhaus (<eric@clubhouse-studios.com>)


text:
// Copyright 2015 XLGAMES Inc.
//
// Distributed under the MIT License (See
// accompanying file "LICENSE" or the website
// http://www.opensource.org/licenses/mit-license.php)

using System;
using System.ComponentModel.Composition;
using System.Collections.Generic;

namespace ControlsLibraryExt.Material
{
    [Export(typeof(ActiveMaterialContext))]
    [PartCreationPolicy(CreationPolicy.Shared)]
    public class ActiveMaterialContext
    {
        public string MaterialName
        {
            get { return m_materialName; }
            set
            {
                if (value != m_materialName)
                {
                    m_materialName = value;
                    if (OnChange != null)
                        OnChange.Invoke();
                }
            }
        }
        public string PreviewModelName { get; set; }
        public ulong PreviewModelBinding { get; set; }
        public delegate void OnChangeDelegate();
        public event OnChangeDelegate OnChange;

        public virtual IEnumerable<string> AssignableTechniqueConfigs { get { return System.Linq.Enumerable.Empty<string>(); } }

        private string m_materialName = null;
    }
}


text:
require 'spec_helper'

RSpec.describe MoveToProjectEntity do
  describe '#as_json' do
    let(:project) { build(:project, id: 1) }

    subject { described_class.new(project).as_json }

    it 'includes the project ID' do
      expect(subject[:id]).to eq(project.id)
    end

    it 'includes the full path' do
      expect(subject[:name_with_namespace]).to eq(project.name_with_namespace)
    end
  end
end


text:
using System;
using System.Reflection;

namespace DotCommon.Reflecting
{
    /// <summary>
    /// Emit工具类
    /// </summary>
    public static class EmitUtil
    {
        /// <summary>
        /// 可空类型判断
        /// </summary>
        public static bool IsNullable(Type type)
        {
            return type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>);
        }

        /// <summary>
        /// 获取可空类型的真实类型
        /// </summary>
        public static Type GetNullableArg0(Type type)
        {
            return IsNullable(type) ? type.GenericTypeArguments[0] : type;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace skipman
{
    /// <summary>
    /// スキャン処理の進捗リスナー
    /// </summary>
    public interface ProgressListener
    {
        /// <summary>
        /// 進捗通知
        /// </summary>
        /// <param name="all">全体の件数</param>
        /// <param name="done">実行済みの件数</param>
        void notifyProgress(int all, int done);
    }
}


text:
from numpy.distutils.core import setup
from Cython.Build import cythonize

setup(
    ext_modules = cythonize("add_cython.pyx")
)


text:
using EssentialNewsMvc.Web.Controllers;
using EssentialNewsMvc.Web.Features.News;
using EssentialNewsMvc.Web.Features.NewsArticles;
using EssentialNewsMvc.Web.ViewModels.News;
using MediatR;
using Moq;
using NUnit.Framework;
using System.Security.Principal;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;

namespace EssentialNewsMvc.Tests.UnitTests.NewsControllerTests
{
    [TestFixture]
    public class Create_Should
    {
        [Test]
        public void CallMediatorOnGet()
        {
            var mediator = new Mock<IMediator>();
            var sanitizeService = new Mock<Services.Infrastructure.Contracts.ISanitizeService>();
            mediator.Setup(m => m.Send(It.IsAny<CategoriesRegionsQuery>(), It.IsAny<CancellationToken>()));

            var sut = new NewsController(mediator.Object, sanitizeService.Object);
            var result = sut.Create();

            mediator.Verify(x => x.Send(It.IsAny<CategoriesRegionsQuery>(), It.IsAny<CancellationToken>()), Times.Once());
        }

        [Test]
        public async Task Return_View()
        {
            var article = new CreateNewsViewModel();

            var mediator = new Mock<IMediator>();
            var sanitizeService = new Mock<Services.Infrastructure.Contracts.ISanitizeService>();
            mediator.Setup(m => m.Send(It.IsAny<CategoriesRegionsQuery>(), It.IsAny<CancellationToken>()))
                .Returns(Task.FromResult(article));

            var sut = new NewsController(mediator.Object, sanitizeService.Object);
            var result = await sut.Create();

            Assert.That(result, Is.InstanceOf(typeof(ViewResult)));
        }

        [Test]
        public void CallMediatorOnPost()
        {

            var file = new Mock<HttpPostedFileBase>();
            var model = new CreateNewsViewModel()
            {
                Title = "Some Title",
                Content = "Some Content",
                IsTop = true,
                NewsCategoryId = 1,
                RegionId = 1,
                SampleContent = "Some sample content",
                Upload = file.Object,
            };
            var mediator = new Mock<IMediator>();
            var sanitizeService = new Mock<Services.Infrastructure.Contracts.ISanitizeService>();
            mediator.Setup(m => m.Send(It.IsAny<CategoriesRegionsQuery>(), It.IsAny<CancellationToken>()));

            var sut = new NewsController(mediator.Object, sanitizeService.Object);
            var controllerContext = new Mock<ControllerContext>();
            var principal = new Mock<IPrincipal>();
            principal.Setup(p => p.IsInRole("Administrator")).Returns(true);
            principal.SetupGet(x => x.Identity.Name).Returns("Name");
            controllerContext.SetupGet(x => x.HttpContext.User).Returns(principal.Object);
            sut.ControllerContext = controllerContext.Object;

            var result = sut.Create(model);

            mediator.Verify(x => x.Send(It.IsAny<CreateArticleCommand>(), It.IsAny<CancellationToken>()), Times.Once());
        }

        [Test]
        public void Return_ViewOnPost()
        {
            var file = new Mock<HttpPostedFileBase>();
            var model = new CreateNewsViewModel()
            {
                Title = "Some Title",
                Content = "Some Content",
                IsTop = true,
                NewsCategoryId = 1,
                RegionId = 1,
                SampleContent = "Some sample content",
                Upload = file.Object,
            };
            var mediator = new Mock<IMediator>();
            var sanitizeService = new Mock<Services.Infrastructure.Contracts.ISanitizeService>();
            mediator.Setup(m => m.Send(It.IsAny<CategoriesRegionsQuery>(), It.IsAny<CancellationToken>()));

            var sut = new NewsController(mediator.Object, sanitizeService.Object);
            var controllerContext = new Mock<ControllerContext>();
            var principal = new Mock<IPrincipal>();
            principal.Setup(p => p.IsInRole("Administrator")).Returns(true);
            principal.SetupGet(x => x.Identity.Name).Returns("Name");
            controllerContext.SetupGet(x => x.HttpContext.User).Returns(principal.Object);
            sut.ControllerContext = controllerContext.Object;

            var result = sut.Create(model);
            var redirectResult = (RedirectToRouteResult)result;
            Assert.IsTrue(redirectResult.RouteValues.ContainsKey("action"));
            Assert.IsTrue(redirectResult.RouteValues.ContainsKey("controller"));
            Assert.AreEqual("Index", redirectResult.RouteValues["action"].ToString());
            Assert.AreEqual("Home", redirectResult.RouteValues["controller"].ToString());
        }
    }
}


text:
.class public final Landroid/support/fragment/R;
.super Ljava/lang/Object;
.source "R.java"

# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 9
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


text:
local lsp_installer = require("nvim-lsp-installer")
local lspconfig = require("lspconfig")
local theme = require("theme")
local colors = theme.colors
local icons = theme.icons
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local group = vim.api.nvim_create_augroup("LspConfig", {clear = true})

vim.api.nvim_create_autocmd(
  "ColorScheme",
  {
    pattern = "*",
    command = "highlight NormalFloat guibg=" .. colors.bg,
    group = group
  }
)

vim.api.nvim_create_autocmd(
  "ColorScheme",
  {
    pattern = "*",
    command = "highlight FloatBorder guifg=white guibg=" .. colors.bg,
    group = group
  }
)

local border = {
  {"🭽", "FloatBorder"},
  {"▔", "FloatBorder"},
  {"🭾", "FloatBorder"},
  {"▕", "FloatBorder"},
  {"🭿", "FloatBorder"},
  {"▁", "FloatBorder"},
  {"🭼", "FloatBorder"},
  {"▏", "FloatBorder"}
}

local format_async = function(err, _, result, _, bufnr)
  if err ~= nil or result == nil then
    return
  end
  if not vim.api.nvim_buf_get_option(bufnr, "modified") then
    local view = vim.fn.winsaveview()
    vim.lsp.util.apply_text_edits(result, bufnr)
    vim.fn.winrestview(view)
    if bufnr == vim.api.nvim_get_current_buf() then
      vim.api.nvim_command("noautocmd :update")
    end
  end
end

vim.lsp.handlers["textDocument/formatting"] = format_async

local lsp_organize_imports = function()
  local params = {
    command = "_typescript.organizeImports",
    arguments = {vim.api.nvim_buf_get_name(0)},
    title = ""
  }
  vim.lsp.buf.execute_command(params)
end
-- _G makes this function available to vimscript lua calls
_G.lsp_organize_imports = lsp_organize_imports

-- show diagnostic line with custom border and styling
local lsp_show_diagnostics = function()
  vim.diagnostic.open_float({border = border})
end

local on_attach = function(client, bufnr)
  vim.cmd [[command! OR lua lsp_organize_imports()]]
  vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {border = border})
  vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.hover, {border = border})

  local opts = {noremap = true, silent = true}
  vim.keymap.set("n", "<leader>aa", lsp_show_diagnostics, opts)
  vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
  vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
  vim.keymap.set("n", "<leader>aq", vim.diagnostic.setloclist, opts)

  local bufopts = {noremap = true, silent = true, buffer = bufnr}
  vim.keymap.set("n", "gO", lsp_organize_imports, bufopts)
  vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
  vim.keymap.set("n", "gr", vim.lsp.buf.rename, bufopts)
  vim.keymap.set("n", "gR", vim.lsp.buf.references, bufopts)
  vim.keymap.set("n", "gy", vim.lsp.buf.type_definition, bufopts)
  vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
  vim.keymap.set("n", "ga", vim.lsp.buf.code_action, bufopts)
  vim.keymap.set("n", "<C-x><C-x>", vim.lsp.buf.signature_help, bufopts)

  if client.server_capabilities.document_highlight then
    vim.api.nvim_create_autocmd(
      "CursorHold",
      {
        pattern = "*",
        callback = function()
          vim.lsp.buf.document_highlight()
        end,
        group = group
      }
    )
    vim.api.nvim_create_autocmd(
      "CursorMoved",
      {
        pattern = "*",
        callback = function()
          vim.lsp.buf.clear_references()
        end,
        group = group
      }
    )
  end

  -- disable document formatting (currently handled by formatter.nvim)
  client.server_capabilities.document_formatting = false

  if client.server_capabilities.document_formatting then
    vim.api.nvim_create_autocmd(
      "BufEnter",
      {
        pattern = "*",
        callback = function()
          vim.lsp.buf.formatting()
        end,
        group = group
      }
    )
  end
end

local diagnosticls_settings = {
  filetypes = {
    "sh"
  },
  init_options = {
    linters = {
      shellcheck = {
        sourceName = "shellcheck",
        command = "shellcheck",
        debounce = 100,
        args = {"--format=gcc", "-"},
        offsetLine = 0,
        offsetColumn = 0,
        formatLines = 1,
        formatPattern = {
          "^[^:]+:(\\d+):(\\d+):\\s+([^:]+):\\s+(.*)$",
          {line = 1, column = 2, message = 4, security = 3}
        },
        securities = {error = "error", warning = "warning", note = "info"}
      }
    },
    filetypes = {
      sh = "shellcheck"
    }
  }
}

local lua_settings = {
  Lua = {
    runtime = {
      -- LuaJIT in the case of Neovim
      version = "LuaJIT",
      path = vim.split(package.path, ";")
    },
    diagnostics = {
      -- Get the language server to recognize the `vim` global
      globals = {"vim"}
    },
    workspace = {
      -- Make the server aware of Neovim runtime files
      library = {
        [vim.fn.expand("$VIMRUNTIME/lua")] = true,
        [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true
      }
    }
  }
}

local function make_config(callback)
  callback = callback or function(config)
      return config
    end
  local capabilities = vim.lsp.protocol.make_client_capabilities()
  capabilities.textDocument.completion.completionItem.snippetSupport = true
  capabilities.textDocument.completion.completionItem.resolveSupport = {
    properties = {
      "documentation",
      "detail",
      "additionalTextEdits"
    }
  }
  capabilities.textDocument.colorProvider = {dynamicRegistration = false}
  capabilities = cmp_nvim_lsp.default_capabilities(capabilities)

  return callback(
    {
      capabilities = capabilities,
      on_attach = on_attach
    }
  )
end

lsp_installer.setup(
  {
    ensure_installed = {
      "eslint",
      "tsserver",
      "sumneko_lua",
      "denols",
      "vimls"
    },
    automatic_installation = true,
    ui = {
      check_outdated_servers_on_open = true
    }
  }
)

lspconfig.rust_analyzer.setup(
  make_config(
    function(config)
      return config
    end
  )
)

lspconfig.eslint.setup(
  make_config(
    function(config)
      config.filetypes = {"javascript", "javascriptreact", "typescript", "typescriptreact"}
      return config
    end
  )
)

lspconfig.tsserver.setup(
  make_config(
    function(config)
      config.root_dir = lspconfig.util.root_pattern("tsconfig.json")
      config.handlers = {
        ["textDocument/definition"] = function(err, result, ctx, conf)
          -- if there is more than one result, just use the first one
          if #result > 1 then
            result = {result[1]}
          end
          vim.lsp.handlers["textDocument/definition"](err, result, ctx, conf)
        end
      }
      return config
    end
  )
)

lspconfig.denols.setup(
  make_config(
    function(config)
      config.single_file_support = false
      config.root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc")
      config.init_options = {
        lint = true
      }
      return config
    end
  )
)

lspconfig.sumneko_lua.setup(
  make_config(
    function(config)
      config.settings = lua_settings
      config.root_dir = function(fname)
        local util = require("lspconfig/util")
        return util.find_git_ancestor(fname) or util.path.dirname(fname)
      end
      config.root_dir = lspconfig.util.root_pattern("lua.json")
      return config
    end
  )
)

lspconfig.vimls.setup(
  make_config(
    function(config)
      config.init_options = {isNeovim = true}
      return config
    end
  )
)

lspconfig.diagnosticls.setup(
  make_config(
    function(config)
      config.settings = diagnosticls_settings
      return config
    end
  )
)

-- set up custom symbols for LSP errors
local signs = {Error = icons.error, Warning = icons.warning, Warn = icons.warning, Hint = icons.hint, Info = icons.hint}
for type, icon in pairs(signs) do
  local hl = "DiagnosticSign" .. type
  vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl})
end

-- Set colors for completion items
vim.cmd("highlight! CmpItemAbbrMatch guibg=NONE guifg=" .. colors.lightblue)
vim.cmd("highlight! CmpItemAbbrMatchFuzzy guibg=NONE guifg=" .. colors.lightblue)
vim.cmd("highlight! CmpItemKindFunction guibg=NONE guifg=" .. colors.magenta)
vim.cmd("highlight! CmpItemKindMethod guibg=NONE guifg=" .. colors.magenta)
vim.cmd("highlight! CmpItemKindVariable guibg=NONE guifg=" .. colors.blue)
vim.cmd("highlight! CmpItemKindKeyword guibg=NONE guifg=" .. colors.fg)