text:
"""
Google OpenId, OAuth2, OAuth1, Google+ Sign-in backends, docs at:
    http://psa.matiasaguirre.net/docs/backends/google.html
"""
from requests import HTTPError

from social.backends.open_id import OpenIdAuth
from social.backends.oauth import BaseOAuth2, BaseOAuth1
from social.exceptions import AuthMissingParameter, AuthCanceled

class BaseGoogleAuth(object):
    def get_user_id(self, details, response):
        """Use google email as unique id"""
        if self.setting('USE_UNIQUE_USER_ID', False):
            return response['id']
        else:
            return details['email']

    def get_user_details(self, response):
        """Return user details from Google API account"""
        if response.get('emails'):
            email = response['emails'][0]['value']
        elif response.get('email'):
            email = response['email']
        else:
            email = ''

        names = response.get('name') or {}
        fullname, first_name, last_name = self.get_user_names(
            response.get('displayName', ''),
            names.get('givenName', ''),
            names.get('familyName', '')
        )
        return {'username': email.split('@', 1)[0],
                'email': email,
                'fullname': fullname,
                'first_name': first_name,
                'last_name': last_name}

class BaseGoogleOAuth2API(BaseGoogleAuth):
    def user_data(self, access_token, *args, **kwargs):
        """Return user data from Google API"""
        return self.get_json(
            'https://www.googleapis.com/plus/v1/people/me',
            params={'access_token': access_token, 'alt': 'json'}
        )

class GoogleOAuth2(BaseGoogleOAuth2API, BaseOAuth2):
    """Google OAuth2 authentication backend"""
    name = 'google-oauth2'
    REDIRECT_STATE = False
    AUTHORIZATION_URL = 'https://accounts.google.com/o/oauth2/auth'
    ACCESS_TOKEN_URL = 'https://accounts.google.com/o/oauth2/token'
    ACCESS_TOKEN_METHOD = 'POST'
    REVOKE_TOKEN_URL = 'https://accounts.google.com/o/oauth2/revoke'
    REVOKE_TOKEN_METHOD = 'GET'
    DEFAULT_SCOPE = ['email', 'profile']
    EXTRA_DATA = [
        ('refresh_token', 'refresh_token', True),
        ('expires_in', 'expires'),
        ('token_type', 'token_type', True),
        ('name'),
        ('language'),
        ('id', 'plus_id'),
        ('image'),
        ('cover'),
        ('email'),
        ('gender'),
    ]

    def revoke_token_params(self, token, uid):
        return {'token': token}

    def revoke_token_headers(self, token, uid):
        return {'Content-type': 'application/json'}

class GooglePlusAuth(BaseGoogleOAuth2API, BaseOAuth2):
    name = 'google-plus'
    REDIRECT_STATE = False
    STATE_PARAMETER = False
    ACCESS_TOKEN_URL = 'https://accounts.google.com/o/oauth2/token'
    ACCESS_TOKEN_METHOD = 'POST'
    REVOKE_TOKEN_URL = 'https://accounts.google.com/o/oauth2/revoke'
    REVOKE_TOKEN_METHOD = 'GET'
    DEFAULT_SCOPE = ['plus.login', 'email']
    EXTRA_DATA = [
        ('id', 'user_id'),
        ('refresh_token', 'refresh_token', True),
        ('expires_in', 'expires'),
        ('access_type', 'access_type', True),
        ('code', 'code')
    ]

    def auth_complete_params(self, state=None):
        params = super(GooglePlusAuth, self).auth_complete_params(state)
        params['redirect_uri'] = 'postmessage'
        return params

    def auth_complete(self, *args, **kwargs):
        token = self.data.get('access_token')
        if not token:
            raise AuthMissingParameter(self, 'access_token')

        self.process_error(self.get_json(
            'https://www.googleapis.com/oauth2/v1/tokeninfo',
            params={'access_token': token}
        ))

        try:
            response = self.request_access_token(
                self.ACCESS_TOKEN_URL,
                data=self.auth_complete_params(),
                headers=self.auth_headers(),
                method=self.ACCESS_TOKEN_METHOD
            )
        except HTTPError as err:
            if err.response.status_code == 400:
                raise AuthCanceled(self)
            else:
                raise
        self.process_error(response)
        return self.do_auth(response['access_token'], response=response,
                            *args, **kwargs)

class GoogleOAuth(BaseGoogleAuth, BaseOAuth1):
    """Google OAuth authorization mechanism"""
    name = 'google-oauth'
    AUTHORIZATION_URL = 'https://www.google.com/accounts/OAuthAuthorizeToken'
    REQUEST_TOKEN_URL = 'https://www.google.com/accounts/OAuthGetRequestToken'
    ACCESS_TOKEN_URL = 'https://www.google.com/accounts/OAuthGetAccessToken'
    DEFAULT_SCOPE = ['https://www.googleapis.com/auth/userinfo#email']

    def user_data(self, access_token, *args, **kwargs):
        """Return user data from Google API"""
        return self.get_querystring(
            'https://www.googleapis.com/userinfo/email',
            auth=self.oauth_auth(access_token)
        )

    def get_key_and_secret(self):
        """Return Google OAuth Consumer Key and Consumer Secret pair, uses
        anonymous by default, beware that this marks the application as not
        registered and a security badge is displayed on authorization page.
        http://code.google.com/apis/accounts/docs/OAuth_ref.html#SigningOAuth
        """
        key_secret = super(GoogleOAuth, self).get_key_and_secret()
        if key_secret == (None, None):
            key_secret = ('anonymous', 'anonymous')
        return key_secret

class GoogleOpenId(OpenIdAuth):
    name = 'google'
    URL = 'https://www.google.com/accounts/o8/id'

    def get_user_id(self, details, response):
        """
        Return user unique id provided by service. For google user email
        is unique enought to flag a single user. Email comes from schema:
        http://axschema.org/contact/email
        """
        return details['email']


text:
package autoupdate

import (
	"bytes"
	"compress/bzip2"
	"io"
	"io/ioutil"
	"net/http"
	"os"

	"github.com/blang/semver"
)

type Updater interface {
	// PublishProgress: publish percentage of update already downloaded
	Progress(int)
}

// byteCounter wraps an existing io.Reader and keeps track of the byte
// count while downloading the latest update
type byteCounter struct {
	io.Reader // Underlying io.Reader to track bytes transferred
	Updater
	total    int64   // Total bytes transferred
	length   int64   // Expected length
	progress float64 // How much of the update has been downloaded
}

func (pt *byteCounter) Read(p []byte) (int, error) {
	n, err := pt.Reader.Read(p)
	if n > 0 {
		pt.total += int64(n)
		percentage := float64(pt.total) / float64(pt.length) * float64(100)
		pt.Updater.Progress(int(percentage))
	}
	return n, err
}

// CheckMobileUpdate checks if a new update is available for mobile.
func CheckMobileUpdate(cfg *Config) (string, error) {
	log.Debugf("Checking for new mobile version; current version: %s", cfg.CurrentVersion)

	res, err := cfg.check()
	if err != nil {
		log.Errorf("Error checking for update for mobile: %v", err)
		return "", err
	}

	if res == nil {
		log.Debugf("No new version available!")
		return "", nil
	}

	v, err := semver.Make(cfg.CurrentVersion)
	if err != nil {
		log.Errorf("Error checking for update; could not parse version number: %v", err)
		return "", err
	}

	if isNewerVersion(v, res.Version) {
		log.Debugf("Newer version of Lantern mobile available! %s at %s", res.Version, res.Url)
		return res.Url, nil
	}

	return "", nil
}

// UpdateMobile downloads the latest APK from the given url to file apkPath.
func UpdateMobile(url, apkPath string, updater Updater, httpClient *http.Client) error {
	out, err := os.Create(apkPath)
	if err != nil {
		log.Error(err)
		return err
	}
	defer out.Close()
	return doUpdateMobile(url, out, updater, httpClient)
}

func doUpdateMobile(url string, out *os.File, updater Updater, httpClient *http.Client) error {
	var req *http.Request
	var res *http.Response
	var err error

	log.Debugf("Attempting to download APK from %s", url)

	if req, err = http.NewRequest("GET", url, nil); err != nil {
		log.Errorf("Error downloading update: %v", err)
		return err
	}

	req.Header.Add("Accept-Encoding", "gzip")

	if httpClient == nil {
		httpClient = &http.Client{}
	}
	if res, err = httpClient.Do(req); err != nil {
		log.Errorf("Error requesting update: %v", err)
		return err
	}

	defer res.Body.Close()

	// We use a special byteCounter that storres a reference
	// to the updater interface to make it easy to publish progress
	// for how much of the update has been downloaded already.
	bytespt := &byteCounter{Updater: updater,
		Reader: res.Body, length: res.ContentLength}

	contents, err := ioutil.ReadAll(bytespt)
	if err != nil {
		log.Errorf("Error reading update: %v", err)
		return err
	}

	_, err = io.Copy(out, bzip2.NewReader(bytes.NewReader(contents)))
	if err != nil {
		log.Errorf("Error copying update: %v", err)
		return err
	}

	return nil
}

redpajama_set_name: RedPajamaGithub


