text:
inline void *operator new(size_t, void *p) { return p; }
inline void *operator new[](size_t, void *p) { return p; }
inline void operator delete(void *, void *) {}
inline void operator delete[](void *, void *) {}

namespace std {

template <class T>
class initializer_list {
 public:
  constexpr initializer_list(const T *b, size_t s) : data_{b}, size_{s} {}
  constexpr size_t size() const { return size_; }
  constexpr T operator[](size_t i) const { return data_[i]; }

  class Iter {
   public:
    constexpr Iter(initializer_list *a, size_t i = 0) : list_{a}, index{i} {}
    void operator++() {
      if (index < list_->size()) {
        index++;
      }
    }
    T *operator*() const { return &(*list_)[index]; }
    bool operator!=(const Iter &other) const {
      return other.list_ != list_ || other.index != index;
    }

   private:
    initializer_list *list_;
    size_t index;
  };

  constexpr Iter begin() { return Iter{this}; }
  constexpr Iter end() { return Iter{this, size()}; }

 private:
  const T *data_;
  size_t size_;
};

template <class T, size_t S>
class array {
 public:
  array() : data_{} {}
  explicit array(initializer_list<T> list) {
    for (size_t i = 0; i < list.size(); i++) {
      data_[i] = list[i];
    }
  }
  constexpr size_t size() const { return S; }
  constexpr bool empty() const { return size() == 0; }
  constexpr T &operator[](size_t i) { return data_[i]; }
  constexpr T *data() { return data_; }
  void fill(const T &v) {
    for (auto &e : *this) {
      e = v;
    }
  }
  void swap(array<T, S> &other) {
    for (size_t i = 0; i < size(); i++) {
      T t = (*this)[i];
      (*this)[i] = other[i];
      other[i] = t;
    }
  }

  class Iter {
   public:
    constexpr Iter(array *a, size_t i = 0) : array_{a}, index{i} {}
    void operator++() {
      if (index < array_->size()) {
        index++;
      }
    }
    T *operator*() const { return &(*array_)[index]; }
    bool operator!=(const Iter &other) const {
      return other.array_ != array_ || other.index != index;
    }

   private:
    array<T, S> *array_;
    size_t index;
  };

  constexpr Iter begin() { return Iter{this}; }
  constexpr Iter end() { return Iter{this, size()}; }

 private:
  T data_[S];
};

template <class... T>
class tuple {
 public:
  explicit tuple(T... types) : list_{types...} {}
  constexpr size_t size() const { return sizeof...(T); }

 private:
  template <class Head, class... Tail>
  class list {
   public:
    list(Head h, Tail... t) : head_{h}, tail_{t...} {}
    constexpr size_t size() const { return sizeof...(Tail) + 1; }
    template <size_t I>
    decltype(auto) get() {
      if (I == 0) {
        return head_;
      } else {
        return tail_.template get<I - 1>();
      }
    }

   private:
    Head head_;
    list<Tail...> tail_;
  };
  template <class Head>
  class list<Head> {
   public:
    explicit list(Head h) : head_{h} {}
    template <size_t I>
    decltype(auto) get() {
      if (I == 0) {
        return head_;
      }
    }

   private:
    Head head_;
  };

  list<T...> list_;

 public:
  template <size_t I>
  decltype(auto) get() {
    return list_.template get<I>();
  }
};

template <class A, class B>
void copy(A dest, B src) {
  auto s = src.begin();
  for (auto &d : dest) {
    d = *s;
    if (s != src.end()) {
      s++;
    } else {
      break;
    }
  }
}

template <class T>
class vector {
 public:
  vector() : capacity_{0} {}
  explicit vector(initializer_list<T> list)
      : capacity_{list.size()},
        size_{list.size()},
        data_{reinterpret_cast<T *>(new uint8_t[list.size() * sizeof(T)])} {
    for (size_t i = 0; i < list.size(); i++) {
      data_[i] = list[i];
    }
  }
  size_t size() const { return size_; }
  bool empty() const { return size() == 0; }
  T &operator[](size_t i) const {
    if (i >= size()) {
      basilisk::term.fatal("index out of bounds of vector");
    }
    return data_[i];
  }
  T *data() const { return data_; }
  void push(T e) {
    if (size_ == capacity_) {
      auto od = data_;
      data_ = reinterpret_cast<T *>(
          new uint8_t[(capacity_ = capacity_ * 2 + 1) * sizeof(T)]);
      for (size_t i = 0; i < size(); i++) {
        data_[i] = od[i];
      }
      delete[] od;
    }
    data_[size_++] = e;
  }
  void pop() {
    if (!empty()) {
      --size_;
    }
    basilisk::term.fatal("can't pop() empty vector");
  }
  T top() const {
    if (!empty()) {
      return data_[size_];
    }
    basilisk::term.fatal("can't top() empty vector");
  }
  void clear() { size_ = 0; }

  class Iter {
   public:
    constexpr Iter(vector *v, size_t i = 0) : vector_{v}, index{i} {}
    void operator++() {
      if (index < vector_->size()) {
        index++;
      }
    }
    T &operator*() const { return (*vector_)[index]; }
    bool operator!=(const Iter &other) const {
      return other.vector_ != vector_ || other.index != index;
    }

   private:
    vector<T> *vector_;
    size_t index;
  };

  constexpr Iter begin() { return Iter{this}; }
  constexpr Iter end() { return Iter{this, size()}; }

 private:
  size_t capacity_, size_ = 0;
  T *data_ = nullptr;
};

template <class K, class V>
class map {
 public:
  explicit map(initializer_list<tuple<K, V>> list) : data_{list} {}
  void insert(K key, V value) { data_.push(tuple<K, V>{key, value}); }
  tuple<K, V> &operator[](K key) {
    for (auto &e : data_) {
      if (e.template get<0>() == key) {
        return e;
      }
    }
    basilisk::term.fatal("unable to find map key");
  }

 private:
  vector<tuple<K, V>> data_;
};

template <class Signature>
class function {
  function(Signature sig) : func_{sig} {}
  template <class Res, class... Args>
  Res operator()(Args... args) {
    return func_(args...);
  }

 private:
  Signature func_;
};

template <class Res, class Class, class... Args>
class function<Res (Class::*)(Args...)> {
 public:
  function(Res (Class::*f)(Args...)) : func_{f} {}
  Res operator()(Class *c, Args... args) { return c.*func_(args...); }
  Res operator()(const Class &c, Args... args) { return c.*func_(args...); }

 private:
  Res (Class::*func_)(Args...);
};

template <class Res, class... Args>
class function<Res(Args...)> {
 public:
  function(Res (*f)(Args...)) : func{f} {}
  Res operator()(Args... args) { return func(args...); }

 private:
  Res (*func)(Args...);
};

}  // namespace std

#endif  // SRC_LIBK_STD_H_


text:
package com.estontorise.plugin;

import com.estontorise.plugin.interfaces.PluginManager;

public class PluginManagerFactory {

	public static PluginManager createPluginManager(String pluginsDir) {
		return new PluginManagerImpl(pluginsDir);
	}

}

redpajama_set_name: RedPajamaGithub


text:
Meteor test application for package `accounts-templates-bootstrap`
==================================================================

See it live [here](http://accounts-templates-bootstrap.meteor.com/)

You might want to have a look at the documentation of package [accounts-templates-bootstrap](https://atmospherejs.com/package/accounts-templates-bootstrap) or at the core package [accounts-templates-core](https://atmospherejs.com/package/accounts-templates-core)


text:
trait Sized { }

// Test that `nounwind` atributes are correctly applied to exported `thiscall` and
// `thiscall-unwind` extern functions. `thiscall-unwind` functions MUST NOT have this attribute. We
// disable optimizations above to prevent LLVM from inferring the attribute.

// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
#[no_mangle]
pub extern "thiscall" fn rust_item_that_cannot_unwind() {
}

// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
#[no_mangle]
pub extern "thiscall-unwind" fn rust_item_that_can_unwind() {
}

// Now, make some assertions that the LLVM attributes for these functions are correct.  First, make
// sure that the first item is correctly marked with the `nounwind` attribute:
//
// CHECK: attributes #0 = { {{.*}}nounwind{{.*}} }
//
// Next, let's assert that the second item, which CAN unwind, does not have this attribute.
//
// CHECK: attributes #1 = {
// CHECK-NOT: nounwind
// CHECK: }


text:
package com.enjoy.love.service;

import org.springframework.beans.factory.annotation.Autowired;

import com.enjoy.love.common.log.CommonLogger;
import com.enjoy.love.common.log.CommonLoggerFactory;

public abstract class AbstractServiceImpl {
	protected final CommonLogger logger = CommonLoggerFactory.getLogger(this
			.getClass());

	@Autowired
	protected ServiceTemplate serviceTemplate;
}


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

namespace AutoRSS.Library.WordProcessor
{
    public class StatementBreaker
    {
        private static char[] s_SeparatorCharacters = new char[] { '.', '?', ':' };

        public string[] BreakParagraph(string paragraph)
        {
            return paragraph.Split(s_SeparatorCharacters, StringSplitOptions.RemoveEmptyEntries);
        }
    }
}


text:
@charset "utf-8";

.message_container {
    overflow: auto;
}

.message_container a {
    color: black;
}

.unread {
    font-weight: bold;
}

.message_container a.button {
    padding: 8px;
    min-width: 90px;
}

.message_container a.button.left {
    float: left;
    width: auto;
    margin: 4px 15px;
}

.message_container input[type="submit"]{
    float: right;
}

#profile_messages .message_right.reply {
    margin-left: 95px;
}

#profile_messages .message_right.reply textarea,
.message_container textarea{
    width: 100%;
    min-height: 200px;
    background-color: #FBFBFB
}

.message_container input[type="text"]{
    width: 100%;
    background-color: #FBFBFB
}

.message_container label{
    float: left;
}

#fenchy_message_new_title, #fenchy_message_new_content {
    font-family: inherit;
}


text:
/**
 * @author alteredq / http://alteredqualia.com/
 * @authod mrdoob / http://mrdoob.com/
 * @authod arodic / http://aleksandarrodic.com/
 * @authod fonserbc / http://fonserbc.github.io/
 *
 * Off-axis stereoscopic effect based on http://paulbourke.net/stereographics/stereorender/
 */

THREE.StereoEffect = function(renderer) {

    // API

    var scope = this;

    this.eyeSeparation = 3;
    this.focalLength = 15; // Distance to the non-parallax or projection plane

    Object.defineProperties(this, {
        separation: {
            get: function() {

                return scope.eyeSeparation;

            },
            set: function(value) {

                console.warn('THREE.StereoEffect: .separation is now .eyeSeparation.');
                scope.eyeSeparation = value;

            }
        },
        targetDistance: {
            get: function() {

                return scope.focalLength;

            },
            set: function(value) {

                console.warn('THREE.StereoEffect: .targetDistance is now .focalLength.');
                scope.focalLength = value;

            }
        }
    });

    // internals

    var _width, _height;

    var _position = new THREE.Vector3();
    var _quaternion = new THREE.Quaternion();
    var _scale = new THREE.Vector3();

    var _cameraL = new THREE.PerspectiveCamera();
    var _cameraR = new THREE.PerspectiveCamera();

    var _fov;
    var _outer, _inner, _top, _bottom;
    var _ndfl, _halfFocalWidth, _halfFocalHeight;
    var _innerFactor, _outerFactor;

    // initialization

    renderer.autoClear = false;

    this.setSize = function(width, height) {

        _width = width / 2;
        _height = height;

        renderer.setSize(width, height);

    };

    this.render = function(scene, camera) {

        scene.updateMatrixWorld();

        if (camera.parent === null) camera.updateMatrixWorld();

        camera.matrixWorld.decompose(_position, _quaternion, _scale);

        // Effective fov of the camera

        _fov = THREE.Math.radToDeg(2 * Math.atan(Math.tan(THREE.Math.degToRad(camera.fov) * 0.5) / camera.zoom));

        _ndfl = camera.near / this.focalLength;
        _halfFocalHeight = Math.tan(THREE.Math.degToRad(_fov) * 0.5) * this.focalLength;
        _halfFocalWidth = _halfFocalHeight * 0.5 * camera.aspect;

        _top = _halfFocalHeight * _ndfl;
        _bottom = -_top;
        _innerFactor = (_halfFocalWidth + this.eyeSeparation / 2.0) / (_halfFocalWidth * 2.0);
        _outerFactor = 1.0 - _innerFactor;

        _outer = _halfFocalWidth * 2.0 * _ndfl * _outerFactor;
        _inner = _halfFocalWidth * 2.0 * _ndfl * _innerFactor;

        // left

        _cameraL.projectionMatrix.makeFrustum(-_outer,
            _inner,
            _bottom,
            _top,
            camera.near,
            camera.far
        );

        _cameraL.position.copy(_position);
        _cameraL.quaternion.copy(_quaternion);
        _cameraL.translateX(-this.eyeSeparation / 2.0);

        // right

        _cameraR.projectionMatrix.makeFrustum(-_inner,
            _outer,
            _bottom,
            _top,
            camera.near,
            camera.far
        );

        _cameraR.position.copy(_position);
        _cameraR.quaternion.copy(_quaternion);
        _cameraR.translateX(this.eyeSeparation / 2.0);

        //

        renderer.clear();
        renderer.enableScissorTest(true);

        renderer.setScissor(0, 0, _width, _height);
        renderer.setViewport(0, 0, _width, _height);
        renderer.render(scene, _cameraL);

        renderer.setScissor(_width, 0, _width, _height);
        renderer.setViewport(_width, 0, _width, _height);
        renderer.render(scene, _cameraR);

        renderer.enableScissorTest(false);

    };

};


text:
pmid: 22203992
layout: default
title: Extensive genetic diversity and substructuring among zebrafish strains revealed through copy number variant analysis.
authors: Brown KH, Dobrinski KP, Lee AS, Gokcumen O, Mills RE, Shi X, Chong WW, Chen JY, Yoo P, David S, Peterson SM, Raj T, Choy KW, Stranger BE, Williamson RE, Zon LI, Freeman JL, Lee C
pubdate: 2012 Jan 10
volume: 109
issue: 2
pages: 529-34
journal: Proc Natl Acad Sci U S A
---


text:
import assert from 'assert';
import {readdir} from 'fs/promises';
import {join} from 'path';
import {describeInstallation} from './describeInstallation.js';
import {readAsset} from './util.js';

describeInstallation(
  '`puppeteer` with Firefox',
  {
    dependencies: ['puppeteer-core', 'puppeteer'],
    env: cwd => {
      return {
        PUPPETEER_CACHE_DIR: join(cwd, '.cache', 'puppeteer'),
        PUPPETEER_PRODUCT: 'firefox',
      };
    },
  },
  ({itEvaluates}) => {
    itEvaluates('CommonJS', {commonjs: true}, async cwd => {
      const files = await readdir(join(cwd, '.cache', 'puppeteer'));
      assert.equal(files.length, 1);
      assert.equal(files[0], 'firefox');

      return readAsset('puppeteer-core', 'requires.cjs');
    });

    itEvaluates('ES modules', async () => {
      return readAsset('puppeteer-core', 'imports.js');
    });
  }
);


text:
package com.google.api.generator.engine.lexicon;

import com.google.common.collect.ImmutableList;

public class Keyword {
  // This is a valid field for all objects, so handle particular keyword differently.
  private static final String CLASS_KEYWORD = "class";

  private static final ImmutableList<String> KEYWORDS =
      ImmutableList.of(
          "abstract",
          "continue",
          "for",
          "new",
          "switch",
          "assert",
          "default",
          "if",
          "package",
          "synchronized",
          "boolean",
          "do",
          "goto",
          "private",
          "this",
          "break",
          "double",
          "implements",
          "protected",
          "throw",
          "byte",
          "else",
          "import",
          "public",
          "throws",
          "case",
          "enum",
          "instanceof",
          "return",
          "transient",
          "catch",
          "extends",
          "int",
          "short",
          "try",
          "char",
          "final",
          "interface",
          "static",
          "void",
          "finally",
          "long",
          "strictfp",
          "volatile",
          "const",
          "float",
          "native",
          "super",
          "while");

  public static boolean isKeyword(String s) {
    return s.equals(CLASS_KEYWORD) || KEYWORDS.contains(s);
  }

  public static boolean isInvalidFieldName(String s) {
    return KEYWORDS.contains(s);
  }
}


text:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.helloworld" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
    <preference name="loglevel" value="DEBUG" />
    <feature name="Battery">
        <param name="android-package" value="org.apache.cordova.batterystatus.BatteryListener" />
    </feature>
    <feature name="Camera">
        <param name="android-package" value="org.apache.cordova.camera.CameraLauncher" />
    </feature>
    <feature name="Contacts">
        <param name="android-package" value="org.apache.cordova.contacts.ContactManager" />
    </feature>
    <feature name="Device">
        <param name="android-package" value="org.apache.cordova.device.Device" />
    </feature>
    <feature name="Accelerometer">
        <param name="android-package" value="org.apache.cordova.devicemotion.AccelListener" />
    </feature>
    <feature name="Compass">
        <param name="android-package" value="org.apache.cordova.deviceorientation.CompassListener" />
    </feature>
    <feature name="Notification">
        <param name="android-package" value="org.apache.cordova.dialogs.Notification" />
    </feature>
    <feature name="File">
        <param name="android-package" value="org.apache.cordova.file.FileUtils" />
        <param name="onload" value="true" />
    </feature>
    <feature name="FileTransfer">
        <param name="android-package" value="org.apache.cordova.filetransfer.FileTransfer" />
    </feature>
    <feature name="Geolocation">
        <param name="android-package" value="org.apache.cordova.geolocation.Geolocation" />
    </feature>
    <feature name="Globalization">
        <param name="android-package" value="org.apache.cordova.globalization.Globalization" />
    </feature>
    <feature name="InAppBrowser">
        <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" />
    </feature>
    <feature name="Media">
        <param name="android-package" value="org.apache.cordova.media.AudioHandler" />
    </feature>
    <feature name="Capture">
        <param name="android-package" value="org.apache.cordova.mediacapture.Capture" />
    </feature>
    <feature name="NetworkStatus">
        <param name="android-package" value="org.apache.cordova.networkinformation.NetworkManager" />
    </feature>
    <feature name="SplashScreen">
        <param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" />
        <param name="onload" value="true" />
    </feature>
    <feature name="StatusBar">
        <param name="android-package" value="org.apache.cordova.statusbar.StatusBar" />
        <param name="onload" value="true" />
    </feature>
    <feature name="Vibration">
        <param name="android-package" value="org.apache.cordova.vibration.Vibration" />
    </feature>
    <feature name="Whitelist">
        <param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
        <param name="onload" value="true" />
    </feature>
    <feature name="LocalNotification">
        <param name="android-package" value="de.appplant.cordova.plugin.localnotification.LocalNotification" />
    </feature>
    <icon density="ldpi" src="www/res/icon/android/icon.png" />
    <icon density="mdpi" src="www/res/icon/android/icon.png" />
    <icon density="hdpi" src="www/res/icon/android/icon.png" />
    <icon density="xhdpi" src="www/res/icon/android/icon.png" />
    <icon density="xxhdpi" src="www/res/icon/android/icon.png" />
    <icon density="xxxhdpi" src="www/res/icon/android/icon.png" />
    <splash density="land-ldpi" src="www/res/screen/android/drawable-land-ldpi-screen.png" />
    <splash density="land-mdpi" src="www/res/screen/android/drawable-land-mdpi-screen.png" />
    <splash density="land-hdpi" src="www/res/screen/android/drawable-land-hdpi-screen.png" />
    <splash density="land-xhdpi" src="www/res/screen/android/drawable-land-xhdpi-screen.png" />
    <splash density="land-xxhdpi" src="www/res/screen/android/drawable-land-xxhdpi-screen.png" />
    <splash density="land-xxxhdpi" src="www/res/screen/android/drawable-land-xxxhdpi-screen.png" />
    <splash density="port-ldpi" src="www/res/screen/android/drawable-port-ldpi-screen.png" />
    <splash density="port-mdpi" src="www/res/screen/android/drawable-port-mdpi-screen.png" />
    <splash density="port-hdpi" src="www/res/screen/android/drawable-port-hdpi-screen.png" />
    <splash density="port-xhdpi" src="www/res/screen/android/drawable-port-xhdpi-screen.png" />
    <splash density="port-xxhdpi" src="www/res/screen/android/drawable-port-xxhdpi-screen.png" />
    <splash density="port-xxxhdpi" src="www/res/screen/android/drawable-port-xxxhdpi-screen.png" />
    <allow-intent href="market:*" />
    <name>Mooona</name>
    <description>
        Aplicación para ciclos menstruales
    </description>
    <author email="support@phonegap.com" href="http://phonegap.com">
        Cantera Estudio
    </author>
    <content src="index.html" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="fullscreen" value="false" />
    <preference name="android-minSdkVersion" value="14" />
    <preference name="KeyboardShrinksView" value="false" />
    <preference name="HideKeyboardFormAccessoryBar" value="true" />
    <preference name="orientation" value="portrait" />
    <icon src="icon.png" />
    <access origin="*" />
    <access origin="http://localhost" />
    <access origin="http://canteraestudio.com" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