text:
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="..\..\jriappTS\jriapp.d.ts"/>
var RIAPP;
(function (RIAPP) {
    var AUTOCOMPLETE;
    (function (AUTOCOMPLETE) {
        'use strict';
        var constsMOD = RIAPP.consts;
        var global = RIAPP.global, utils = global.utils;
        function addTextQuery(query, fldName, val) {
            var tmp;
            if (!!val) {
                if (utils.str.startsWith(val, '%') && utils.str.endsWith(val, '%')) {
                    tmp = utils.str.trim(val, '% ');
                    query.where(fldName, 4 /* Contains */, [tmp]);
                }
                else if (utils.str.startsWith(val, '%')) {
                    tmp = utils.str.trim(val, '% ');
                    query.where(fldName, 3 /* EndsWith */, [tmp]);
                }
                else if (utils.str.endsWith(val, '%')) {
                    tmp = utils.str.trim(val, '% ');
                    query.where(fldName, 2 /* StartsWith */, [tmp]);
                }
                else {
                    tmp = utils.str.trim(val);
                    query.where(fldName, 0 /* Equals */, [tmp]);
                }
            }
            return query;
        }
        ;
        var AutoCompleteElView = (function (_super) {
            __extends(AutoCompleteElView, _super);
            function AutoCompleteElView() {
                _super.apply(this, arguments);
            }
            AutoCompleteElView.prototype._init = function (options) {
                var self = this;
                //debugger;
                _super.prototype._init.call(this, options);
                this._templateId = options.templateId;
                this._fieldName = options.fieldName;
                this._dbSetName = options.dbSetName;
                this._queryName = options.queryName;
                this._dbContextName = options.dbContext;
                this._minTextLength = (!!options.minTextLength) ? options.minTextLength : 1;
                this._template = null;
                this._gridDataSource = null;
                this._prevText = null;
                this._selectedItem = null;
                this._template = null;
                this._$dropDown = null;
                this._loadTimeout = null;
                this._dataContext = null;
                this._isLoading = false;
                this._width = options.width || '200px';
                this._height = options.height || '300px';
                this._$dlg = null;
                var $el = this.$el;
                $el.on('change.' + this._objId, function (e) {
                    e.stopPropagation();
                    self._onTextChange();
                    self.raisePropertyChanged('value');
                });
                $el.on('keyup.' + this._objId, function (e) {
                    e.stopPropagation();
                    self._onKeyUp(e.target.value);
                });
                $el.on('keypress.' + this._objId, function (e) {
                    e.stopPropagation();
                    self._onKeyPress(e.which);
                });
                this._isOpen = false;
                this._createGridDataSource();
                this._template = this._createTemplate();
                this._$dropDown = global.$(global.document.createElement("div"));
                this._$dropDown.css({
                    "position": "absolute",
                    "z-index": "10000",
                    "visibility": "hidden",
                    "background-color": "White",
                    "border": "1px solid gray",
                    "width": this._width,
                    "height": this._height
                });
                this._$dropDown.append(this._template.el);
                this._template.el.style.height = '100%';
                this._template.el.style.width = '100%';
                this._lookupGrid = null;
                var gridElView = this._findElemViewInTemplate('lookupGrid');
                if (!!gridElView) {
                    this._lookupGrid = gridElView.grid;
                }
                this._btnOk = this._findElemInTemplate('btnOk');
                this._btnCancel = this._findElemInTemplate('btnCancel');
                global.$(this._btnOk).click(function () {
                    self._updateSelection();
                    self._hide();
                });
                global.$(this._btnCancel).click(function () {
                    self._hide();
                });
                global.document.body.appendChild(this._$dropDown.get(0));
            };
            AutoCompleteElView.prototype._findElemViewInTemplate = function (name) {
                //look by data-name attribute value
                var arr = this._template.findElViewsByDataName(name);
                if (!!arr && arr.length > 0)
                    return arr[0];
                else
                    return null;
            };
            AutoCompleteElView.prototype._findElemInTemplate = function (name) {
                var arr = this._template.findElByDataName(name);
                if (!!arr && arr.length > 0)
                    return arr[0];
                else
                    return null;
            };
            AutoCompleteElView.prototype._createGridDataSource = function () {
                this._gridDataSource = this._getDbContext().getDbSet(this._dbSetName);
                if (!this._gridDataSource) {
                    throw new Error(utils.format('dbContext does not contain dbSet with the name: {0}', this._dbSetName));
                }
            };
            AutoCompleteElView.prototype._getDbContext = function () {
                var dbContext = this.app.getObject(this._dbContextName);
                if (!dbContext) {
                    throw new Error(utils.format('dbContext with the name: {0} is not registered', this._dbContextName));
                }
                return dbContext;
            };
            AutoCompleteElView.prototype._getEventNames = function () {
                var base_events = _super.prototype._getEventNames.call(this);
                return ['hide', 'show'].concat(base_events);
            };
            AutoCompleteElView.prototype._createTemplate = function () {
                var t = new RIAPP.MOD.template.Template({ app: this.app, templateID: this._templateId, dataContext: this });
                return t;
            };
            AutoCompleteElView.prototype._onTextChange = function () {
            };
            AutoCompleteElView.prototype._onKeyUp = function (text) {
                var self = this;
                clearTimeout(this._loadTimeout);
                if (!!text && text.length >= self._minTextLength) {
                    this._loadTimeout = setTimeout(function () {
                        if (self._isDestroyCalled)
                            return;
                        if (self._prevText != text) {
                            self._prevText = text;
                            if (!self._isOpen)
                                self._open();
                            self.load(text);
                        }
                    }, 500);
                }
                else
                    self.gridDataSource.clear();
            };
            AutoCompleteElView.prototype._onKeyPress = function (keyCode) {
                if (keyCode === 27 /* esc */) {
                    this._hide();
                    return;
                }
                if (keyCode === 13 /* enter */) {
                    this._updateSelection();
                    this._hide();
                    return;
                }
            };
            AutoCompleteElView.prototype._updateSelection = function () {
                this.value = this.currentSelection;
            };
            AutoCompleteElView.prototype._updatePosition = function () {
                this._$dropDown.position({
                    my: "left top",
                    at: "left bottom",
                    of: global.$(this.el),
                    offset: "0 0"
                });
            };
            AutoCompleteElView.prototype._onShow = function () {
                this.raiseEvent('show', {});
            };
            AutoCompleteElView.prototype._onHide = function () {
                this.raiseEvent('hide', {});
            };
            AutoCompleteElView.prototype._open = function () {
                if (this._isOpen)
                    return;
                var self = this;
                this._$dlg = this.$el.closest(".ui-dialog");
                var ns = "dialogdrag." + this._objId;
                this._$dlg.on(ns, null, function (event) {
                    if (!self._isOpen)
                        return null;
                    self._updatePosition();
                    return null;
                });
                this._updatePosition();
                this._$dropDown.css({ visibility: "visible", display: "none" });
                this._$dropDown.slideDown('medium');
                if (!!this._lookupGrid) {
                    this._lookupGrid.addHandler('cell_dblclicked', function (s, a) {
                        self._updateSelection();
                        self._hide();
                    }, this._objId);
                    global.$(global.document).on('keyup.' + this._objId, function (e) {
                        e.stopPropagation();
                        if (global.currentSelectable === self._lookupGrid)
                            self._onKeyPress(e.which);
                    });
                }
                this._isOpen = true;
                this._onShow();
            };
            AutoCompleteElView.prototype._hide = function () {
                var self = this;
                if (!this._isOpen)
                    return;
                global.$(global.document).off('.' + this._objId);
                this._$dlg.off('.' + this._objId);
                if (!!this._lookupGrid) {
                    this._lookupGrid.removeNSHandlers(this._objId);
                }
                this._$dropDown.slideUp('medium', function () {
                    if (self._isDestroyCalled)
                        return;
                    self._$dropDown.css({ visibility: "hidden", display: "" });
                });
                this._isOpen = false;
                this._onHide();
            };
            AutoCompleteElView.prototype.load = function (str) {
                var self = this, query = this.gridDataSource.createQuery(this._queryName);
                query.pageSize = 50;
                query.isClearPrevData = true;
                addTextQuery(query, this._fieldName, str + '%');
                query.orderBy(this._fieldName);
                this._isLoading = true;
                this.raisePropertyChanged('isLoading');
                query.load().always(function (res) {
                    self._isLoading = false;
                    self.raisePropertyChanged('isLoading');
                });
            };
            AutoCompleteElView.prototype.destroy = function () {
                if (this._isDestroyed)
                    return;
                this._isDestroyCalled = true;
                this._hide();
                this.$el.off('.' + this._objId);
                if (!!this._lookupGrid) {
                    this._lookupGrid = null;
                }
                if (!!this._template) {
                    this._template.destroy();
                    this._template = null;
                    this._$dropDown = null;
                }
                this._gridDataSource = null;
                this._dataContext = null;
                _super.prototype.destroy.call(this);
            };
            Object.defineProperty(AutoCompleteElView.prototype, "fieldName", {
                //field name for lookup in dbSet
                get: function () { return this._fieldName; },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(AutoCompleteElView.prototype, "templateId", {
                get: function () { return this._templateId; },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(AutoCompleteElView.prototype, "currentSelection", {
                get: function () {
                    if (this._gridDataSource.currentItem)
                        return this._gridDataSource.currentItem[this._fieldName];
                    else
                        return null;
                },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(AutoCompleteElView.prototype, "template", {
                //template instance of drop down area (which contains datagrid) under textbox
                get: function () { return this._template; },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(AutoCompleteElView.prototype, "dataContext", {
                //Entity which is databound to the textbox
                get: function () { return this._dataContext; },
                set: function (v) {
                    if (this._dataContext !== v) {
                        this._dataContext = v;
                        this.raisePropertyChanged('dataContext');
                    }
                },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(AutoCompleteElView.prototype, "gridDataSource", {
                //dbSet for a datagrid's dataSource (for lookup values)
                get: function () { return this._gridDataSource; },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(AutoCompleteElView.prototype, "value", {
                get: function () {
                    var el = this.el;
                    if (!el)
                        return '';
                    return el.value;
                },
                set: function (v) {
                    if (!this._el)
                        return;
                    var el = this.el;
                    var x = el.value;
                    var str = '' + v;
                    v = (v === null) ? '' : str;
                    if (x !== v) {
                        el.value = v;
                        this._prevText = v;
                        this.raisePropertyChanged('value');
                    }
                },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(AutoCompleteElView.prototype, "isLoading", {
                get: function () {
                    return this._isLoading;
                },
                enumerable: true,
                configurable: true
            });
            return AutoCompleteElView;
        })(RIAPP.MOD.baseElView.InputElView);
        AUTOCOMPLETE.AutoCompleteElView = AutoCompleteElView;
        //this function is executed when an application which uses this namespace is created
        function initModule(app) {
            app.registerElView('autocomplete', AutoCompleteElView);
            return AUTOCOMPLETE;
        }
        AUTOCOMPLETE.initModule = initModule;
        ;
    })(AUTOCOMPLETE = RIAPP.AUTOCOMPLETE || (RIAPP.AUTOCOMPLETE = {}));
})(RIAPP || (RIAPP = {}));
//# sourceMappingURL=autocomplete.js.map


text:
#if !defined(_IN_GASNET_TOOLS_H) && !defined(_IN_GASNET_H) && !defined(_IN_CONFIGURE)
  #error This file is not meant to be included directly- clients should include gasnet.h or gasnet_tools.h
#endif

#ifndef _GASNET_ASM_H
#define _GASNET_ASM_H

#include "portable_platform.h"

#define GASNETI_ASM_AVAILABLE 1
#if PLATFORM_COMPILER_GNU || PLATFORM_COMPILER_INTEL || PLATFORM_COMPILER_PATHSCALE || \
    PLATFORM_COMPILER_TINY || PLATFORM_COMPILER_OPEN64 || PLATFORM_COMPILER_CLANG
  #define GASNETI_ASM(mnemonic) __asm__ __volatile__ (mnemonic : : : "memory")
#elif PLATFORM_COMPILER_PGI
  /* Some definitions:
   *
   * GASNETI_PGI_ASM_GNU
   *   Compiler accepts GNU-style asm() such as asm ("code" : "r" (out) : "r" (in) : "memory");
   *   While pgcc 6.1-1 and pgCC 6.2-2 include full GNU-style asm() support, our inability to
   *   reliably identify either of those version numbers leads to higher actual cut-offs in
   *   some cases.
   *   Implies PLATFORM_COMPILER_PGI
   *
   * GASNETI_PGI_ASM_THREADSAFE
   *   Compiler does not suffer from "tpr 3852" in which "gratuitous" register reloads after
   *   an inline asm() renders the GNU-style asm() support unsuitable for GASNet atomics.
   *   Implies PLATFORM_COMPILER_PGI && GASNETI_PGI_ASM_GNU
   *
   * GASNETI_PGI_ASM_X86_A
   *   Compiler does not suffer from "tpr 3843" in which use of the "A" constraint in a
   *   GNU-style asm() would crash the compiler.  This is applicable only to 32-bit targets,
   *   and the value of this symbol on 64-bit targets is undefined.
   *   Implies PLATFORM_COMPILER_PGI && GASNETI_PGI_ASM_GNU
   *
   * GASNETI_PGI_ASM_BUG1754
   *   Compiler suffers from "tpr 3936" in which promotion of a char variable previously used
   *   as an output of an extended asm() does not zero out bits 8 and higher.  Experiments show
   *   this was probably resolved in 6.2-4.  However, the Portland Group documents this tpr as
   *   resolved in 6.2-5.  So, we use the vendor's more conservative value.
   *   Implies PLATFORM_COMPILER_PGI && GASNETI_PGI_ASM_GNU
   *
   * GASNETI_PGI_ASM_BUG2149
   *   Compiler suffers from "tpr 4336" in which extended asm() register outputs are "lost"
   *   when the "register" qualifier is applied to the output variable.
   *
   * GASNETI_PGI_ASM_BUG2294
   *   Compiler suffers from "tpr 14969" in which extended asm() output constraints can't
   *   be met unless they appear in a specific order.  This is on 32-bit targets only
   *
   * GASNETI_PGI_ASM_BUG2843
   *   Compiler suffers from "tpr 17075" in which extended asm() may load only 32 bits of
   *   a 64-bit operand at -O1 (but is OK at -O0 and -O2).
   *
   * See GASNet bug 1621 (http://upc-bugs.lbl.gov/bugzilla/show_bug.cgi?id=1621) for more
   * info on the bugs indicated by GASNETI_PGI_ASM_THREADSAFE and GASNETI_PGI_ASM_X86_A.
   *
   * See GASNet bugs 1751 and 1753 for discussion related to the difficulty with versioning
   * of the Portland Group compilers.  See also PGI "tpr 3791" and discussion thread
   * http://www.pgroup.com/userforum/viewtopic.php?t=466
   *
   * See GASNet bug 1754 for discussion related to the BUG1754 problem and its symptoms.
   * See also PGI "tpr 3936".
   *
   * See GASNet bug 2149 for discussion related to the BUG2149 problem and its symptoms.
   * See also PGI "tpr 4336".
   *
   * See GASNet bug 2294 for discussion related to the BUG2294 problem and its symptoms.
   * See also PGI "tpr 14969".
   */
  #if (PLATFORM_COMPILER_PGI_C && PLATFORM_COMPILER_VERSION_GE(6,1,1)) || \
      (PLATFORM_COMPILER_PGI_CXX && PLATFORM_COMPILER_VERSION_GE(6,2,2))
    #define GASNETI_PGI_ASM_GNU 1
    #define GASNETI_ASM(mnemonic) __asm__ __volatile__ (mnemonic : : : "memory")
  #else /* note this requires compiler flag -Masmkeyword */
    #define GASNETI_ASM(mnemonic) asm(mnemonic)
  #endif
  #if PLATFORM_COMPILER_VERSION_GE(6,2,2)
    #define GASNETI_PGI_ASM_THREADSAFE 1
    #define GASNETI_PGI_ASM_X86_A 1
  #endif
  #if PLATFORM_COMPILER_VERSION_LT(6,2,5)
    #define GASNETI_PGI_ASM_BUG1754 1
  #endif
  #if PLATFORM_COMPILER_VERSION_GE(7,1,0) && PLATFORM_COMPILER_VERSION_LT(7,1,2)
    #define GASNETI_PGI_ASM_BUG2149 1
  #endif
  #if PLATFORM_ARCH_32 && PLATFORM_COMPILER_VERSION_GE(7,1,5) /* XXX: No end of range yet */
    #define GASNETI_PGI_ASM_BUG2294 1
  #endif
  #if PLATFORM_COMPILER_VERSION_GE(7,0,0) && PLATFORM_COMPILER_VERSION_LT(10,8,0)
    #define GASNETI_PGI_ASM_BUG2843 1
  #endif
  #define GASNETI_ASM_SPECIAL(mnemonic) asm(mnemonic)
#elif PLATFORM_COMPILER_COMPAQ
  #include <c_asm.h>
  #define GASNETI_ASM(mnemonic) asm(mnemonic)
#elif PLATFORM_COMPILER_SUN
  #ifdef __cplusplus
    #if PLATFORM_OS_LINUX
      #define GASNETI_ASM(mnemonic)  asm(mnemonic)
    #else /* Sun C++ on Solaris lacks inline assembly support (man inline) */
      #define GASNETI_ASM(mnemonic)  ERROR_NO_INLINE_ASSEMBLY_AVAIL /* not supported or used */
      #undef GASNETI_ASM_AVAILABLE
    #endif
  #else /* Sun C */
    #define GASNETI_ASM(mnemonic)  __asm(mnemonic)
  #endif
#elif PLATFORM_COMPILER_NEC
  #define GASNETI_ASM(mnemonic)  asm(mnemonic)
#elif PLATFORM_COMPILER_HP_C
  #define GASNETI_ASM(mnemonic)  _asm(mnemonic)
  #if (PLATFORM_COMPILER_VERSION_GE(5,55,0) && PLATFORM_COMPILER_VERSION_LT(6,5,0))
    /* HP's Inline ASM guide documents versions [A.05.55 , A.06.05) as having a
     * buggy implementation of the 16byte atomics; says they should not be used. */
    #define GASNETI_HP_ASM_BAD_16B_ATOMICS 1
  #endif
#elif PLATFORM_COMPILER_SGI || PLATFORM_COMPILER_HP_CXX || PLATFORM_COMPILER_XLC || \
      PLATFORM_COMPILER_CRAY || PLATFORM_COMPILER_MTA || PLATFORM_COMPILER_LCC
  /* platforms where inline assembly not supported or used */
  #define GASNETI_ASM(mnemonic)  ERROR_NO_INLINE_ASSEMBLY_AVAIL
  #undef GASNETI_ASM_AVAILABLE
  #if PLATFORM_COMPILER_CRAY && PLATFORM_ARCH_X86_64
    #include "intrinsics.h"
  #endif
#else
  #error "Don't know how to use inline assembly for your compiler"
#endif

#ifndef GASNETI_ASM_SPECIAL
  #define GASNETI_ASM_SPECIAL GASNETI_ASM
#endif

#if PLATFORM_OS_BGP && (PLATFORM_COMPILER_GNU || PLATFORM_COMPILER_XLC)
  /* These helper macros are required because the *_inline.h headers are broken:
   * + They break __thread support in bgxlc (see bug 2564)
   * + They use "extern inline" in such a way as to require us to link to a
   *   specific runtime library even though we don't use anything from it.
   * Yes, bgxlc does support gnu-style inline asm.
   * XXX: Note that using gnu-style asm w/ bgxlc in the same source file as
   *      __thread will trigger bug 2564.  So, we use mc_func instead.
   */

  /* Read from a Special Purpose Register
   */
  #include <cnk/bgp_SPRG_Usage.h>
  #if PLATFORM_COMPILER_GNU
    #define GASNETI_BGP_SPR(_out, _regnr) \
      __asm__ __volatile__("mfspr %0,%1" : "=r" (_out) : "i" (_regnr) : "memory")
  #elif PLATFORM_COMPILER_XLC
    static uint32_t _gasneti_bgp_mfsprg4(void);
    #pragma mc_func _gasneti_bgp_mfsprg4 { "7c6442a6" /* mfsprg r3,4 */ }
    #pragma reg_killed_by _gasneti_bgp_mfsprg4 /* NONE */

    static uint32_t _gasneti_bgp_mfsprg5(void);
    #pragma mc_func _gasneti_bgp_mfsprg5 { "7c6542a6" /* mfsprg r3,5 */ }
    #pragma reg_killed_by _gasneti_bgp_mfsprg5 /* NONE */

    /* Paranoia in case these should change */
    #if (_BGP_SPRGRO_SHMem != SPRN_SPRG4RO) || \
        (_BGP_SPRGRO_DST2  != SPRN_SPRG5RO)
      #error "SPR assignments have changed or moved!"
    #endif

    #define _gasneti_BGP_SPRGRO_SHMem() _gasneti_bgp_mfsprg4()
    #define _gasneti_BGP_SPRGRO_DST2()  _gasneti_bgp_mfsprg5()
    #define GASNETI_BGP_SPR(_out, _name) \
      ((_out) = _gasneti##_name())
  #else
    #error Unsupported compiler
  #endif

  /* Make a 2-argument bgp-specific syscall.
   */
  #include <cnk/bgp_SysCall_Extensions.h>
  #if PLATFORM_COMPILER_GNU
    #define _GASNETI_BGP_SYSCALL2(_out, _nr, _arg1, _arg2) do { \
      register uint32_t _r0 __asm__("r0") = (_nr);              \
      register uint32_t _r3 __asm__("r3") = (_arg1);            \
      register uint32_t _r4 __asm__("r4") = (_arg2);            \
      __asm__ __volatile__("sc"                                 \
                           : "+r" (_r3)                         \
                           : "r" (_r0), "r" (_r4), "0" (_r3)    \
                           : "cc", "memory");                   \
      (_out) = _r3;                                             \
    } while(0)
    #define GASNETI_BGP_SYSCALL2(_out, _name, _arg1, _arg2) \
      _GASNETI_BGP_SYSCALL2((_out), _BGP_SYSCALL_NR_##_name, (_arg1), (_arg2))
  #elif PLATFORM_COMPILER_XLC
    static uint32_t _gasneti_bgp_syscall2(int nr, uint32_t arg1, uint32_t arg2);
    #pragma mc_func _gasneti_bgp_syscall2 {     \
      /* ARGS: r3 = nr, r4 = arg1, r5 = arg2 */ \
      "7c601b78"      /* mr  r0,r3 */           \
      "7c832378"      /* mr  r3,r4 */           \
      "7ca42b78"      /* mr  r4,r5 */           \
      "44000002"      /* sc        */           \
      /* RETURN in r3 = result of syscall */    \
    }
    /* no "#pragma reg_killed_by" -> default to all volatile regs */
    #define GASNETI_BGP_SYSCALL2(_out, _name, _arg1, _arg2) \
      ((_out) = _gasneti_bgp_syscall2(_BGP_SYSCALL_NR_##_name, (_arg1), (_arg2)))
  #else
    #error Unsupported compiler
  #endif

  #define GASNETI_HAVE_BGP_INLINES 1
#endif

#if PLATFORM_OS_BGQ && (PLATFORM_COMPILER_GNU || PLATFORM_COMPILER_XLC)
  /* The situation on BG/Q is either as bad as on BG/P, or perhaps worse.
   * The use of 'extern inline' means we can't get what we need at all in
   * a debug build.  At least on BG/P there was a lib we could have linked.
   */
  #ifndef __INLINE__
    #if GASNET_DEBUG
      #define GASNETI_DEFINE__INLINE__ static
    #elif defined(__cplusplus)
      #define GASNETI_DEFINE__INLINE__ inline
    #elif GASNETI_COMPILER_IS_CC && defined(GASNET_CC_INLINE_MODIFIER)
      #define GASNETI_DEFINE__INLINE__ GASNET_CC_INLINE_MODIFIER
    #elif GASNETI_COMPILER_IS_MPI_CC && defined(GASNET_MPI_CC_INLINE_MODIFIER)
      #define GASNETI_DEFINE__INLINE__ GASNET_MPI_CC_INLINE_MODIFIER
    #else
      #define GASNETI_DEFINE__INLINE__ static
    #endif
    #define __INLINE__ GASNETI_DEFINE__INLINE__
  #endif
  #include "cnk/include/SPI_syscalls.h"
  #include "hwi/include/bqc/A2_inlines.h"
  #ifdef GASNETI_DEFINE__INLINE__
    #undef __INLINE__
  #endif
  #define GASNETI_HAVE_BGQ_INLINES 1
#endif

#if PLATFORM_ARCH_ARM && PLATFORM_OS_LINUX
  /* This helper macro hides ISA differences going from ARMv4 to ARMv5 */
  #if defined(__thumb__) && !defined(__thumb2__)
    #error "GASNet does not support ARM Thumb1 mode"
    #define GASNETI_ARM_ASMCALL(_tmp, _offset) "choke me"
  #elif defined(__ARM_ARCH_2__)
    #error "GASNet does not support ARM versions earlier than ARMv3"
    #define GASNETI_ARM_ASMCALL(_tmp, _offset) "choke me"
  #elif defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
    #define GASNETI_ARM_ASMCALL(_tmp, _offset) \
	"	mov	" #_tmp ", #0xffff0fff              @ _tmp = base addr    \n" \
	"	mov	lr, pc                              @ lr = return addr    \n" \
	"	sub	pc, " #_tmp ", #" #_offset "        @ call _tmp - _offset \n"
  #else
    #define GASNETI_ARM_ASMCALL(_tmp, _offset) \
	"	mov	" #_tmp ", #0xffff0fff              @ _tmp = base addr    \n" \
	"	sub	" #_tmp ", " #_tmp ", #" #_offset " @ _tmp -= _offset     \n" \
	"	blx	" #_tmp "                           @ call _tmp           \n"
  #endif
#endif

#if PLATFORM_ARCH_MIPS && defined(HAVE_SGIDEFS_H)
  /* For _MIPS_ISA and _MIPS_SIM values on some MIPS platforms */
  #include <sgidefs.h>
#endif

#endif /* _GASNET_ASM_H */


text:
                                 <?php $data = array('class' => 'deleteform');   ?>
                                  <?php echo form_open('library/singlelibrary',$data);?>

                                        <input class="search" type="text" name="name" placeholder="Search library by name" list="librarylist"/>
                                        <input type="hidden" name="source" value="1"/>
                                        <datalist id="librarylist">
                						     <?php foreach ($libraries as $lib): ?>
                						     	<option value="<?= trim($lib['library']) ?>"></option>
                							  <?php endforeach ; ?>
                						</datalist>
                                        <input class="search-button" type="submit" value="" />

                                </form>

                             <?php foreach ($libraries as $lib): ?>

<a href="<?= base_url()?>library/singlelibrary/<?= $lib['library'] ?>/1" class=".libs"  url="<?= $lib['url']?>" title=""><?= $lib['library']?>

                             <?php endforeach ; ?>


text:
/**
 *
 */
package com.pivotal.gemfirexd.internal.engine.locks.impl;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import com.gemstone.gemfire.distributed.internal.deadlock.Dependency;
import com.gemstone.gemfire.distributed.internal.deadlock.DependencyMonitor;
import com.pivotal.gemfirexd.internal.engine.access.GemFireTransaction;
import com.pivotal.gemfirexd.internal.engine.locks.GfxdDRWLockService;
import com.pivotal.gemfirexd.internal.engine.locks.GfxdLocalLockService;
import com.pivotal.gemfirexd.internal.engine.locks.GfxdLocalLockService.DistributedLockOwner;
import com.pivotal.gemfirexd.internal.engine.locks.GfxdLockSet;
import com.pivotal.gemfirexd.internal.engine.locks.GfxdLockable;
import com.pivotal.gemfirexd.internal.engine.locks.GfxdReadWriteLock;
import com.pivotal.gemfirexd.internal.engine.store.GemFireStore;
import com.pivotal.gemfirexd.internal.iapi.services.context.ContextManager;
import com.pivotal.gemfirexd.internal.iapi.services.context.ContextService;
import com.pivotal.gemfirexd.internal.iapi.sql.conn.LanguageConnectionContext;
import com.pivotal.gemfirexd.internal.iapi.store.access.TransactionController;

/**
 * Discovery any locks held or threads waiting on gemfirexd read write
 * locks.
 *
 * @author dsmith
 *
 */
public class GfxdRWLockDependencyMonitor implements DependencyMonitor {

  public static final DependencyMonitor INSTANCE = new GfxdRWLockDependencyMonitor();

  public Set<Dependency<Thread, Serializable>> getBlockedThreads(
      Thread[] allThreads) {
    Set<Dependency<Thread, Serializable>> results = new HashSet<Dependency<Thread, Serializable>>();
    GemFireStore memStore = GemFireStore.getBootedInstance();
    if(memStore == null) {
      return results;
    }
    GfxdDRWLockService ddlService = memStore.getDDLLockService();
    if(ddlService == null) {
      return results;
    }
    GfxdLocalLockService localService = ddlService.getLocalLockService();

    //Get the list of threads in the local VM that are waiting for read for write
    //locks.

    //Note, we may actually be waiting for one of these write locks in a remote VM.
    //However, that remote VMs thread will have a thread parked in this local VM
    //the write lock, and we are already tracking the dependency between that remote
    //thread and the local thread with the message dependency monitor.
    synchronized(localService) {
      for(GfxdReadWriteLock lock : localService.values()) {
        Collection<Thread> blockedThreads = lock.getBlockedThreadsForDebugging();
        for(Thread blocked : blockedThreads) {
          if(lock.getLockName() instanceof Serializable) {
            results.add(new Dependency(blocked, new LockId((Serializable) lock
                .getLockName())));
          }
        }
      }
    }

    return results;
  }

  public Set<Dependency<Serializable, Thread>> getHeldResources(
      Thread[] allThreads) {
    Set<Dependency<Serializable, Thread>> results = new HashSet<Dependency<Serializable, Thread>>();
    GemFireStore memStore = GemFireStore.getBootedInstance();
    if(memStore == null) {
      return results;
    }
    GfxdDRWLockService ddlService = memStore.getDDLLockService();
    if(ddlService == null) {
      return results;
    }
    GfxdLocalLockService localService = ddlService.getLocalLockService();

    //TODO - this code gets write lock holders by inspecting the locks themselves
    //Some of the gfxd code sets a lock owner, and other parts of the code don't
    //set an owner. That code is currently not instrumented here.

    synchronized(localService) {
      for(GfxdReadWriteLock lock : localService.values()) {
        Object owner = lock.getWriteLockOwner();
        Object name = lock.getLockName();
        if(name instanceof Serializable) {
          //Record a dependency if the owner is a thread object.
          if(owner instanceof Thread) {
            results.add(new Dependency<Serializable, Thread>(new LockId((Serializable) name),
                (Thread) owner));
          }

          //Find the owning thread for locks using a DistributedLockOwner object
          if(owner instanceof DistributedLockOwner) {
            DistributedLockOwner dOwner = (DistributedLockOwner) owner;

            //Only record write locks that are held by the local VM
            if(dOwner.getOwnerMember().equals(GemFireStore.getMyId())) {

              //TODO there should be a better way to find the owning thread
              //than this, but this works.
              for(Thread thread: allThreads) {
                if(thread.getId() == dOwner.getOwnerThreadId()) {
                  results.add(new Dependency<Serializable, Thread>(new LockId((Serializable) lock
                      .getLockName()), thread));
                  break;
                }
              }
            }
          }
        }
      }
    }

    //Get the list of read locks that are held in this local VM
    //This code was stolen from GfxdLockService.dumpReadLocks.
    final ContextService service = ContextService.getFactory();
    if(service == null) {
      return results;
    }

    synchronized (service) {
      for (final ContextManager cm : service.getAllContexts()) {
        final LanguageConnectionContext lcc = (LanguageConnectionContext)cm
            .getContext(LanguageConnectionContext.CONTEXT_ID);
        final TransactionController tc;
        final GfxdLockSet lockSet;
        if (lcc != null && (tc = lcc.getTransactionExecute()) != null
            && (lockSet = ((GemFireTransaction)tc).getLockSpace()) != null) {
          Thread thread = cm.getActiveThread();
          if(thread != null) {
            Collection<GfxdLockable> readLocks = lockSet.getReadLocksForDebugging();

            for(GfxdLockable lock : readLocks) {
              if(lock.getName() instanceof Serializable) {
                results.add(new Dependency<Serializable, Thread>(
                    (Serializable) lock.getName(), thread));
              }
            }
          }
        }
      }
    }

    return results;
  }

  /**
   * Private constructor for a singleton.
   */
  private GfxdRWLockDependencyMonitor() {

  }

  private static class LockId implements Serializable {
    private final Serializable tokenName;

    public LockId(Serializable tokenName) {
      this.tokenName = tokenName;
    }

    @Override
    public int hashCode() {
      final int prime = 31;
      int result = 1;
      result = prime * result
          + ((tokenName == null) ? 0 : tokenName.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;
      LockId other = (LockId) obj;
      if (tokenName == null) {
        if (other.tokenName != null)
          return false;
      } else if (!tokenName.equals(other.tokenName))
        return false;
      return true;
    }

    @Override
    public String toString() {
      return "GFXDRWLock(" + tokenName + ")";
    }
  }
}


text:
package hh

import (
	"io/ioutil"
	"testing"
	"time"

	"github.com/influxdb/influxdb/models"
)

type fakeShardWriter struct {
	ShardWriteFn func(shardID, nodeID uint64, points []models.Point) error
}

func (f *fakeShardWriter) WriteShard(shardID, nodeID uint64, points []models.Point) error {
	return f.ShardWriteFn(shardID, nodeID, points)
}

func TestProcessorProcess(t *testing.T) {
	dir, err := ioutil.TempDir("", "processor_test")
	if err != nil {
		t.Fatalf("failed to create temp dir: %v", err)
	}

	// expected data to be queue and sent to the shardWriter
	var expShardID, expNodeID, count = uint64(100), uint64(200), 0
	pt := models.NewPoint("cpu", models.Tags{"foo": "bar"}, models.Fields{"value": 1.0}, time.Unix(0, 0))

	sh := &fakeShardWriter{
		ShardWriteFn: func(shardID, nodeID uint64, points []models.Point) error {
			count += 1
			if shardID != expShardID {
				t.Errorf("Process() shardID mismatch: got %v, exp %v", shardID, expShardID)
			}
			if nodeID != expNodeID {
				t.Errorf("Process() nodeID mismatch: got %v, exp %v", nodeID, expNodeID)
			}

			if exp := 1; len(points) != exp {
				t.Fatalf("Process() points mismatch: got %v, exp %v", len(points), exp)
			}

			if points[0].String() != pt.String() {
				t.Fatalf("Process() points mismatch:\n got %v\n exp %v", points[0].String(), pt.String())
			}

			return nil
		},
	}

	p, err := NewProcessor(dir, sh, ProcessorOptions{MaxSize: 1024})
	if err != nil {
		t.Fatalf("Process() failed to create processor: %v", err)
	}

	// This should queue the writes
	if err := p.WriteShard(expShardID, expNodeID, []models.Point{pt}); err != nil {
		t.Fatalf("Process() failed to write points: %v", err)
	}

	// This should send the write to the shard writer
	if err := p.Process(); err != nil {
		t.Fatalf("Process() failed to write points: %v", err)
	}

	if exp := 1; count != exp {
		t.Fatalf("Process() write count mismatch: got %v, exp %v", count, exp)
	}

	// Queue should be empty so no writes should be send again
	if err := p.Process(); err != nil {
		t.Fatalf("Process() failed to write points: %v", err)
	}

	// Count should stay the same
	if exp := 1; count != exp {
		t.Fatalf("Process() write count mismatch: got %v, exp %v", count, exp)
	}

}


text:
use lib 'lib';
use strict;
use warnings;
use utf8;
use File::Slurp; # From CPAN
use JSON;

use AsposeStorageCloud::StorageApi;
use AsposeStorageCloud::ApiClient;
use AsposeStorageCloud::Configuration;
use AsposeCellsCloud::CellsApi;
use AsposeCellsCloud::ApiClient;
use AsposeCellsCloud::Configuration;

my $configFile = '../Config/config.json';
my $configPropsText = read_file($configFile);
my $configProps = decode_json($configPropsText);
my $data_path = '../../../Data/';
my $out_path = $configProps->{'out_folder'};

$AsposeCellsCloud::Configuration::app_sid = $configProps->{'app_sid'};
$AsposeCellsCloud::Configuration::api_key = $configProps->{'api_key'};
$AsposeCellsCloud::Configuration::debug = 1;
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'};
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'};

# Instantiate Aspose.Storage and Aspose.Cells API SDK
my $storageApi = AsposeStorageCloud::StorageApi->new();
my $cellsApi = AsposeCellsCloud::CellsApi->new();

# Set input file name
my $name = 'Book1.xlsx';
my $sheetName = 'sheet1';
my $startRow = 3;
my $startColumn = 3;
my $totalRows = 1;
my $totalColumns = 1;

# Upload file to aspose cloud storage
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name);

# Invoke Aspose.Cells Cloud SDK API to remove cell area from conditional formatting
$response = $cellsApi->DeleteWorksheetConditionalFormattingArea(name=> $name, sheetName=>$sheetName, startRow=>$startRow,startColumn=>$startColumn,totalRows=>$totalRows,totalColumns=>$totalColumns);
print "\n". $response->{'Body'};
#ExEnd:1


text:
/*eslint no-bitwise: 0*/

'use strict';

const ErrorUtils = require('ErrorUtils');
const Systrace = require('Systrace');

const deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');
const invariant = require('fbjs/lib/invariant');
const stringifySafe = require('stringifySafe');

export type SpyData = {
  type: number,
  module: ?string,
  method: string | number,
  isSync: boolean,
  successCbId: number,
  failCbId: number,
  args: Array<any>,
  returnValue?: any,
};

const TO_JS = 0;
const TO_NATIVE = 1;

const MODULE_IDS = 0;
const METHOD_IDS = 1;
const PARAMS = 2;
const MIN_TIME_BETWEEN_FLUSHES_MS = 5;

const TRACE_TAG_REACT_APPS = 1 << 17;

const DEBUG_INFO_LIMIT = 64;

// Work around an initialization order issue
let JSTimers = null;

class MessageQueue {
  _lazyCallableModules: {[key: string]: (void) => Object};
  _queue: [Array<number>, Array<number>, Array<any>, number];
  _successCallbacks: Array<?Function>;
  _failureCallbacks: Array<?Function>;
  _callID: number;
  _inCall: number;
  _lastFlush: number;
  _eventLoopStartTime: number;

  _debugInfo: Object;
  _remoteModuleTable: Object;
  _remoteMethodTable: Object;

  __spy: ?(data: SpyData) => void;

  constructor() {
    this._lazyCallableModules = {};
    this._queue = [[], [], [], 0];
    this._successCallbacks = [];
    this._failureCallbacks = [];
    this._callID = 0;
    this._lastFlush = 0;
    this._eventLoopStartTime = new Date().getTime();

    if (__DEV__) {
      this._debugInfo = {};
      this._remoteModuleTable = {};
      this._remoteMethodTable = {};
    }
  }

  /**
   * Public APIs
   */
  static spy(spyOrToggle: boolean | ((data: SpyData) => void)) {
    if (spyOrToggle === true) {
      MessageQueue.prototype.__spy = info => {
        console.log(
          `${info.type === TO_JS ? 'N->JS' : 'JS->N'} : ` +
            `${info.module ? info.module + '.' : ''}${info.method}` +
            `(${JSON.stringify(info.args)})`,
        );
      };
    } else if (spyOrToggle === false) {
      MessageQueue.prototype.__spy = null;
    } else {
      MessageQueue.prototype.__spy = spyOrToggle;
    }
  }

  callFunctionReturnFlushedQueue = (
    module: string,
    method: string,
    args: Array<any>,
  ) => {
    this.__guard(() => {
      this.__callFunction(module, method, args);
    });

    return this.flushedQueue();
  };

  callFunctionReturnResultAndFlushedQueue = (
    module: string,
    method: string,
    args: Array<any>,
  ) => {
    let result;
    this.__guard(() => {
      result = this.__callFunction(module, method, args);
    });

    return [result, this.flushedQueue()];
  };

  invokeCallbackAndReturnFlushedQueue = (cbID: number, args: Array<any>) => {
    this.__guard(() => {
      this.__invokeCallback(cbID, args);
    });

    return this.flushedQueue();
  };

  flushedQueue = () => {
    this.__guard(() => {
      this.__callImmediates();
    });

    const queue = this._queue;
    this._queue = [[], [], [], this._callID];
    return queue[0].length ? queue : null;
  };

  getEventLoopRunningTime() {
    return new Date().getTime() - this._eventLoopStartTime;
  }

  registerCallableModule(name: string, module: Object) {
    this._lazyCallableModules[name] = () => module;
  }

  registerLazyCallableModule(name: string, factory: void => Object) {
    let module: Object;
    let getValue: ?(void) => Object = factory;
    this._lazyCallableModules[name] = () => {
      if (getValue) {
        module = getValue();
        getValue = null;
      }
      return module;
    };
  }

  getCallableModule(name: string) {
    const getValue = this._lazyCallableModules[name];
    return getValue ? getValue() : null;
  }

  enqueueNativeCall(
    moduleID: number,
    methodID: number,
    params: Array<any>,
    onFail: ?Function,
    onSucc: ?Function,
  ) {
    if (onFail || onSucc) {
      if (__DEV__) {
        this._debugInfo[this._callID] = [moduleID, methodID];
        if (this._callID > DEBUG_INFO_LIMIT) {
          delete this._debugInfo[this._callID - DEBUG_INFO_LIMIT];
        }
      }
      // Encode callIDs into pairs of callback identifiers by shifting left and using the rightmost bit
      // to indicate fail (0) or success (1)
      onFail && params.push(this._callID << 1);
      onSucc && params.push((this._callID << 1) | 1);
      this._successCallbacks[this._callID] = onSucc;
      this._failureCallbacks[this._callID] = onFail;
    }

    if (__DEV__) {
      global.nativeTraceBeginAsyncFlow &&
        global.nativeTraceBeginAsyncFlow(
          TRACE_TAG_REACT_APPS,
          'native',
          this._callID,
        );
    }
    this._callID++;

    this._queue[MODULE_IDS].push(moduleID);
    this._queue[METHOD_IDS].push(methodID);

    if (__DEV__) {
      // Any params sent over the bridge should be encodable as JSON
      JSON.stringify(params);

      // The params object should not be mutated after being queued
      deepFreezeAndThrowOnMutationInDev((params: any));
    }
    this._queue[PARAMS].push(params);

    const now = new Date().getTime();
    if (
      global.nativeFlushQueueImmediate &&
      (now - this._lastFlush >= MIN_TIME_BETWEEN_FLUSHES_MS ||
        this._inCall === 0)
    ) {
      var queue = this._queue;
      this._queue = [[], [], [], this._callID];
      this._lastFlush = now;
      global.nativeFlushQueueImmediate(queue);
    }
    Systrace.counterEvent('pending_js_to_native_queue', this._queue[0].length);

    if (this.__spy) {
      this.__spyNativeCall(moduleID, methodID, params, {
        failCbId: onFail ? params[params.length - 2] : -1,
        successCbId: onSucc ? params[params.length - 1] : -1,
      });
    }
  }

  callSyncHook(moduleID: number, methodID: number, args: Array<any>) {
    if (__DEV__) {
      invariant(
        global.nativeCallSyncHook,
        'Calling synchronous methods on native ' +
          'modules is not supported in Chrome.\n\n Consider providing alternative ' +
          'methods to expose this method in debug mode, e.g. by exposing constants ' +
          'ahead-of-time.',
      );
    }
    const returnValue = global.nativeCallSyncHook(moduleID, methodID, args);
    if (this.__spy) {
      this.__spyNativeCall(moduleID, methodID, args, {
        isSync: true,
        returnValue,
      });
    }
    return returnValue;
  }

  createDebugLookup(moduleID: number, name: string, methods: Array<string>) {
    if (__DEV__) {
      this._remoteModuleTable[moduleID] = name;
      this._remoteMethodTable[moduleID] = methods;
    }
  }

  /**
   * Private methods
   */

  __guard(fn: () => void) {
    this._inCall++;
    try {
      fn();
    } catch (error) {
      ErrorUtils.reportFatalError(error);
    } finally {
      this._inCall--;
    }
  }

  __callImmediates() {
    Systrace.beginEvent('JSTimers.callImmediates()');
    if (!JSTimers) {
      JSTimers = require('JSTimers');
    }
    JSTimers.callImmediates();
    Systrace.endEvent();
  }

  __callFunction(module: string, method: string, args: Array<any>) {
    this._lastFlush = new Date().getTime();
    this._eventLoopStartTime = this._lastFlush;
    Systrace.beginEvent(`${module}.${method}()`);
    if (this.__spy) {
      this.__spyJSCall(module, method, args);
    }
    const moduleMethods = this.getCallableModule(module);
    invariant(
      !!moduleMethods,
      'Module %s is not a registered callable module (calling %s)',
      module,
      method,
    );
    invariant(
      !!moduleMethods[method],
      'Method %s does not exist on module %s',
      method,
      module,
    );
    const result = moduleMethods[method].apply(moduleMethods, args);
    Systrace.endEvent();
    return result;
  }

  __invokeCallback(cbID: number, args: Array<any>) {
    this._lastFlush = new Date().getTime();
    this._eventLoopStartTime = this._lastFlush;

    // The rightmost bit of cbID indicates fail (0) or success (1), the other bits are the callID shifted left.
    const callID = cbID >>> 1;
    const isSuccess = cbID & 1;
    const callback = isSuccess
      ? this._successCallbacks[callID]
      : this._failureCallbacks[callID];

    if (__DEV__) {
      const debug = this._debugInfo[callID];
      const module = debug && this._remoteModuleTable[debug[0]];
      const method = debug && this._remoteMethodTable[debug[0]][debug[1]];
      if (!callback) {
        let errorMessage = `Callback with id ${cbID}: ${module}.${method}() not found`;
        if (method) {
          errorMessage =
            `The callback ${method}() exists in module ${module}, ` +
            'but only one callback may be registered to a function in a native module.';
        }
        invariant(callback, errorMessage);
      }
      const profileName = debug
        ? '<callback for ' + module + '.' + method + '>'
        : cbID + '';
      if (this.__spy) {
        this.__spyJSCall(null, profileName, args, {
          failCbId: isSuccess ? -1 : cbID,
          successCbId: isSuccess ? cbID : -1,
        });
      }
      Systrace.beginEvent(
        `MessageQueue.invokeCallback(${profileName}, ${stringifySafe(args)})`,
      );
    }

    if (!callback) {
      return;
    }

    this._successCallbacks[callID] = this._failureCallbacks[callID] = null;
    callback.apply(null, args);

    if (__DEV__) {
      Systrace.endEvent();
    }
  }

  __spyJSCall(
    module: ?string,
    method: string,
    methodArgs: Array<any>,
    params: any,
  ) {
    if (!this.__spy) {
      return;
    }
    this.__spy({
      type: TO_JS,
      isSync: false,
      module,
      method,
      failCbId: -1,
      successCbId: -1,
      args: methodArgs,
      ...params,
    });
  }

  __spyNativeCall(
    moduleID: number,
    methodID: number,
    methodArgs: Array<any>,
    params: any,
  ) {
    const spy = this.__spy;
    if (!spy) {
      return;
    }

    let moduleName = moduleID + '';
    let methodName = methodID;
    if (__DEV__ && isFinite(moduleID)) {
      moduleName = this._remoteModuleTable[moduleID];
      methodName = this._remoteMethodTable[moduleID][methodID];
    }

    spy({
      type: TO_NATIVE,
      isSync: false,
      module: moduleName,
      method: methodName,
      failCbId: -1,
      successCbId: -1,
      args: methodArgs,
      ...params,
    });
  }
}

module.exports = MessageQueue;


text:
import os

import fiona
import numpy as np
import six

from geopandas import GeoDataFrame

# Adapted from pandas.io.common
if six.PY3:
    from urllib.request import urlopen as _urlopen
    from urllib.parse import urlparse as parse_url
    from urllib.parse import uses_relative, uses_netloc, uses_params
else:
    from urllib2 import urlopen as _urlopen
    from urlparse import urlparse as parse_url
    from urlparse import uses_relative, uses_netloc, uses_params

_VALID_URLS = set(uses_relative + uses_netloc + uses_params)
_VALID_URLS.discard('')

def _is_url(url):
    """Check to see if *url* has a valid protocol."""
    try:
        return parse_url(url).scheme in _VALID_URLS
    except:
        return False

def read_file(filename, **kwargs):
    """
    Returns a GeoDataFrame from a file or URL.

    Parameters
    ----------
    filename: str
        Either the absolute or relative path to the file or URL to
        be opened.
    **kwargs:
        Keyword args to be passed to the `open` or `BytesCollection` method
        in the fiona library when opening the file. For more information on
        possible keywords, type:
        ``import fiona; help(fiona.open)``

    Examples
    --------
    >>> df = geopandas.read_file("nybb.shp")

    Returns
    -------
    geodataframe : GeoDataFrame
    """
    bbox = kwargs.pop('bbox', None)
    if _is_url(filename):
        req = _urlopen(filename)
        path_or_bytes = req.read()
        reader = fiona.BytesCollection
    else:
        path_or_bytes = filename
        reader = fiona.open
    with reader(path_or_bytes, **kwargs) as f:
        crs = f.crs
        if bbox is not None:
            assert len(bbox) == 4
            f_filt = f.filter(bbox=bbox)
        else:
            f_filt = f
        gdf = GeoDataFrame.from_features(f_filt, crs=crs)
        # re-order with column order from metadata, with geometry last
        columns = list(f.meta["schema"]["properties"]) + ["geometry"]
        gdf = gdf[columns]

    return gdf

def to_file(df, filename, driver="ESRI Shapefile", schema=None,
            **kwargs):
    """
    Write this GeoDataFrame to an OGR data source

    A dictionary of supported OGR providers is available via:
    >>> import fiona
    >>> fiona.supported_drivers

    Parameters
    ----------
    df : GeoDataFrame to be written
    filename : string
        File path or file handle to write to.
    driver : string, default 'ESRI Shapefile'
        The OGR format driver used to write the vector file.
    schema : dict, default None
        If specified, the schema dictionary is passed to Fiona to
        better control how the file is written. If None, GeoPandas
        will determine the schema based on each column's dtype

    The *kwargs* are passed to fiona.open and can be used to write
    to multi-layer data, store data within archives (zip files), etc.
    """
    if schema is None:
        schema = infer_schema(df)
    filename = os.path.abspath(os.path.expanduser(filename))
    with fiona.drivers():
        with fiona.open(filename, 'w', driver=driver, crs=df.crs,
                        schema=schema, **kwargs) as colxn:
            for feature in df.iterfeatures():
                colxn.write(feature)

def infer_schema(df):
    try:
        from collections import OrderedDict
    except ImportError:
        from ordereddict import OrderedDict

    def convert_type(in_type):
        if in_type == object:
            return 'str'
        out_type = type(np.asscalar(np.zeros(1, in_type))).__name__
        if out_type == 'long':
            out_type = 'int'
        return out_type

    properties = OrderedDict([
        (col, convert_type(_type)) for col, _type in
        zip(df.columns, df.dtypes) if col != df._geometry_column_name
    ])

    geom_type = _common_geom_type(df)
    if not geom_type:
        raise ValueError("Geometry column cannot contain mutiple "
                         "geometry types when writing to file.")

    schema = {'geometry': geom_type, 'properties': properties}

    return schema

def _common_geom_type(df):
    # Need to check geom_types before we write to file...
    # Some (most?) providers expect a single geometry type:
    # Point, LineString, or Polygon
    geom_types = df.geometry.geom_type.unique()

    from os.path import commonprefix   # To find longest common prefix
    geom_type = commonprefix([g[::-1] for g in geom_types if g])[::-1]  # Reverse
    if not geom_type:
        geom_type = None

    return geom_type


text:
package com.ckz.baisi.animator;

import android.animation.ObjectAnimator;
import android.view.View;

/**
 * Created by CKZ on 2017/3/13.
 */

public class SendAnimator {

    public static void aniIn(View view){
        ObjectAnimator animator = ObjectAnimator.ofFloat(view,"translationY",-2000, 300,0);
        animator.setDuration(600);
        animator.start();
    }
    public static void aniOut(View view){
        ObjectAnimator animator = ObjectAnimator.ofFloat(view,"translationY",0,-300, 2000);
        animator.setDuration(600);
        animator.start();
    }
}


text: {{ home.title }}


text:
package com.zeppamobile.smartfollow.relationship;

import it.uniroma1.lcl.adw.ADW;
import it.uniroma1.lcl.adw.DisambiguationMethod;
import it.uniroma1.lcl.adw.ItemType;
import it.uniroma1.lcl.adw.comparison.SignatureComparison;
import it.uniroma1.lcl.adw.comparison.WeightedOverlap;

import java.io.File;
import java.util.List;

import com.zeppamobile.smartfollow.Constants;
import com.zeppamobile.smartfollow.Utils;

import net.sf.extjwnl.JWNLException;
import net.sf.extjwnl.data.IndexWord;
import net.sf.extjwnl.data.POS;
import net.sf.extjwnl.data.PointerType;
import net.sf.extjwnl.data.Synset;
import net.sf.extjwnl.data.relationship.Relationship;

public class Testing {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		/*
		IndexWord w1 = null, w2 = null;
		try {
			w1 = Constants.getDictionary().lookupIndexWord(POS.NOUN, "carrot");
			w2 = Constants.getDictionary().lookupIndexWord(POS.NOUN, "broccoli");
		} catch (JWNLException e) {
			e.printStackTrace();
		}

		Synset s1 = w1.getSenses().get(0);
		Synset s2 = w2.getSenses().get(0);

		long start = System.currentTimeMillis();
		Relationship r = RelationshipFinder.getShallowestRelationship(s1, s2);
		long finish = System.currentTimeMillis();

		System.out.println("Operation required " + (finish-start) + " milliseconds");
		System.out.println(r.getNodeList().toString());
		System.out.println(r.getDepth());
	*/

		System.out.println("Working Directory = " +
	              System.getProperty("user.dir"));

		ADW pipeLine = new ADW();

		//the two lexical items
		String text1 = "soccer#n";
		String text2 = "football#n";

		//types of the lexical items (set as auto-detect)
		ItemType text1Type = ItemType.SURFACE_TAGGED;
		ItemType text2Type = ItemType.SURFACE_TAGGED;

		//measure for comparing semantic signatures
		SignatureComparison measure = new WeightedOverlap();

		long start = System.currentTimeMillis();

	  	//calculate the similarity of text1 and text2
		double similarity = pipeLine.getPairSimilarity(
		    text1, text2,
		    DisambiguationMethod.ALIGNMENT_BASED,
		    measure,
		    text1Type, text2Type);

		long finish = System.currentTimeMillis();

		//print out the similarity
		System.out.println(similarity);

		System.out.println("Operation elapsed " + (finish - start) + " milliseconds");

	}

}


text:
import numpy as np
from scipy.sparse import linalg

class ReservoirTuner():
    def tune(self, reservoir):
        raise NotImplementedError()

class SpectralRadiusSetter(ReservoirTuner):
    def __init__(self, rho_objectif, k=6):
        self._rho = rho_objectif
        self._k = k

    def tune(self, reservoir):
        #rho_max = np.max(np.abs(linalg.eig(reservoir._W)[0]))
        rho_max = np.max(np.abs(linalg.eigs(reservoir._W, k=self._k)[0]))
        reservoir._W *= self._rho / rho_max

class RemoveInputBias(ReservoirTuner):
    def tune(self, reservoir):
        reservoir._Win[0, :] = np.zeros(reservoir._W[0, :].shape)

#TODO: implements "improving reservoir with intrisic plasticity", Schrauwen
class IntrisicPlasiticty(ReservoirTuner):
    pass


text:
<?xml version="1.0" encoding="utf-8"?>
<menu
  xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
    <item android:id="@id/invoke_instabug_menu_item" android:title="@string/feedbackheader" app:showAsAction="never" />
</menu>


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

using CwIRC;
using MBFunctionInterface;
using MBUtilities;

namespace Utility
{
    /// <summary>
    /// A Function which returns messages sent to a user, when that user says something in the bot's presence.
    /// </summary>
    public class TellAuto : Function
    {
        public TellAuto()
        {
            Help = "Automatic function that will output messages sent to a particular user when that user speaks.";
            Type = Types.UserList;
            AccessLevel = AccessLevels.Anyone;
        }

        public override List<IRCResponse> GetResponse(BotMessage message)
        {
            if (message.Type != "PRIVMSG")
                return null;

            List<IRCResponse> responses = new List<IRCResponse>();

            List<string> keysToDelete = new List<string>();
            Dictionary<string, List<Tell.TellMessage>> keysToKeep = new Dictionary<string, List<Tell.TellMessage>>();

            lock (Tell.tellMapLock)
            {
                foreach (KeyValuePair<string, List<Tell.TellMessage>> kvp in Tell.MessageMap)
                {
                    if (Regex.IsMatch(message.User.Name, kvp.Key, RegexOptions.IgnoreCase))
                    {
                        foreach (Tell.TellMessage msg in kvp.Value)
                        {
                            if (msg.Target == "PM" || msg.Target == message.ReplyTo)
                            {
                                responses.Add(new IRCResponse(ResponseType.Say, message.User.Name + ": " + msg.Message, msg.Target == "PM" ? message.User.Name : msg.Target));
                                responses.Add(new IRCResponse(ResponseType.Say, "^ from " + msg.From + " on " + msg.SentDate, msg.Target == "PM" ? message.User.Name : msg.Target));
                            }
                            else
                            {
                                if (!keysToKeep.ContainsKey(kvp.Key))
                                    keysToKeep.Add(kvp.Key, new List<Tell.TellMessage>());
                                keysToKeep[kvp.Key].Add(msg);
                            }
                        }

                        keysToDelete.Add(kvp.Key);
                    }
                }
                foreach (string key in keysToDelete)
                {
                    Tell.MessageMap[key].Clear();
                    Tell.MessageMap.Remove(key);
                }
                Tell.MessageMap = Tell.MessageMap.Concat(keysToKeep).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
            }

            if (responses.Count == 0)
                return null;

            Tell.WriteMessages();

            return responses;
        }
    }
}


text:
#ifndef NE_LOCKS_H
#define NE_LOCKS_H

#include "ne_request.h" /* for ne_session + ne_request */
#include "ne_uri.h" /* for ne_uri */

NE_BEGIN_DECLS

/* The scope of a lock */
enum ne_lock_scope {
    ne_lockscope_exclusive,
    ne_lockscope_shared
};

/* Lock type. Only write locks are defined in RFC2518. */
enum ne_lock_type {
    ne_locktype_write
};

/* A lock object. */
struct ne_lock {
    ne_uri uri;
    int depth; /* the depth of the lock (NE_DEPTH_*). */
    enum ne_lock_type type;
    enum ne_lock_scope scope;
    char *token; /* the lock token: uniquely identifies this lock. */
    char *owner; /* string describing the owner of the lock. */
    long timeout; /* timeout in seconds. (or NE_TIMEOUT_*) */
};
/* NB: struct ne_lock Would be typedef'ed to ne_lock except lock is
 * a verb and a noun, so we already have ne_lock the function. Damn
 * the English language. */

#define NE_TIMEOUT_INFINITE -1
#define NE_TIMEOUT_INVALID -2

/* Create a depth zero, exclusive write lock, with default timeout
 * (allowing a server to pick a default).  token, owner and uri are
 * unset. */
struct ne_lock *ne_lock_create(void);

/* HINT: to initialize uri host/port/scheme for the lock's URI, use
 * ne_fill_server_uri from ne_session.h. */

/* Deep-copy a lock structure: strdup's any of path, token, owner,
 * hostport which are set. */
struct ne_lock *ne_lock_copy(const struct ne_lock *lock);

/* Free a lock structure; free's any of any of the URI, token and
 * owner which are set, but not the lock object itself. */
void ne_lock_free(struct ne_lock *lock);

/* Like ne_lock_free; but free's the lock object itself too. */
void ne_lock_destroy(struct ne_lock *lock);

/* ne_lock_store: an opaque type which is used to store a set of lock
 * objects. */
typedef struct ne_lock_store_s ne_lock_store;

/* Create a lock store. */
ne_lock_store *ne_lockstore_create(void);

/* Register the lock store 'store' with the HTTP session 'sess': any
 * operations made using 'sess' which operate on a locked resource,
 * can use the locks from 'store' if needed. */
void ne_lockstore_register(ne_lock_store *store, ne_session *sess);

/* Destroy a lock store, free'ing any locks remaining inside. */
void ne_lockstore_destroy(ne_lock_store *store);

/* Add a lock to the store: the store then "owns" the lock object, and
 * you must not free it. The lock MUST have all of:
 *  - a completed URI structure: scheme, host, port, and path all set
 *  - a valid lock token
 *  - a valid depth
 */
void ne_lockstore_add(ne_lock_store *store, struct ne_lock *lock);

/* Remove given lock object from store: 'lock' MUST point to a lock
 * object which is known to be in the store. */
void ne_lockstore_remove(ne_lock_store *store, struct ne_lock *lock);

/* Returns the first lock in the lock store, or NULL if the store is
 * empty. */
struct ne_lock *ne_lockstore_first(ne_lock_store *store);

/* After ne_lockstore_first has been called; returns the next lock in
 * the lock store, or NULL if there are no more locks stored.
 * Behaviour is undefined if ne_lockstore_first has not been called on
 * 'store' since the store was created, or the last time this function
 * returned NULL for the store.. */
struct ne_lock *ne_lockstore_next(ne_lock_store *store);

/* Find a lock in the store for the given server, and with the given
 * path. */
struct ne_lock *ne_lockstore_findbyuri(ne_lock_store *store,
				       const ne_uri *uri);

/* Issue a LOCK request for the given lock.  Requires that the uri,
 * depth, type, scope, and timeout members of 'lock' are filled in.
 * owner and token must be malloc-allocated if not NULL; and may be
 * free()d by this function.  On successful return, lock->token will
 * contain the lock token. */
int ne_lock(ne_session *sess, struct ne_lock *lock);

/* Issue an UNLOCK request for the given lock */
int ne_unlock(ne_session *sess, const struct ne_lock *lock);

/* Refresh a lock. Updates lock->timeout appropriately. */
int ne_lock_refresh(ne_session *sess, struct ne_lock *lock);

/* Callback for lock discovery.  If 'lock' is NULL, something went
 * wrong performing lockdiscovery for the resource, look at 'status'
 * for the details.
 *
 * If lock is non-NULL, at least lock->uri and lock->token will be
 * filled in; and status will be NULL. */
typedef void (*ne_lock_result)(void *userdata, const struct ne_lock *lock,
			       const ne_uri *uri, const ne_status *status);

/* Perform lock discovery on the given path.  'result' is called with
 * the results (possibly >1 times).  */
int ne_lock_discover(ne_session *sess, const char *path,
		     ne_lock_result result, void *userdata);

/* The ne_lock_using_* functions should be used before dispatching a
 * request which modify resources.  If a lock store has been
 * registered with the session associated with the request, and locks
 * are present in the lock store which cover the resources which are
 * being modified by the request, then the appropriate lock tokens are
 * submitted in the request headers. */

/* Indicate that request 'req' will modify the resource at 'path', and
 * is an operation of given 'depth'. */
void ne_lock_using_resource(ne_request *req, const char *path, int depth);

/* Indicate that request 'req' will modify the parent collection of
 * the resource found at 'path' (for instance when removing the
 * resource from the collection). */
void ne_lock_using_parent(ne_request *req, const char *path);

NE_END_DECLS

#endif /* NE_LOCKS_H */


text:
chrome.app.runtime.onLaunched.addListener(function (launchData) {
  // Check that there is no launch data.
  chrome.test.runTests([
    function testIntent() {
      chrome.test.assertTrue(!launchData, "LaunchData found");
      chrome.test.succeed();
    }
  ]);
});


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Nemo.Reflection;
using Nemo.Extensions;

namespace Nemo.Validation
{
    public static class ValidationExtensions
    {
        /// <summary>
        /// Validate method implements property validation based on attributes
        /// </summary>
        /// <returns>
        /// Returns a dictionary of properties and error messages
        /// </returns>
        public static ValidationResult Validate<T>(this T dataEntity)
            where T : class
        {
            // Get properties and build a property map
            var properties = Reflector.GetAllProperties<T>();

            var errors = from prop in properties
                         from attribute in prop.GetCustomAttributes(typeof(ValidationAttribute), false).Cast<ValidationAttribute>()
                         where !IsValid(dataEntity, prop.Name, prop.PropertyType, attribute)
                         select new ValidationError
                         {
                             PropertyName = prop.Name,
                             ErrorMessage = attribute.FormatErrorMessage(string.Join(" ", Regex.Split(prop.Name, "(?=[A-Z])"))),
                             TargetInstance = dataEntity,
                             ValidationType = attribute.GetValidationType(),
                             SeverityType = attribute is ISeverityTypeProvider ? ((ISeverityTypeProvider)attribute).SeverityType : SeverityType.Error
                         };

            return new ValidationResult(errors.GroupBy(e => e.PropertyName).ToDictionary(g => g.Key, g => g.ToList()));
        }

        public static string GetValidationType(this ValidationAttribute attribute)
        {
            string attributeName = attribute.GetType().Name;
            return attributeName.EndsWith("Attribute") ? attributeName.Substring(0, attributeName.Length - 9) : attributeName;
        }

        private static bool IsValid(object dataEntity, string propertyName, Type propertyType, ValidationAttribute attribute)
        {
            object value;
            var compareAttribute = attribute as CompareAttribute;
            if (compareAttribute != null)
            {
                value = new[] { dataEntity.Property(propertyName), dataEntity.Property(compareAttribute.PropertyName) };
            }
            else if (attribute is CustomAttribute)
            {
                value = new[] { new CustomValidatorContext(dataEntity, propertyName, attribute), dataEntity.Property(propertyName) };
            }
            else if (attribute is XmlSchemaAttribute && !string.IsNullOrEmpty(((XmlSchemaAttribute)attribute).SchemaProperty))
            {
                value = new[] { dataEntity.Property(propertyName), dataEntity.Property(((XmlSchemaAttribute)attribute).SchemaProperty) };
            }
            else
            {
                if (!dataEntity.PropertyTryGet(propertyName, out value) || Convert.IsDBNull(value))
                {
                    value = propertyType.GetDefault();
                }
            }
            return attribute.IsValid(value);
        }

        internal static void SetErrorMessage(this ValidationAttribute attribute)
        {
            var provider = attribute as IResourceKeyProvider;

            if (provider == null) return;

            var resourceKeyProvider = provider;

            if (string.IsNullOrEmpty(resourceKeyProvider.ResourceKey)) return;

            var errorMessage = string.Empty;
            if (!string.IsNullOrEmpty(errorMessage) && attribute.ErrorMessage == null)
            {
                attribute.ErrorMessage = errorMessage;
            }
        }
    }
}


text:
<?php

namespace Symfony\Component\Translation\Tests\Dumper;

use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\Dumper\IniFileDumper;

class IniFileDumperTest extends \PHPUnit_Framework_TestCase
{
    public function testDump()
    {
        $catalogue = new MessageCatalogue('en');
        $catalogue->add(array('foo' => 'bar'));

        $tempDir = sys_get_temp_dir();
        $dumper = new IniFileDumper();
        $dumper->dump($catalogue, array('path' => $tempDir));

        $this->assertEquals(file_get_contents(__DIR__ . '/../fixtures/resources.ini'), file_get_contents($tempDir . '/messages.en.ini'));

        unlink($tempDir . '/messages.en.ini');
    }
}


text:
package org.pentaho.di.trans.step.mqtt;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.pentaho.di.core.Props;
import org.pentaho.di.core.annotations.PluginDialog;
import org.pentaho.di.core.exception.KettleStepException;
import org.pentaho.di.core.plugins.PluginInterface;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.pentaho.di.core.plugins.StepPluginType;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaBase;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.di.trans.step.BaseStepMeta;
import org.pentaho.di.trans.step.StepDialogInterface;
import org.pentaho.di.ui.core.ConstUI;
import org.pentaho.di.ui.core.gui.GUIResource;
import org.pentaho.di.ui.core.widget.ComboVar;
import org.pentaho.di.ui.core.widget.TextVar;
import org.pentaho.di.ui.trans.step.BaseStepDialog;

import java.util.List;

import static com.google.common.base.Strings.nullToEmpty;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.AUTOMATIC_RECONNECT;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.CLEAN_SESSION;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.CONNECTION_TIMEOUT;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.KEEP_ALIVE_INTERVAL;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.MAX_INFLIGHT;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.MQTT_VERSION;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.SERVER_URIS;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.STORAGE_LEVEL;

@SuppressWarnings ( "unused" )
@PluginDialog ( id = "MQTTProducer", image = "MQTTProducer.svg", pluginType = PluginDialog.PluginType.STEP )
public class MQTTProducerDialog extends BaseStepDialog implements StepDialogInterface {
  private static final int SHELL_MIN_WIDTH = 527;
  private static final int SHELL_MIN_HEIGHT = 650;
  private static final int INPUT_WIDTH = 350;

  private static Class<?> PKG = MQTTProducerDialog.class;

  private MQTTProducerMeta meta;
  private ModifyListener lsMod;
  private TextVar wMqttServer;
  private TextVar wClientId;
  private TextVar wTopic;
  private ComboVar wQOS;
  private ComboVar wMessageField;
  private CTabFolder wTabFolder;

  private MqttDialogSecurityLayout securityLayout;
  private MqttDialogOptionsLayout optionsLayout;

  public MQTTProducerDialog( Shell parent, Object in, TransMeta transMeta, String stepname ) {
    super( parent, (BaseStepMeta) in, transMeta, stepname );
    meta = (MQTTProducerMeta) in;
  }

  @Override
  public String open() {
    Shell parent = getParent();
    Display display = parent.getDisplay();
    changed = meta.hasChanged();

    lsMod = e -> meta.setChanged();
    lsCancel = e -> cancel();
    lsOK = e -> ok();
    lsDef = new SelectionAdapter() {
      public void widgetDefaultSelected( SelectionEvent e ) {
        ok();
      }
    };

    shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE );
    props.setLook( shell );
    setShellImage( shell, meta );
    shell.setMinimumSize( SHELL_MIN_WIDTH, SHELL_MIN_HEIGHT );
    shell.setText( BaseMessages.getString( PKG, "MQTTProducerDialog.Shell.Title" ) );

    Label wicon = new Label( shell, SWT.RIGHT );
    wicon.setImage( getImage() );
    FormData fdlicon = new FormData();
    fdlicon.top = new FormAttachment( 0, 0 );
    fdlicon.right = new FormAttachment( 100, 0 );
    wicon.setLayoutData( fdlicon );
    props.setLook( wicon );

    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = 15;
    formLayout.marginHeight = 15;
    shell.setLayout( formLayout );
    shell.addShellListener( new ShellAdapter() {
      public void shellClosed( ShellEvent e ) {
        cancel();
      }
    } );

    wlStepname = new Label( shell, SWT.RIGHT );
    wlStepname.setText( BaseMessages.getString( PKG, "MQTTProducerDialog.Stepname.Label" ) );
    props.setLook( wlStepname );
    fdlStepname = new FormData();
    fdlStepname.left = new FormAttachment( 0, 0 );
    fdlStepname.top = new FormAttachment( 0, 0 );
    wlStepname.setLayoutData( fdlStepname );

    wStepname = new Text( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    wStepname.setText( stepname );
    props.setLook( wStepname );
    wStepname.addModifyListener( lsMod );
    fdStepname = new FormData();
    fdStepname.width = 250;
    fdStepname.left = new FormAttachment( 0, 0 );
    fdStepname.top = new FormAttachment( wlStepname, 5 );
    wStepname.setLayoutData( fdStepname );
    wStepname.addSelectionListener( lsDef );

    Label topSeparator = new Label( shell, SWT.HORIZONTAL | SWT.SEPARATOR );
    FormData fdSpacer = new FormData();
    fdSpacer.height = 2;
    fdSpacer.left = new FormAttachment( 0, 0 );
    fdSpacer.top = new FormAttachment( wStepname, 15 );
    fdSpacer.right = new FormAttachment( 100, 0 );
    topSeparator.setLayoutData( fdSpacer );

    // Start of tabbed display
    wTabFolder = new CTabFolder( shell, SWT.BORDER );
    props.setLook( wTabFolder, Props.WIDGET_STYLE_TAB );
    wTabFolder.setSimple( false );
    wTabFolder.setUnselectedCloseVisible( true );

    wCancel = new Button( shell, SWT.PUSH );
    wCancel.setText( BaseMessages.getString( PKG, "System.Button.Cancel" ) );
    FormData fdCancel = new FormData();
    fdCancel.right = new FormAttachment( 100, 0 );
    fdCancel.bottom = new FormAttachment( 100, 0 );
    wCancel.setLayoutData( fdCancel );
    wCancel.addListener( SWT.Selection, lsCancel );

    wOK = new Button( shell, SWT.PUSH );
    wOK.setText( BaseMessages.getString( PKG, "System.Button.OK" ) );
    FormData fdOk = new FormData();
    fdOk.right = new FormAttachment( wCancel, -5 );
    fdOk.bottom = new FormAttachment( 100, 0 );
    wOK.setLayoutData( fdOk );
    wOK.addListener( SWT.Selection, lsOK );

    Label bottomSeparator = new Label( shell, SWT.HORIZONTAL | SWT.SEPARATOR );
    props.setLook( bottomSeparator );
    FormData fdBottomSeparator = new FormData();
    fdBottomSeparator.height = 2;
    fdBottomSeparator.left = new FormAttachment( 0, 0 );
    fdBottomSeparator.bottom = new FormAttachment( wCancel, -15 );
    fdBottomSeparator.right = new FormAttachment( 100, 0 );
    bottomSeparator.setLayoutData( fdBottomSeparator );

    FormData fdTabFolder = new FormData();
    fdTabFolder.left = new FormAttachment( 0, 0 );
    fdTabFolder.top = new FormAttachment( topSeparator, 15 );
    fdTabFolder.bottom = new FormAttachment( bottomSeparator, -15 );
    fdTabFolder.right = new FormAttachment( 100, 0 );
    wTabFolder.setLayoutData( fdTabFolder );

    buildSetupTab();

    securityLayout = new MqttDialogSecurityLayout(
      props, wTabFolder, meta.getUsername(), meta.getPassword(), lsMod, transMeta,
      meta.getSslConfig(), meta.isUseSsl() );
    securityLayout.buildSecurityTab();

    optionsLayout = new MqttDialogOptionsLayout( props, wTabFolder, lsMod, transMeta,
      meta.retrieveOptions() );
    optionsLayout.buildTab();

    getData();

    setSize();

    meta.setChanged( changed );

    wTabFolder.setSelection( 0 );

    shell.open();
    while ( !shell.isDisposed() ) {
      if ( !display.readAndDispatch() ) {
        display.sleep();
      }
    }

    return stepname;
  }

  private void buildSetupTab() {
    CTabItem wSetupTab = new CTabItem( wTabFolder, SWT.NONE );
    wSetupTab.setText( BaseMessages.getString( PKG, "MQTTProducerDialog.SetupTab" ) );

    Composite wSetupComp = new Composite( wTabFolder, SWT.NONE );
    props.setLook( wSetupComp );
    FormLayout setupLayout = new FormLayout();
    setupLayout.marginHeight = 15;
    setupLayout.marginWidth = 15;
    wSetupComp.setLayout( setupLayout );

    Label wlMqttServer = new Label( wSetupComp, SWT.LEFT );
    props.setLook( wlMqttServer );
    wlMqttServer.setText( BaseMessages.getString( PKG, "MQTTProducerDialog.Connection" ) );
    FormData fdlBootstrapServers = new FormData();
    fdlBootstrapServers.left = new FormAttachment( 0, 0 );
    fdlBootstrapServers.top = new FormAttachment( 0, 0 );
    fdlBootstrapServers.right = new FormAttachment( 0, INPUT_WIDTH );
    wlMqttServer.setLayoutData( fdlBootstrapServers );

    wMqttServer = new TextVar( transMeta, wSetupComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wMqttServer );
    wMqttServer.addModifyListener( lsMod );
    FormData fdBootstrapServers = new FormData();
    fdBootstrapServers.left = new FormAttachment( 0, 0 );
    fdBootstrapServers.top = new FormAttachment( wlMqttServer, 5 );
    fdBootstrapServers.right = new FormAttachment( 0, INPUT_WIDTH );
    wMqttServer.setLayoutData( fdBootstrapServers );

    Label wlClientId = new Label( wSetupComp, SWT.LEFT );
    props.setLook( wlClientId );
    wlClientId.setText( BaseMessages.getString( PKG, "MQTTProducerDialog.ClientId" ) );
    FormData fdlClientId = new FormData();
    fdlClientId.left = new FormAttachment( 0, 0 );
    fdlClientId.top = new FormAttachment( wMqttServer, 10 );
    fdlClientId.right = new FormAttachment( 50, 0 );
    wlClientId.setLayoutData( fdlClientId );

    wClientId = new TextVar( transMeta, wSetupComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wClientId );
    wClientId.addModifyListener( lsMod );
    FormData fdClientId = new FormData();
    fdClientId.left = new FormAttachment( 0, 0 );
    fdClientId.top = new FormAttachment( wlClientId, 5 );
    fdClientId.right = new FormAttachment( 0, INPUT_WIDTH );
    wClientId.setLayoutData( fdClientId );

    Label wlTopic = new Label( wSetupComp, SWT.LEFT );
    props.setLook( wlTopic );
    wlTopic.setText( BaseMessages.getString( PKG, "MQTTProducerDialog.Topic" ) );
    FormData fdlTopic = new FormData();
    fdlTopic.left = new FormAttachment( 0, 0 );
    fdlTopic.top = new FormAttachment( wClientId, 10 );
    fdlTopic.width = 200;
    wlTopic.setLayoutData( fdlTopic );

    wTopic = new TextVar( transMeta, wSetupComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wTopic );
    wTopic.addModifyListener( lsMod );
    FormData fdTopic = new FormData();
    fdTopic.left = new FormAttachment( 0, 0 );
    fdTopic.top = new FormAttachment( wlTopic, 5 );
    fdTopic.width = 200;
    wTopic.setLayoutData( fdTopic );

    Label wlQOS = new Label( wSetupComp, SWT.LEFT );
    props.setLook( wlQOS );
    wlQOS.setText( BaseMessages.getString( PKG, "MQTTProducerDialog.QOS" ) );
    FormData fdlQOS = new FormData();
    fdlQOS.left = new FormAttachment( wlTopic, 15 );
    fdlQOS.top = new FormAttachment( wClientId, 10 );
    fdlQOS.width = 120;
    wlQOS.setLayoutData( fdlQOS );

    wQOS = new ComboVar( transMeta, wSetupComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wQOS );
    wQOS.addModifyListener( lsMod );
    FormData fdQOS = new FormData();
    fdQOS.left = new FormAttachment( wTopic, 15 );
    fdQOS.top = new FormAttachment( wlQOS, 5 );
    fdQOS.width = 135;
    wQOS.setLayoutData( fdQOS );
    wQOS.add( "0" );
    wQOS.add( "1" );
    wQOS.add( "2" );

    Label wlMessageField = new Label( wSetupComp, SWT.LEFT );
    props.setLook( wlMessageField );
    wlMessageField.setText( BaseMessages.getString( PKG, "MQTTProducerDialog.MessageField" ) );
    FormData fdlMessageField = new FormData();
    fdlMessageField.left = new FormAttachment( 0, 0 );
    fdlMessageField.top = new FormAttachment( wTopic, 10 );
    fdlMessageField.right = new FormAttachment( 50, 0 );
    wlMessageField.setLayoutData( fdlMessageField );

    wMessageField = new ComboVar( transMeta, wSetupComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
    props.setLook( wMessageField );
    wMessageField.addModifyListener( lsMod );
    FormData fdMessageField = new FormData();
    fdMessageField.left = new FormAttachment( 0, 0 );
    fdMessageField.top = new FormAttachment( wlMessageField, 5 );
    fdMessageField.right = new FormAttachment( 0, INPUT_WIDTH );
    wMessageField.setLayoutData( fdMessageField );
    Listener lsMessageFocus = e -> {
      String current = wMessageField.getText();
      wMessageField.getCComboWidget().removeAll();
      wMessageField.setText( current );
      try {
        RowMetaInterface rmi = transMeta.getPrevStepFields( meta.getParentStepMeta().getName() );
        List ls = rmi.getValueMetaList();
        for ( Object l : ls ) {
          ValueMetaBase vmb = (ValueMetaBase) l;
          wMessageField.add( vmb.getName() );
        }
      } catch ( KettleStepException ex ) {
        // do nothing
      }
    };
    wMessageField.getCComboWidget().addListener( SWT.FocusIn, lsMessageFocus );

    FormData fdSetupComp = new FormData();
    fdSetupComp.left = new FormAttachment( 0, 0 );
    fdSetupComp.top = new FormAttachment( 0, 0 );
    fdSetupComp.right = new FormAttachment( 100, 0 );
    fdSetupComp.bottom = new FormAttachment( 100, 0 );
    wSetupComp.setLayoutData( fdSetupComp );
    wSetupComp.layout();
    wSetupTab.setControl( wSetupComp );
  }

  @Override
  public void setSize() {
    setSize( shell );  // sets shell location and preferred size
    shell.setMinimumSize( SHELL_MIN_WIDTH, SHELL_MIN_HEIGHT  );
    shell.setSize(  SHELL_MIN_WIDTH, SHELL_MIN_HEIGHT   ); // force initial size
  }

  private void getData() {
    wMqttServer.setText( nullToEmpty( meta.getMqttServer() ) );
    wClientId.setText( nullToEmpty( meta.getClientId() ) );
    wTopic.setText( nullToEmpty( meta.getTopic() ) );
    wQOS.setText( nullToEmpty( meta.getQOS() ) );
    wMessageField.setText( nullToEmpty( meta.getMessageField() ) );
    securityLayout.setUIText();
  }

  private void cancel() {
    meta.setChanged( false );
    dispose();
  }

  private void ok() {
    stepname = wStepname.getText();
    meta.setMqttServer( wMqttServer.getText() );
    meta.setClientId( wClientId.getText() );
    meta.setTopic( wTopic.getText() );
    meta.setQOS( wQOS.getText() );
    meta.setMessageField( wMessageField.getText() );
    meta.setUsername( securityLayout.username() );
    meta.setPassword( securityLayout.password() );
    meta.setUseSsl( securityLayout.useSsl() );
    meta.setSslConfig( securityLayout.sslConfig() );

    optionsLayout.retrieveOptions().stream()
      .forEach( option -> {
        switch ( option.getKey() ) {
          case KEEP_ALIVE_INTERVAL:
            meta.setKeepAliveInterval( option.getValue() );
            break;
          case MAX_INFLIGHT:
            meta.setMaxInflight( option.getValue() );
            break;
          case CONNECTION_TIMEOUT:
            meta.setConnectionTimeout( option.getValue() );
            break;
          case CLEAN_SESSION:
            meta.setCleanSession( option.getValue() );
            break;
          case STORAGE_LEVEL:
            meta.setStorageLevel( option.getValue() );
            break;
          case SERVER_URIS:
            meta.setServerUris( option.getValue() );
            break;
          case MQTT_VERSION:
            meta.setMqttVersion( option.getValue() );
            break;
          case AUTOMATIC_RECONNECT:
            meta.setAutomaticReconnect( option.getValue() );
            break;
        }
      } );

    dispose();
  }

  private Image getImage() {
    PluginInterface plugin =
      PluginRegistry.getInstance().getPlugin( StepPluginType.class, stepMeta.getStepMetaInterface() );
    String id = plugin.getIds()[ 0 ];
    if ( id != null ) {
      return GUIResource.getInstance().getImagesSteps().get( id ).getAsBitmapForSize( shell.getDisplay(),
        ConstUI.LARGE_ICON_SIZE, ConstUI.LARGE_ICON_SIZE );
    }
    return null;
  }
}


text:
module Cms
  module Taggable
    module ActiveRecordExtensions
      module ClassMethods

      end

      module InstanceMethods
        def initialize_url_fragment
          if self.respond_to?(:url_fragment) && self.respond_to?(:url_fragment=)
            self.url_fragment = self.name.parameterize if self.url_fragment.blank?
          end
        end

        def to_param
          fragment = nil
          if self.respond_to?(:url_fragment) && self.url_fragment.present?
            fragment = self.url_fragment
          end

          fragment ||= self.id.to_s

          return fragment
        end
      end
    end
  end
end

ActiveRecord::Base.send(:extend, Cms::Articles::ActiveRecordExtensions::ClassMethods)
ActiveRecord::Base.send(:include, Cms::Articles::ActiveRecordExtensions::InstanceMethods)


text:
require_relative '../../../spec_helper'

RSpec.describe Lobster::Users::UserBase do

  describe '#alias' do
    subject(:user) { build(:user_base, name: 'Joe') }
    subject { user.alias }

    it 'is a String' do
      is_expected.to be_a String
    end

    it 'is frozen' do
      is_expected.to be_frozen
    end

    it 'is the expected value' do
      is_expected.to eq 'Joe'
    end
  end

  describe '#new' do
    it 'rejects a nil alias' do
      expect { Lobster::Users::UserBase.new(nil) }.to raise_error ArgumentError
    end

    it 'rejects a non-string alias' do
      expect { Lobster::Users::UserBase.new(5) }.to raise_error ArgumentError
    end
  end

end