</widget>


text:
package org.cohorte.herald;

/**
 * Specification of an handler of replies to a posted message
 *
 * @author Thomas Calmant
 */
public interface IPostCallback {

    /**
     * The reply to a message has been received
     *
     * @param aHerald
     *            Herald service which caught the message
     * @param aReply
     *            Received reply
     */
    void heraldCallback(IHerald aHerald, MessageReceived aReply);
}


text:
<?php

abstract class FileSystemTest extends PHPUnit_Framework_TestCase
{

	protected $path = __DIR__ . '/temp';

    protected function createTempFolder()
    {
        mkdir($this->path, 0700, true);
    }

    protected function removeTempFolder()
    {
        if (file_exists($this->path)) {
            array_map('unlink', glob($this->path . '/' . '{,.}[!.,!..]*',GLOB_MARK|GLOB_BRACE));
            rmdir($this->path);
        }
    }

    public function setup()
    {
    	parent::setup();
        $this->removeTempFolder();
        $this->createTempFolder();
    }

    public function teardown()
    {
    	parent::teardown();
        $this->removeTempFolder();
    }
}


text:
namespace bluez {

// FakeBluetoothProfileServiceProvider simulates the behavior of a local
// Bluetooth agent object and is used both in test cases in place of a
// mock and on the Linux desktop.
//
// This class is only called from the dbus origin thread and is not thread-safe.
class DEVICE_BLUETOOTH_EXPORT FakeBluetoothProfileServiceProvider
    : public BluetoothProfileServiceProvider {
 public:
  FakeBluetoothProfileServiceProvider(const dbus::ObjectPath& object_path,
                                      Delegate* delegate);
  ~FakeBluetoothProfileServiceProvider() override;

  // Each of these calls the equivalent
  // BluetoothProfileServiceProvider::Delegate method on the object passed on
  // construction.
  void Released();
  void NewConnection(const dbus::ObjectPath& device_path,
                     std::unique_ptr<dbus::FileDescriptor> fd,
                     const Delegate::Options& options,
                     const Delegate::ConfirmationCallback& callback);
  void RequestDisconnection(const dbus::ObjectPath& device_path,
                            const Delegate::ConfirmationCallback& callback);
  void Cancel();

  const dbus::ObjectPath& object_path() const { return object_path_; }

 private:
  friend class FakeBluetoothProfileManagerClient;

  // D-Bus object path we are faking.
  dbus::ObjectPath object_path_;

  // All incoming method calls are passed on to the Delegate and a callback
  // passed to generate the reply. |delegate_| is generally the object that
  // owns this one, and must outlive it.
  Delegate* delegate_;

  DISALLOW_COPY_AND_ASSIGN(FakeBluetoothProfileServiceProvider);
};

}  // namespace bluez

#endif  // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_


text:
=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute

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

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

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

=cut

package EnsEMBL::Web::Component::Help::ListMappings;

use strict;

use base qw(EnsEMBL::Web::Component::Help);

sub _init {
  my $self = shift;
  $self->cacheable(1);
  $self->ajaxable(0);
  $self->configurable(0);
}

sub content {
  my $self           = shift;
  my $hub            = $self->hub;
  my $species        = $hub->species;
  my $location       = $self->builder->object('Location');
  return unless $location;
  my $chromosome     = $location->seq_region_name;
  my $ensembl_start  = $location->seq_region_start;
  my $current_assembly  = $hub->species_defs->ASSEMBLY_VERSION;
  my $alt_assembly      = $hub->param('alt_assembly');
  my $alt_assemblies    = $hub->species_defs->ASSEMBLY_MAPPINGS || [];
  my $referer           = $hub->referer;
  my ($html, $table);

  # get coordinates of other assembly
  if ($alt_assembly && scalar(@$alt_assemblies)) {
    $html .= '<input type="hidden" class="panel_type" value="Content" />
Coordinate mappings
';
    if (my @mappings = @{$hub->species_defs->get_config($hub->species, 'ASSEMBLY_MAPPINGS')||[]}) {

      my $mapping;
      foreach (@mappings) {
        $mapping = $_;
        last if $mapping eq sprintf('chromosome:%s#chromosome:%s', $current_assembly, $alt_assembly);
      }
      if ($mapping) {

        my $segments = $location->slice->project('chromosome', $alt_assembly);

        if (scalar @$segments) {

          $table = $self->new_table([], [], { data_table => 1, sorting => [ 'ensemblcoordinates asc' ] });

          $table->add_columns(
            { key => 'coords', title => "$current_assembly coordinates", align => 'left', sort => 'position'},
            { key => 'length',             title => 'Length', align => 'left', sort => 'numeric'},
            { key => 'target',  title => "$alt_assembly coordinates",  align => 'left', sort => 'position_html'}
          );

          my $base_url  = '//'.$hub->species_defs->SWITCH_ARCHIVE_URL;
          my $title     = 'Go to '.$hub->species_defs->SWITCH_ARCHIVE_URL;

          foreach my $segment (@$segments) {
            my $s          = $segment->from_start + $ensembl_start - 1;
            my $slice      = $segment->to_Slice;
            my $mapped_url = "$base_url/$species/Location/View?r=" . $slice->seq_region_name. ':' . $slice->start. '-'.  $slice->end;
	          my $match_txt  = $slice->seq_region_name . ':' . $hub->thousandify($slice->start) . '-' . $hub->thousandify($slice->end);

	          $table->add_row({
              coords => "$chromosome:$s-" . ($slice->length + $s - 1),
		          length => $slice->length,
		          target => qq{$match_txt}
            });
          }
        }
      }
    }
  }
  if ($table) {
    $html .= $table->render;
  }
  else {
    $html .= '
No mappings in this region - please try another location.
';
  }
  return $html;
}

1;


text:
using WebKit::WebFrame;
using WebKit::WebSecurityOrigin;
using WebKit::WebURL;
using content::RenderThread;

namespace {

// A map of event names to the number of listeners for that event. We notify
// the browser about event listeners when we transition between 0 and 1.
typedef std::map<std::string, int> EventListenerCounts;

struct SingletonData {
  // A map of extension IDs to listener counts for that extension.
  std::map<std::string, EventListenerCounts> listener_counts_;
};

static base::LazyInstance<SingletonData> g_singleton_data =
    LAZY_INSTANCE_INITIALIZER;

static EventListenerCounts& GetListenerCounts(const std::string& extension_id) {
  return g_singleton_data.Get().listener_counts_[extension_id];
}

class ExtensionImpl : public ChromeV8Extension {
 public:
  explicit ExtensionImpl(ExtensionDispatcher* dispatcher)
      : ChromeV8Extension("extensions/event.js",
                          IDR_EVENT_BINDINGS_JS,
                          dispatcher) {
  }
  ~ExtensionImpl() {}

  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
      v8::Handle<v8::String> name) {
    if (name->Equals(v8::String::New("AttachEvent"))) {
      return v8::FunctionTemplate::New(AttachEvent, v8::External::New(this));
    } else if (name->Equals(v8::String::New("DetachEvent"))) {
      return v8::FunctionTemplate::New(DetachEvent, v8::External::New(this));
    }
    return ChromeV8Extension::GetNativeFunction(name);
  }

  // Attach an event name to an object.
  static v8::Handle<v8::Value> AttachEvent(const v8::Arguments& args) {
    DCHECK(args.Length() == 1);
    // TODO(erikkay) should enforce that event name is a string in the bindings
    DCHECK(args[0]->IsString() || args[0]->IsUndefined());

    if (args[0]->IsString()) {
      ExtensionImpl* v8_extension = GetFromArguments<ExtensionImpl>(args);
      const ChromeV8ContextSet& context_set =
          v8_extension->extension_dispatcher()->v8_context_set();
      ChromeV8Context* context = context_set.GetCurrent();
      CHECK(context);
      EventListenerCounts& listener_counts =
          GetListenerCounts(context->extension_id());
      std::string event_name(*v8::String::AsciiValue(args[0]));

      if (!v8_extension->CheckCurrentContextAccessToExtensionAPI(event_name))
        return v8::Undefined();

      if (++listener_counts[event_name] == 1) {
        content::RenderThread::Get()->Send(
            new ExtensionHostMsg_AddListener(context->extension_id(),
                                             event_name));
      }
    }

    return v8::Undefined();
  }

  static v8::Handle<v8::Value> DetachEvent(const v8::Arguments& args) {
    DCHECK(args.Length() == 1);
    // TODO(erikkay) should enforce that event name is a string in the bindings
    DCHECK(args[0]->IsString() || args[0]->IsUndefined());

    if (args[0]->IsString()) {
      ExtensionImpl* v8_extension = GetFromArguments<ExtensionImpl>(args);
      const ChromeV8ContextSet& context_set =
          v8_extension->extension_dispatcher()->v8_context_set();
      ChromeV8Context* context = context_set.GetCurrent();
      if (!context)
        return v8::Undefined();

      EventListenerCounts& listener_counts =
          GetListenerCounts(context->extension_id());
      std::string event_name(*v8::String::AsciiValue(args[0]));
      if (--listener_counts[event_name] == 0) {
        content::RenderThread::Get()->Send(
            new ExtensionHostMsg_RemoveListener(context->extension_id(),
                                                event_name));
      }
    }

    return v8::Undefined();
  }
};

}  // namespace

v8::Extension* EventBindings::Get(ExtensionDispatcher* dispatcher) {
  static v8::Extension* extension = new ExtensionImpl(dispatcher);
  return extension;
}


text:
/**
 * Note: not every method tested. Have to finish.
 * TODO: use mock-fs or similar package to mimic fs: https://www.npmjs.org/package/mock-fs
 */

var qfs = require('../../qfs');
var playground = "test/data/";

describe("Wrapper for core fs method", function () {
	var originalTimeout;
	beforeEach(function () {
		// extending test time to 10s
		originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
		jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
	});

	//test for qfs.open
	describe("qfs.open", function () {
		it("should return error if file don't exists", function (done) {
			qfs.open(playground + 'file-dont-exist.txt', 'r', 0666)
				.fail(function (error) {
					expect(typeof error).toBe('object');
					done();
				});
		});
		it("should create file & return file descriptor if file in provided path don't exists", function (done) {
			qfs.open(playground + 'file-exist.txt', 'a+', 0666)
				.then(function (file_descriptor) {
					expect(typeof file_descriptor).toBe('number');
					qfs.close(file_descriptor)
						.then(function () {
							done();
						});
				});
		});
	});

	//test for qfs.rename
	describe("qfs.rename", function () {
		it("should rename file", function (done) {
			qfs.open(playground + 'test.txt', 'a+', 0666)
				.then(function (file_descriptor) {
					qfs.rename(playground + 'test.txt', playground + 'rename-test.txt')
						.then(function (result) {
							qfs.close(file_descriptor)
								.then(function () {
									qfs.exists(playground + 'rename-test.txt')
										.then(function (result) {
											expect(result).toBe(true);
											done();
										});
								});
						});
				});
		});
		it("should return error if source file dont exists", function (done) {
			qfs.rename(playground + 'file-dont-exist.txt', playground + 'file-dont-exist2.txt')
				.fail(function (error) {
					expect(typeof error).toBe('object');
					done();
				});
		});
	});

	//test for qfs.rename
	describe("qfs.rename", function () {
		it("should rename file", function (done) {
			qfs.open(playground + 'test.txt', 'a+', 0666)
				.then(function (file_descriptor) {
					qfs.rename(playground + 'test.txt', playground + 'rename-test.txt')
						.then(function (result) {
							qfs.close(file_descriptor)
								.then(function () {
									qfs.exists(playground + 'rename-test.txt')
										.then(function (result) {
											expect(result).toBe(true);
											done();
										});
								});
						});
				});
		});
		it("should return error if source file dont exists", function (done) {
			qfs.rename(playground + 'file-dont-exist.txt', playground + 'file-dont-exist-2.txt')
				.fail(function (error) {
					expect(typeof error).toBe('object');
					done();
				});
		});
	});

	//test for qfs.stat
	describe("qfs.stat", function () {
		it("should return object of type fs.Stats", function (done) {
			qfs.stat(playground + 'rename-test.txt')
				.then(function (result) {
					expect(typeof result).toBe('object');
					done();
				});
		});
		it("should return error if file dont exists", function (done) {
			qfs.stat(playground + 'file-dont-exist.txt')
				.fail(function (error) {
					expect(typeof error).toBe('object');
					done();
				});
		});
	});

	//test for qfs.lstat
	describe("qfs.lstat", function () {
		it("should return object of type fs.Stats", function (done) {
			qfs.lstat(playground + 'rename-test.txt')
				.then(function (result) {
					expect(typeof result).toBe('object');
					done();
				});
		});
		it("should return error if file dont exists", function (done) {
			qfs.lstat(playground + 'file-dont-exist.txt')
				.fail(function (error) {
					expect(typeof error).toBe('object');
					done();
				});
		});
	});

	//test for qfs.fstat
	describe("qfs.fstat", function () {
		it("should return object of type fs.Stats", function (done) {
			qfs.open(playground + 'rename-test.txt', 'r', 0666)
				.then(function (file_descriptor) {
					qfs.fstat(file_descriptor)
						.then(function (result) {
							expect(typeof result).toBe('object');
							qfs.close(file_descriptor)
								.then(function () {
									done();
								})
						});
				});
		});
	});

	//test for qfs.realpath
	describe("qfs.realpath", function () {
		it("should return resolved path", function (done) {
			qfs.realpath(playground + 'rename-test.txt')
				.then(function (result) {
					expect(typeof result).toBe('string');
					done();
				});
		});
		it("should return error wheyn file not exists", function (done) {
			qfs.realpath(playground + 'file-dont-exist.txt')
				.fail(function (err) {
					expect(typeof err).toBe('object');
					done();
				});
		});
	});

	//test for qfs.exists
	describe("qfs.exists", function () {
		it("should return true if file exists", function (done) {
			qfs.exists(playground + 'file-exist.txt')
				.then(function (result) {
					expect(result)
						.toBe(true);
					done();
				});
		});
		it("should return false if file doesn't exists", function (done) {
			qfs.exists(playground + 'file-dont-exist.txt')
				.then(function (result) {
					expect(result).toBe(false);
					done();
				});
		});
	});

	//test for qfs.mkdir
	describe("qfs.mkdir", function () {
		it("should create dir", function (done) {
			qfs.mkdir(playground + 'dir-test')
				.then(function (result) {
					qfs.exists(playground + 'dir-test')
						.then(function (result) {
							expect(result).toBe(true);
							done();
						});
				});
		});
	});

	//test for qfs.readdir
	describe("qfs.readdir", function () {
		it("should return array of file names", function (done) {
			qfs.open(playground + 'dir-test/' + 'file-1.txt', 'a+', 0666)
				.then(function (result) {
					qfs.readdir(playground + 'dir-test/')
						.then(function (result) {
							expect(result instanceof Array).toBe(true);
							expect(result.length).toEqual(1);
							done();
						});
				});
		});
	});

	//test for qfs.unlink
	describe("qfs.unlink", function () {
		it("should remove file if exists", function (done) {
			qfs.unlink(playground + 'dir-test/file-1.txt')
				.then(function (result) {
					qfs.exists(playground + 'dir-test/file-1.txt')
						.then(function (result) {
							expect(result).toBe(false);
							done();
						});
				});
		});
	});

	//test for qfs.rmdir
	describe("qfs.rmdir", function () {
		it("should remove dir if exists", function (done) {
			qfs.rmdir(playground + 'dir-test')
				.then(function (result) {
					qfs.exists(playground + 'dir-test')
						.then(function (result) {
							expect(result).toBe(false);
							done();
						});
				});
		});
	});

	//test for qfs.write
	describe("qfs.write", function () {
		var string = 'The quick brown fox jumps over the lazy dog';
		var buffer = new Buffer(string, 'utf8');
		var buffer_size = Buffer.byteLength(string, 'utf8');
		it("should write data to file", function (done) {
			qfs.open(playground + 'write-test.txt', 'w+', 0666)
				.then(function (file_descriptor) {
					qfs.write(file_descriptor, buffer, 0, buffer_size)
						.then(function (result) {
							expect(result.written).toEqual(buffer_size);
							qfs.close(file_descriptor)
								.then(function () {
									qfs.stat(playground + 'write-test.txt')
										.then(function (stat) {
											expect(stat.size).toEqual(buffer_size);
											done();
										});
								});
						});
				});
		});
	});

	//test for qfs.read
	describe("qfs.read", function () {
		var string = 'The quick brown fox jumps over the lazy dog';
		it("should read data from file", function (done) {
			qfs.open(playground + 'write-test.txt', 'r', 0666)
				.then(function (file_descriptor) {
					qfs.fstat(file_descriptor)
						.then(function (stat) {
							var buffer_size = stat.size;
							qfs.read(file_descriptor, new Buffer(buffer_size), 0, buffer_size)
								.then(function (result) {
									expect(result.buffer.toString('utf8')).toEqual(string);
									done();
									qfs.close(file_descriptor)
										.then(function () {
											qfs.stat(playground + 'write-test.txt')
												.then(function (stat) {
													expect(stat.size).toEqual(buffer_size);
													done();
												});
										});
								})
						});
				});
		});
	});

	//test for qfs.readFile
	describe("qfs.readFile", function () {
		var string = 'The quick brown fox jumps over the lazy dog';
		it("should read data from file", function (done) {
			qfs.readFile(playground + 'write-test.txt', {
				encoding: 'utf8'
			})
				.then(function (result) {
					expect(result).toEqual(string);
					done();
				});
		});
	});

	//test for qfs.writeFile
	describe("qfs.writeFile", function () {
		var string = 'Lazy dog tried to catch quick brown fox but failed.';
		it("should write data to file", function (done) {
			qfs.writeFile(playground + 'write-test.txt', string, {
				encoding: 'utf8'
			})
				.then(function (result) {
					qfs.readFile(playground + 'write-test.txt', {
						encoding: 'utf8'
					})
						.then(function (result) {
							expect(result).toEqual(string);
							done();
						});
				});
		});
	});

	//test for qfs.appendFile
	describe("qfs.appendFile", function () {
		var string = 'Lazy dog tried to catch quick brown fox but failed.',
			addition = ' Next time he will use jetpack!';
		it("should write data to file", function (done) {
			qfs.appendFile(playground + 'write-test.txt', addition, {
				encoding: 'utf8'
			})
				.then(function (result) {
					qfs.readFile(playground + 'write-test.txt', {
						encoding: 'utf8'
					})
						.then(function (result) {
							expect(result).toEqual(string + addition);
							done();
						});
				});
		});
	});

	//test for qfs.watchFile
	describe("qfs.watchFile", function () {
		var string = ' Or maybe not!';
		it("should notify about file change", function (done) {
			qfs.watchFile(playground + 'write-test.txt')
				.progress(function (result) {
					expect(typeof result).toBe('object');
					expect(typeof result.current).toBe('object');
					expect(typeof result.previous).toBe('object');
					qfs.unwatchFile(playground + 'write-test.txt');
					done();
				});
			qfs.appendFile(playground + 'write-test.txt', string);
		});
	});

	//test for qfs.watch
	describe("qfs.watch", function () {
		var string = ' Who knows?!';
		it("should notify about file change", function (done) {
			var watcher = qfs.watch(playground);
			watcher.promise.progress(function (result) {
					expect(result).toEqual('write-test.txt');
					watcher.handler.close();
					done();
				});
			qfs.appendFile(playground + 'write-test.txt', string);
		});
	});

	afterEach(function () {
		jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
	});
});


text:
package net.savantly.sprout.domain.issue.comment;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import net.savantly.sprout.core.tenancy.TenantKeyedEntity;

@Entity
@Table(name = "ISSUE_COMMENTS")
@Getter
@Setter
@Accessors(chain = true)
public class IssueComment extends TenantKeyedEntity  {

	private String issueId;

	@Column(name="text", length = 5000)
	private String text;
}


text:
package org.apache.geode.internal.cache.execute;

import org.apache.logging.log4j.Logger;

import org.apache.geode.cache.execute.Function;
import org.apache.geode.cache.execute.FunctionException;
import org.apache.geode.cache.execute.ResultCollector;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.DistributionManager;
import org.apache.geode.internal.cache.ForceReattemptException;
import org.apache.geode.internal.cache.PartitionedRegion;
import org.apache.geode.internal.cache.execute.metrics.FunctionStatsManager;
import org.apache.geode.internal.cache.partitioned.PartitionedRegionFunctionStreamingMessage;
import org.apache.geode.internal.serialization.Version;
import org.apache.geode.logging.internal.log4j.api.LogService;

/**
 * ResultSender needs ResultCollector in which to add results one by one. In case of localExecution
 * it just adds result to the resultCollector whereas for remote cases it takes help of
 * PRFunctionExecutionStreamer to send results to the calling node. The results will be received in
 * the ResultReceiver. ResultSender will be instantiated in executeOnDatastore and set in
 * FunctionContext.
 *
 */

public class PartitionedRegionFunctionResultSender implements InternalResultSender {

  private static final Logger logger = LogService.getLogger();

  PartitionedRegionFunctionStreamingMessage msg = null;

  private final DistributionManager dm;

  private final PartitionedRegion pr;

  private final long time;

  private final boolean forwardExceptions;

  private ResultCollector rc;

  private ServerToClientFunctionResultSender serverSender;

  private boolean localLastResultReceived = false;

  private boolean onlyLocal = false;

  private boolean onlyRemote = false;

  private boolean completelyDoneFromRemote = false;

  private final Function function;

  private boolean enableOrderedResultStreming;

  private int[] bucketArray;

  private BucketMovedException bme;

  public Version getClientVersion() {
    if (serverSender != null && serverSender.sc != null) { // is a client-server connection
      return serverSender.sc.getClientVersion();
    }
    return null;
  }

  /**
   * Have to combine next two constructor in one and make a new class which will send Results back.
   *
   */
  public PartitionedRegionFunctionResultSender(DistributionManager dm, PartitionedRegion pr,
      long time, PartitionedRegionFunctionStreamingMessage msg, Function function,
      int[] bucketArray) {
    this.msg = msg;
    this.dm = dm;
    this.pr = pr;
    this.time = time;
    this.function = function;
    this.bucketArray = bucketArray;

    forwardExceptions = false;
  }

  /**
   * Have to combine next two constructor in one and make a new class which will send Results back.
   *
   */
  public PartitionedRegionFunctionResultSender(DistributionManager dm,
      PartitionedRegion partitionedRegion, long time, ResultCollector rc,
      ServerToClientFunctionResultSender sender, boolean onlyLocal, boolean onlyRemote,
      boolean forwardExceptions, Function function, int[] bucketArray) {
    this.dm = dm;
    this.pr = partitionedRegion;
    this.time = time;
    this.rc = rc;
    this.serverSender = sender;
    this.onlyLocal = onlyLocal;
    this.onlyRemote = onlyRemote;
    this.forwardExceptions = forwardExceptions;
    this.function = function;
    this.bucketArray = bucketArray;
  }

  private void checkForBucketMovement(Object oneResult) {
    if (!(forwardExceptions && oneResult instanceof Throwable)
        && !pr.getDataStore().areAllBucketsHosted(bucketArray)) {
      // making sure that we send all the local results first
      // before sending this exception to client
      bme = new BucketMovedException(
          "Bucket migrated to another node. Please retry.");
      if (function.isHA()) {
        throw bme;
      }
    }

  }

  // this must be getting called directly from function
  @Override
  public void lastResult(Object oneResult) {
    if (!this.function.hasResult()) {
      throw new IllegalStateException(
          String.format("Cannot %s result as the Function#hasResult() is false",
              "send"));
    }
    // this could be done before doing end result
    // so that client receives all the results before

    if (this.serverSender != null) { // Client-Server
      if (this.localLastResultReceived) {
        return;
      }
      if (onlyLocal) {
        checkForBucketMovement(oneResult);
        if (bme != null) {
          clientSend(oneResult, dm.getDistributionManagerId());
          lastClientSend(dm.getDistributionManagerId(), bme);
        } else {
          lastClientSend(dm.getDistributionManagerId(), oneResult);
        }
        this.rc.endResults();
        this.localLastResultReceived = true;

      } else {
        // call a synchronized method as local node is also waiting to send lastResult
        lastResult(oneResult, rc, false, true, dm.getDistributionManagerId());
      }
    } else { // P2P

      if (this.msg != null) {
        checkForBucketMovement(oneResult);
        try {
          if (this.bme != null) {
            this.msg.sendReplyForOneResult(dm, pr, time, oneResult, false,
                enableOrderedResultStreming);
            throw bme;
          } else {
            this.msg.sendReplyForOneResult(dm, pr, time, oneResult, true,
                enableOrderedResultStreming);
          }

        } catch (ForceReattemptException e) {
          throw new FunctionException(e);
        } catch (InterruptedException e) {
          throw new FunctionException(e);
        }
      } else {
        if (this.localLastResultReceived) {
          return;
        }
        if (onlyLocal) {
          checkForBucketMovement(oneResult);
          if (bme != null) {
            this.rc.addResult(dm.getDistributionManagerId(), oneResult);
            this.rc.addResult(dm.getDistributionManagerId(), bme);
          } else {
            this.rc.addResult(dm.getDistributionManagerId(), oneResult);
          }
          // exception thrown will do end result
          this.rc.endResults();
          this.localLastResultReceived = true;
        } else {
          // call a synchronized method as local node is also waiting to send lastResult
          lastResult(oneResult, rc, false, true, dm.getDistributionManagerId());
        }
        FunctionStatsManager.getFunctionStats(function.getId(), this.dm.getSystem())
            .incResultsReceived();
      }
      // incrementing result sent stats.
      // Bug : remote node as well as local node calls this method to send
      // the result When the remote nodes are added to the local result collector at that
      // time the stats for the result sent is again incremented : Once the PR team comes with the
      // concept of the Streaming FunctionOperation
      // for the partitioned Region then it will be simple to fix this problem.
      FunctionStatsManager.getFunctionStats(function.getId(), this.dm.getSystem())
          .incResultsReturned();
    }
  }

  private synchronized void lastResult(Object oneResult, ResultCollector collector,
      boolean lastRemoteResult, boolean lastLocalResult, DistributedMember memberID) {

    boolean completedLocal = lastLocalResult || this.localLastResultReceived;
    if (lastRemoteResult) {
      this.completelyDoneFromRemote = true;
    }

    if (this.serverSender != null) { // Client-Server
      if (this.completelyDoneFromRemote && completedLocal) {
        if (lastLocalResult) {
          checkForBucketMovement(oneResult);
          if (bme != null) {
            clientSend(oneResult, dm.getDistributionManagerId());
            lastClientSend(dm.getDistributionManagerId(), bme);
          } else {
            lastClientSend(memberID, oneResult);
          }
        } else {
          lastClientSend(memberID, oneResult);
        }

        collector.endResults();
      } else {
        if (lastLocalResult) {
          checkForBucketMovement(oneResult);
          if (bme != null) {
            clientSend(oneResult, memberID);
            clientSend(bme, memberID);
          } else {
            clientSend(oneResult, memberID);
          }
        } else {
          clientSend(oneResult, memberID);
        }

      }
    } else { // P2P
      if (this.completelyDoneFromRemote && completedLocal) {
        if (lastLocalResult) {
          checkForBucketMovement(oneResult);
          if (bme != null) {
            collector.addResult(memberID, oneResult);
            collector.addResult(memberID, bme);
          } else {
            collector.addResult(memberID, oneResult);
          }
        } else {
          collector.addResult(memberID, oneResult);
        }
        collector.endResults();
      } else {
        if (lastLocalResult) {
          checkForBucketMovement(oneResult);
          if (bme != null) {
            collector.addResult(memberID, oneResult);
            collector.addResult(memberID, bme);
          } else {
            collector.addResult(memberID, oneResult);
          }
        } else {
          collector.addResult(memberID, oneResult);
        }
      }
    }
    if (lastLocalResult) {
      this.localLastResultReceived = true;
    }
  }

  public synchronized void lastResult(Object oneResult, boolean completelyDoneFromRemote,
      ResultCollector reply, DistributedMember memberID) {
    logger.debug("PartitionedRegionFunctionResultSender Sending lastResult {}", oneResult);

    if (this.serverSender != null) { // Client-Server

      if (completelyDoneFromRemote) {
        if (this.onlyRemote) {
          lastClientSend(memberID, oneResult);
          reply.endResults();
        } else {
          // call a synchronized method as local node is also waiting to send lastResult
          lastResult(oneResult, reply, true, false, memberID);
        }
      } else {
        clientSend(oneResult, memberID);
      }
    } else {
      if (completelyDoneFromRemote) {
        if (this.onlyRemote) {
          reply.addResult(memberID, oneResult);
          reply.endResults();
        } else {
          // call a synchronized method as local node is also waiting to send lastResult
          lastResult(oneResult, reply, true, false, memberID);
        }
      } else {
        reply.addResult(memberID, oneResult);
      }
      if (this.dm == null) {
        FunctionStatsManager.getFunctionStats(function.getId()).incResultsReceived();
      } else {
        FunctionStatsManager.getFunctionStats(function.getId(), this.dm.getSystem())
            .incResultsReceived();
      }
    }
    if (this.dm == null) {
      FunctionStatsManager.getFunctionStats(function.getId()).incResultsReturned();
    } else {
      FunctionStatsManager.getFunctionStats(function.getId(), this.dm.getSystem())
          .incResultsReturned();
    }
  }

  @Override
  public void sendResult(Object oneResult) {
    if (!this.function.hasResult()) {
      throw new IllegalStateException(
          String.format("Cannot %s result as the Function#hasResult() is false",
              "send"));
    }
    if (this.serverSender != null) {
      logger.debug(
          "PartitionedRegionFunctionResultSender sending result from local node to client {}",
          oneResult);
      clientSend(oneResult, dm.getDistributionManagerId());
    } else { // P2P
      if (this.msg != null) {
        try {
          logger.debug("PartitionedRegionFunctionResultSender sending result from remote node {}",
              oneResult);
          this.msg.sendReplyForOneResult(dm, pr, time, oneResult, false,
              enableOrderedResultStreming);
        } catch (ForceReattemptException e) {
          throw new FunctionException(e);
        } catch (InterruptedException e) {
          throw new FunctionException(e);
        }
      } else {
        logger.debug(
            "PartitionedRegionFunctionResultSender adding result to ResultCollector on local node {}",
            oneResult);
        this.rc.addResult(dm.getDistributionManagerId(), oneResult);
        FunctionStatsManager.getFunctionStats(function.getId(), this.dm.getSystem())
            .incResultsReceived();
      }
      // incrementing result sent stats.
      FunctionStatsManager.getFunctionStats(function.getId(), this.dm.getSystem())
          .incResultsReturned();
    }
  }

  private void clientSend(Object oneResult, DistributedMember memberID) {
    this.serverSender.sendResult(oneResult, memberID);
  }

  private void lastClientSend(DistributedMember memberID, Object lastResult) {
    this.serverSender.lastResult(lastResult, memberID);
  }

  @Override
  public void sendException(Throwable exception) {
    InternalFunctionException iFunxtionException = new InternalFunctionException(exception);
    this.lastResult(iFunxtionException);
    this.localLastResultReceived = true;
  }

  @Override
  public void setException(Throwable exception) {
    if (this.serverSender != null) {
      this.serverSender.setException(exception);
    } else {
      ((LocalResultCollector) this.rc).setException(exception);
      logger.info("Unexpected exception during function execution on local node Partitioned Region",
          exception);
    }
    this.rc.endResults();
    this.localLastResultReceived = true;
  }

  @Override
  public void enableOrderedResultStreming(boolean enable) {
    this.enableOrderedResultStreming = enable;
  }

  @Override
  public boolean isLocallyExecuted() {
    return this.msg == null;
  }

  @Override
  public boolean isLastResultReceived() {
    return localLastResultReceived;
  }

}


text:
from __future__ import absolute_import
from __future__ import unicode_literals

import json
import logging
import os
import re
import sys

import six
from docker.utils.ports import split_port
from jsonschema import Draft4Validator
from jsonschema import FormatChecker
from jsonschema import RefResolver
from jsonschema import ValidationError

from .errors import ConfigurationError
from .errors import VERSION_EXPLANATION
from .sort_services import get_service_name_from_network_mode

log = logging.getLogger(__name__)

DOCKER_CONFIG_HINTS = {
    'cpu_share': 'cpu_shares',
    'add_host': 'extra_hosts',
    'hosts': 'extra_hosts',
    'extra_host': 'extra_hosts',
    'device': 'devices',
    'link': 'links',
    'memory_swap': 'memswap_limit',
    'port': 'ports',
    'privilege': 'privileged',
    'priviliged': 'privileged',
    'privilige': 'privileged',
    'volume': 'volumes',
    'workdir': 'working_dir',
}

VALID_NAME_CHARS = '[a-zA-Z0-9\._\-]'
VALID_EXPOSE_FORMAT = r'^\d+(\-\d+)?(\/[a-zA-Z]+)?$'

@FormatChecker.cls_checks(format="ports", raises=ValidationError)
def format_ports(instance):
    try:
        split_port(instance)
    except ValueError as e:
        raise ValidationError(six.text_type(e))
    return True

@FormatChecker.cls_checks(format="expose", raises=ValidationError)
def format_expose(instance):
    if isinstance(instance, six.string_types):
        if not re.match(VALID_EXPOSE_FORMAT, instance):
            raise ValidationError(
                "should be of the format 'PORT[/PROTOCOL]'")

    return True

@FormatChecker.cls_checks(format="bool-value-in-mapping")
def format_boolean_in_environment(instance):
    """Check if there is a boolean in the mapping sections and display a warning.
    Always return True here so the validation won't raise an error.
    """
    if isinstance(instance, bool):
        log.warn(
            "There is a boolean value in the 'environment', 'labels', or "
            "'extra_hosts' field of a service.\n"
            "These sections only support string values.\n"
            "Please add quotes to any boolean values to make them strings "
            "(eg, 'True', 'false', 'yes', 'N', 'on', 'Off').\n"
            "This warning will become an error in a future release. \r\n"
        )
    return True

def match_named_volumes(service_dict, project_volumes):
    service_volumes = service_dict.get('volumes', [])
    for volume_spec in service_volumes:
        if volume_spec.is_named_volume and volume_spec.external not in project_volumes:
            raise ConfigurationError(
                'Named volume "{0}" is used in service "{1}" but no'
                ' declaration was found in the volumes section.'.format(
                    volume_spec.repr(), service_dict.get('name')
                )
            )

def python_type_to_yaml_type(type_):
    type_name = type(type_).__name__
    return {
        'dict': 'mapping',
        'list': 'array',
        'int': 'number',
        'float': 'number',
        'bool': 'boolean',
        'unicode': 'string',
        'str': 'string',
        'bytes': 'string',
    }.get(type_name, type_name)

def validate_config_section(filename, config, section):
    """Validate the structure of a configuration section. This must be done
    before interpolation so it's separate from schema validation.
    """
    if not isinstance(config, dict):
        raise ConfigurationError(
            "In file '{filename}', {section} must be a mapping, not "
            "{type}.".format(
                filename=filename,
                section=section,
                type=anglicize_json_type(python_type_to_yaml_type(config))))

    for key, value in config.items():
        if not isinstance(key, six.string_types):
            raise ConfigurationError(
                "In file '{filename}', the {section} name {name} must be a "
                "quoted string, i.e. '{name}'.".format(
                    filename=filename,
                    section=section,
                    name=key))

        if not isinstance(value, (dict, type(None))):
            raise ConfigurationError(
                "In file '{filename}', {section} '{name}' must be a mapping not "
                "{type}.".format(
                    filename=filename,
                    section=section,
                    name=key,
                    type=anglicize_json_type(python_type_to_yaml_type(value))))

def validate_top_level_object(config_file):
    if not isinstance(config_file.config, dict):
        raise ConfigurationError(
            "Top level object in '{}' needs to be an object not '{}'.".format(
                config_file.filename,
                type(config_file.config)))

def validate_ulimits(service_config):
    ulimit_config = service_config.config.get('ulimits', {})
    for limit_name, soft_hard_values in six.iteritems(ulimit_config):
        if isinstance(soft_hard_values, dict):
            if not soft_hard_values['soft'] <= soft_hard_values['hard']:
                raise ConfigurationError(
                    "Service '{s.name}' has invalid ulimit '{ulimit}'. "
                    "'soft' value can not be greater than 'hard' value ".format(
                        s=service_config,
                        ulimit=ulimit_config))

def validate_extends_file_path(service_name, extends_options, filename):
    """
    The service to be extended must either be defined in the config key 'file',
    or within 'filename'.
    """
    error_prefix = "Invalid 'extends' configuration for %s:" % service_name

    if 'file' not in extends_options and filename is None:
        raise ConfigurationError(
            "%s you need to specify a 'file', e.g. 'file: something.yml'" % error_prefix
        )

def validate_network_mode(service_config, service_names):
    network_mode = service_config.config.get('network_mode')
    if not network_mode:
        return

    if 'networks' in service_config.config:
        raise ConfigurationError("'network_mode' and 'networks' cannot be combined")

    dependency = get_service_name_from_network_mode(network_mode)
    if not dependency:
        return

    if dependency not in service_names:
        raise ConfigurationError(
            "Service '{s.name}' uses the network stack of service '{dep}' which "
            "is undefined.".format(s=service_config, dep=dependency))

def validate_depends_on(service_config, service_names):
    for dependency in service_config.config.get('depends_on', []):
        if dependency not in service_names:
            raise ConfigurationError(
                "Service '{s.name}' depends on service '{dep}' which is "
                "undefined.".format(s=service_config, dep=dependency))

def get_unsupported_config_msg(path, error_key):
    msg = "Unsupported config option for {}: '{}'".format(path_string(path), error_key)
    if error_key in DOCKER_CONFIG_HINTS:
        msg += " (did you mean '{}'?)".format(DOCKER_CONFIG_HINTS[error_key])
    return msg

def anglicize_json_type(json_type):
    if json_type.startswith(('a', 'e', 'i', 'o', 'u')):
        return 'an ' + json_type
    return 'a ' + json_type

def is_service_dict_schema(schema_id):
    return schema_id == 'fields_schema_v1.json' or schema_id == '#/properties/services'

def handle_error_for_schema_with_id(error, path):
    schema_id = error.schema['id']

    if is_service_dict_schema(schema_id) and error.validator == 'additionalProperties':
        return "Invalid service name '{}' - only {} characters are allowed".format(
            # The service_name is the key to the json object
            list(error.instance)[0],
            VALID_NAME_CHARS)

    if schema_id == '#/definitions/constraints':
        # Build context could in 'build' or 'build.context' and dockerfile could be
        # in 'dockerfile' or 'build.dockerfile'
        context = False
        dockerfile = 'dockerfile' in error.instance
        if 'build' in error.instance:
            if isinstance(error.instance['build'], six.string_types):
                context = True
            else:
                context = 'context' in error.instance['build']
                dockerfile = dockerfile or 'dockerfile' in error.instance['build']

        # TODO: only applies to v1
        if 'image' in error.instance and context:
            return (
                "{} has both an image and build path specified. "
                "A service can either be built to image or use an existing "
                "image, not both.".format(path_string(path)))
        if 'image' not in error.instance and not context:
            return (
                "{} has neither an image nor a build path specified. "
                "At least one must be provided.".format(path_string(path)))
        # TODO: only applies to v1
        if 'image' in error.instance and dockerfile:
            return (
                "{} has both an image and alternate Dockerfile. "
                "A service can either be built to image or use an existing "
                "image, not both.".format(path_string(path)))

    if error.validator == 'additionalProperties':
        if schema_id == '#/definitions/service':
            invalid_config_key = parse_key_from_error_msg(error)
            return get_unsupported_config_msg(path, invalid_config_key)

        if not error.path:
            return '{}\n{}'.format(error.message, VERSION_EXPLANATION)

def handle_generic_service_error(error, path):
    msg_format = None
    error_msg = error.message

    if error.validator == 'oneOf':
        msg_format = "{path} {msg}"
        config_key, error_msg = _parse_oneof_validator(error)
        if config_key:
            path.append(config_key)

    elif error.validator == 'type':
        msg_format = "{path} contains an invalid type, it should be {msg}"
        error_msg = _parse_valid_types_from_validator(error.validator_value)

    elif error.validator == 'required':
        error_msg = ", ".join(error.validator_value)
        msg_format = "{path} is invalid, {msg} is required."

    elif error.validator == 'dependencies':
        config_key = list(error.validator_value.keys())[0]
        required_keys = ",".join(error.validator_value[config_key])

        msg_format = "{path} is invalid: {msg}"
        path.append(config_key)
        error_msg = "when defining '{}' you must set '{}' as well".format(
            config_key,
            required_keys)

    elif error.cause:
        error_msg = six.text_type(error.cause)
        msg_format = "{path} is invalid: {msg}"

    elif error.path:
        msg_format = "{path} value {msg}"

    if msg_format:
        return msg_format.format(path=path_string(path), msg=error_msg)

    return error.message

def parse_key_from_error_msg(error):
    return error.message.split("'")[1]

def path_string(path):
    return ".".join(c for c in path if isinstance(c, six.string_types))

def _parse_valid_types_from_validator(validator):
    """A validator value can be either an array of valid types or a string of
    a valid type. Parse the valid types and prefix with the correct article.
    """
    if not isinstance(validator, list):
        return anglicize_json_type(validator)

    if len(validator) == 1:
        return anglicize_json_type(validator[0])

    return "{}, or {}".format(
        ", ".join([anglicize_json_type(validator[0])] + validator[1:-1]),
        anglicize_json_type(validator[-1]))

def _parse_oneof_validator(error):
    """oneOf has multiple schemas, so we need to reason about which schema, sub
    schema or constraint the validation is failing on.
    Inspecting the context value of a ValidationError gives us information about
    which sub schema failed and which kind of error it is.
    """
    types = []
    for context in error.context:

        if context.validator == 'oneOf':
            _, error_msg = _parse_oneof_validator(context)
            return path_string(context.path), error_msg

        if context.validator == 'required':
            return (None, context.message)

        if context.validator == 'additionalProperties':
            invalid_config_key = parse_key_from_error_msg(context)
            return (None, "contains unsupported option: '{}'".format(invalid_config_key))

        if context.path:
            return (
                path_string(context.path),
                "contains {}, which is an invalid type, it should be {}".format(
                    json.dumps(context.instance),
                    _parse_valid_types_from_validator(context.validator_value)),
            )

        if context.validator == 'uniqueItems':
            return (
                None,
                "contains non unique items, please remove duplicates from {}".format(
                    context.instance),
            )

        if context.validator == 'type':
            types.append(context.validator_value)

    valid_types = _parse_valid_types_from_validator(types)
    return (None, "contains an invalid type, it should be {}".format(valid_types))

def process_errors(errors, path_prefix=None):
    """jsonschema gives us an error tree full of information to explain what has
    gone wrong. Process each error and pull out relevant information and re-write
    helpful error messages that are relevant.
    """
    path_prefix = path_prefix or []

    def format_error_message(error):
        path = path_prefix + list(error.path)

        if 'id' in error.schema:
            error_msg = handle_error_for_schema_with_id(error, path)
            if error_msg:
                return error_msg

        return handle_generic_service_error(error, path)

    return '\n'.join(format_error_message(error) for error in errors)

def validate_against_fields_schema(config_file):
    schema_filename = "fields_schema_v{0}.json".format(config_file.version)
    _validate_against_schema(
        config_file.config,
        schema_filename,
        format_checker=["ports", "expose", "bool-value-in-mapping"],
        filename=config_file.filename)

def validate_against_service_schema(config, service_name, version):
    _validate_against_schema(
        config,
        "service_schema_v{0}.json".format(version),
        format_checker=["ports"],
        path_prefix=[service_name])

def _validate_against_schema(
        config,
        schema_filename,
        format_checker=(),
        path_prefix=None,
        filename=None):
    config_source_dir = os.path.dirname(os.path.abspath(__file__))

    if sys.platform == "win32":
        file_pre_fix = "///"
        config_source_dir = config_source_dir.replace('\\', '/')
    else:
        file_pre_fix = "//"

    resolver_full_path = "file:{}{}/".format(file_pre_fix, config_source_dir)
    schema_file = os.path.join(config_source_dir, schema_filename)

    with open(schema_file, "r") as schema_fh:
        schema = json.load(schema_fh)

    resolver = RefResolver(resolver_full_path, schema)
    validation_output = Draft4Validator(
        schema,
        resolver=resolver,
        format_checker=FormatChecker(format_checker))

    errors = [error for error in sorted(validation_output.iter_errors(config), key=str)]
    if not errors:
        return

    error_msg = process_errors(errors, path_prefix=path_prefix)
    file_msg = " in file '{}'".format(filename) if filename else ''
    raise ConfigurationError("Validation failed{}, reason(s):\n{}".format(
        file_msg,
        error_msg))


text:
package pl.fishing.user.exception;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(value = HttpStatus.CONFLICT)
public class FriendshipAlreadyExistException extends RuntimeException {

    public FriendshipAlreadyExistException() {
        super();
    }

    public FriendshipAlreadyExistException(String message){
        super(message);
    }
}


text:
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'

const REGISTRY = `http://localhost:${REGISTRY_MOCK_PORT}`

export const DEFAULT_OPTS = {
  alwaysAuth: false,
  argv: {
    original: [],
  },
  bail: false,
  bin: 'node_modules/.bin',
  ca: undefined,
  cacheDir: '../cache',
  cert: undefined,
  cliOptions: {},
  fetchRetries: 2,
  fetchRetryFactor: 90,
  fetchRetryMaxtimeout: 90,
  fetchRetryMintimeout: 10,
  filter: [] as string[],
  global: false,
  httpsProxy: undefined,
  include: {
    dependencies: true,
    devDependencies: true,
    optionalDependencies: true,
  },
  key: undefined,
  linkWorkspacePackages: true,
  localAddress: undefined,
  lock: false,
  lockStaleDuration: 90,
  networkConcurrency: 16,
  offline: false,
  pending: false,
  pnpmfile: './.pnpmfile.cjs',
  proxy: undefined,
  rawConfig: { registry: REGISTRY },
  rawLocalConfig: {},
  registries: { default: REGISTRY },
  registry: REGISTRY,
  sort: true,
  storeDir: '../store',
  strictSsl: false,
  tag: 'latest',
  userAgent: 'pnpm',
  useRunningStoreServer: false,
  useStoreServer: false,
  workspaceConcurrency: 4,
}


text:
<?php

class Pix_Array_Exception extends Pix_Exception
{
}


text:
namespace Machete.Translators.PropertyTranslaters
{
    using System.Threading.Tasks;

    public interface ITranslatePropertyProvider<TProperty, TInput, TSchema>
        where TSchema : Entity
        where TInput : TSchema
    {
        Task<TProperty> GetProperty(TranslateContext<TInput, TSchema> context);
    }
}


text:
package example.service;

import example.repo.Customer1685Repository;

import org.springframework.stereotype.Service;

@Service
public class Customer1685Service {
	public Customer1685Service(Customer1685Repository repo) {}
}


text:
package org.jetbrains.plugins.groovy.compiler;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.compiler.options.ExcludeEntryDescription;
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import org.jetbrains.plugins.groovy.GroovyLanguage;

/**
 * @author peter
 */
public class ExcludeFromStubGenerationAction extends AnAction implements DumbAware {
  @Override
  public void actionPerformed(final AnActionEvent e) {
    final PsiFile file = e.getData(DataKeys.PSI_FILE);

    assert file != null && file.getLanguage() == GroovyLanguage.INSTANCE;

    doExcludeFromStubGeneration(file);
  }

  public static void doExcludeFromStubGeneration(PsiFile file) {
    final VirtualFile virtualFile = file.getVirtualFile();
    assert virtualFile != null;
    final Project project = file.getProject();

    final GroovyCompilerConfigurable configurable = new GroovyCompilerConfigurable(project);
    ShowSettingsUtil.getInstance().editConfigurable(project, configurable, new Runnable() {
      @Override
      public void run() {
        configurable.getExcludes().addEntry(new ExcludeEntryDescription(virtualFile, false, true, project));
      }
    });
  }

  @Override
  public void update(AnActionEvent e) {
    Presentation presentation = e.getPresentation();

    boolean enabled = isEnabled(e);
    presentation.setEnabled(enabled);
    presentation.setVisible(enabled);
  }

  private static boolean isEnabled(AnActionEvent e) {
    PsiFile file = e.getData(DataKeys.PSI_FILE);
    if (file == null || file.getLanguage() != GroovyLanguage.INSTANCE) {
      return false;
    }

    final VirtualFile virtualFile = file.getVirtualFile();
    return virtualFile != null && !GroovyCompilerConfiguration.getExcludeConfiguration(file.getProject()).isExcluded(virtualFile);
  }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
ServiceCommand
</TITLE>

<META NAME="keywords" CONTENT="edu.psu.citeseerx.corecom.ServiceCommand interface">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

edu.psu.citeseerx.corecom

Interface ServiceCommand

public interface ServiceCommand

This interface should be used to specify how objects read from
 an ObjectServer's ObjectTransferConnection should be handled.

Method Summary

 java.lang.Object
execute(java.lang.Object obj)

 ServiceCommand
newCommand()

          Generates a new instance of the class.

Method Detail

newCommand

ServiceCommand newCommand()

Generates a new instance of the class.

execute

java.lang.Object execute(java.lang.Object obj)

Parameters:
obj - data read from client

Returns:
data to be sent back to client

      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
//J-
package com.whippy.poker.common.beans;

/**
 * Represents the value of a card, starting with TWO and going up to ACE. Each card has a numeric value ranging from 2 to 14 respectively
 * @author mdunn
 *
 */
public enum Value {

        //~ ----------------------------------------------------------------------------------------------------------------
        //~ Enum constants
        //~ ----------------------------------------------------------------------------------------------------------------

        TWO(2), THREE(3), FOUR(4), FIVE(5), SIX(6), SEVEN(7), EIGHT(8), NINE(9), TEN(10), JACK(11), QUEEN(12), KING(13), ACE(14);

        //~ ----------------------------------------------------------------------------------------------------------------
        //~ Instance fields
        //~ ----------------------------------------------------------------------------------------------------------------

        private int numericValue;

        //~ ----------------------------------------------------------------------------------------------------------------
        //~ Constructors
        //~ ----------------------------------------------------------------------------------------------------------------

        private Value(int numericValue) {
                this.numericValue = numericValue;
        }

        //~ ----------------------------------------------------------------------------------------------------------------
        //~ Methods
        //~ ----------------------------------------------------------------------------------------------------------------

        /**
         * Gets the numeric value of the card value
         *
         * @return the numeric value associated with a card
         */
        public int getNumericValue() {
                return numericValue;
        }

}
//J+


text:
module RSpec
  module Matchers
    module BuiltIn
      class Match < BaseMatcher

        def match(expected, actual)
          actual.match expected
        end

        def diffable?
          true
        end

      end
    end
  end
end


text:
module Metalbird
  module Twitter
    autoload :Authentication, 'metalbird/twitter/authentication'
    autoload :Publisher, 'metalbird/twitter/publisher'
    autoload :PublishArgs, 'metalbird/twitter/publish_args'
    autoload :RetweetArgs, 'metalbird/twitter/retweet_args'
  end
end


text:
.. module:: bottle

=========================
List of available Plugins
=========================

This is a list of third-party plugins that add extend Bottles core functionality or integrate other libraries with the Bottle framework.

Have a look at :ref:`plugins` for general questions about plugins (installation, usage). If you plan to develop a new plugin, the :doc:`/plugindev` may help you.

`Bottle-Beaker <http://pypi.python.org/pypi/bottle-beaker/>`_
    Beaker to session and caching library with WSGI Middleware

`Bottle-Cork <http://cork.firelet.net/>`_
	Cork provides a simple set of methods to implement Authentication and Authorization in web applications based on Bottle.

`Bottle-Extras <http://pypi.python.org/pypi/bottle-extras/>`_
	Meta package to install the bottle plugin collection.

`Bottle-Flash <http://pypi.python.org/pypi/bottle-flash/>`_
	flash plugin for bottle

`Bottle-Hotqueue <http://pypi.python.org/pypi/bottle-hotqueue/>`_
	FIFO Queue for Bottle built upon redis

`Macaron <http://nobrin.github.com/macaron/webapp.html>`_
	Macaron is an object-relational mapper (ORM) for SQLite.

`Bottle-Memcache <http://pypi.python.org/pypi/bottle-memcache/>`_
	Memcache integration for Bottle.

`Bottle-Mongo <http://pypi.python.org/pypi/bottle-mongo/>`_
	MongoDB integration for Bottle

`Bottle-Redis <http://pypi.python.org/pypi/bottle-redis/>`_
	Redis integration for Bottle.

`Bottle-Renderer <http://pypi.python.org/pypi/bottle-renderer/>`_
	Renderer plugin for bottle

`Bottle-Servefiles <http://pypi.python.org/pypi/bottle-servefiles/>`_
	A reusable app that serves static files for bottle apps

`Bottle-Sqlalchemy <http://pypi.python.org/pypi/bottle-sqlalchemy/>`_
	SQLAlchemy integration for Bottle.

`Bottle-Sqlite <http://pypi.python.org/pypi/bottle-sqlite/>`_
	SQLite3 database integration for Bottle.

`Bottle-Web2pydal <http://pypi.python.org/pypi/bottle-web2pydal/>`_
	Web2py Dal integration for Bottle.

`Bottle-Werkzeug <http://pypi.python.org/pypi/bottle-werkzeug/>`_
	Integrates the `werkzeug` library (alternative request and response objects, advanced debugging middleware and more).

Plugins listed here are not part of Bottle or the Bottle project, but developed and maintained by third parties.