text:
package org.networklibrary.core.types;

public class EdgeDelete {

	protected long id;

	public EdgeDelete(long id) {
		super();
		this.id = id;
	}

	public long getId() {
		return id;
	}

}


text:
Fast developer server for displaying markdown and others

Working in resolving the unsecure dependencies!

![extending](https://img.shields.io/badge/stability-extending-orange.svg)
[![npm-version](https://img.shields.io/npm/v/fast-devel-server.svg)](https://npmjs.org/package/fast-devel-server)
[![downloads](https://img.shields.io/npm/dm/fast-devel-server.svg)](https://npmjs.org/package/fast-devel-server)
[![build](https://img.shields.io/travis/codenautas/fast-devel-server/master.svg)](https://travis-ci.org/codenautas/fast-devel-server)
[![climate](https://img.shields.io/codeclimate/github/codenautas/fast-devel-server.svg)](https://codeclimate.com/github/codenautas/fast-devel-server)
[![dependencies](https://img.shields.io/david/codenautas/fast-devel-server.svg)](https://david-dm.org/codenautas/fast-devel-server)
[![qa-control](http://codenautas.com/github/codenautas/fast-devel-server.svg)](http://codenautas.com/github/codenautas/fast-devel-server)

language: ![English](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-en.png)
also available in:
[![Spanish](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-es.png)](LEEME.md)

## Install

```sh
$ npm install fast-devel-server
```

## USAGE

```js
npm start
```

And then use your navigator for rendering or viewing and auto refresh your data

![in your navigator put http://localhost:54321/auto/your-package/examples/example.txt](https://raw.githubusercontent.com/codenautas/fast-devel-server/master/examples/example.png)

***You don't need to press F5!***

## License

[MIT](LICENSE)

redpajama_set_name: RedPajamaGithub


text:
/**
 *
 */
package weibo4j.examples.timeline;

import java.util.Iterator;
import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

import weibo4j.Comment;
import weibo4j.Relation;
import weibo4j.Repost;
import weibo4j.Status;
import weibo4j.Tag;
import weibo4j.User;
import weibo4j.Weibo;

/**
 * @author sina
 *
 */
public class GetRepostRelation {
	/**
	 * 获取用户发布的微博信息列表
	 * @param args
	 */
	public static void main(String[] args) {
		System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
    	System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);

		try {
    		Configuration cfg = new Configuration();
    	    SessionFactory sf = cfg.configure().buildSessionFactory();
    	    Session session =sf.openSession();
    	    Transaction tx=session.beginTransaction();
		try {
			//获取24小时内前20条用户的微博信息;args[2]:用户ID
			Weibo weibo = getWeibo(true,args);
			List<Status> statuses = weibo.getUserTimeline(args[2]);
			User user1 = new User();//发微博人id,被转发人
			for (Status status : statuses) {

				System.out.println(status.getText());

				status.setUserId(args[2]);//微博原创者的用户id
				status.setUserName(status.getUser().getName());//微博原创者的用户姓名

        		StringBuilder ids = new StringBuilder();
        		ids.append(status.getId()).append(',');

				//User user1 = new User();//发微博人id,被转发人
				user1.setId(args[2]);
				user1.setName(status.getUser().getName());
				user1.setLocation(status.getUser().getLocation());
				user1.setFollowersCount(status.getUser().getFollowersCount());
				user1.setFriendsCount(status.getUser().getFriendsCount());
				user1.setStatusesCount(status.getUser().getStatusesCount());
				System.out.println("原创人发的微博数:"+status.getUser().getStatusesCount());

	        	List <Status> Repost =  weibo.getreposttimeline(String.valueOf(status.getId()));

	        	for(Status repost:Repost){
	        	//System.out.println(status.toString());
	        	System.out.println("转发人id,name:"+repost.getUser().getId()+","+repost.getUser().getName());
	        	System.out.println("被转发人(原创人)id,name:"+args[2]+","+user1.getName());
	        	System.out.println("被转发微博id:"+status.getId());
	        	System.out.println("被转发微博内容:"+status.getText());
	        	//System.out.println("评论内容+"+repost.getText());
	        	//System.out.println("转发时间+"+repost.getCreatedAt());

	            List<Tag> gettags=getWeibo(true,args).gettags(repost.getUser().getId());
	            String tags ="";
	        	for(Tag tag : gettags) {
	        		 tags=tags+tag.toString();
	        		System.out.println(tag);
	        	}
	        	System.out.println("转发人User2's tags:"+tags);

				User user2 = new User();//转发人id
				user2.setId(repost.getUser().getId());
				user2.setName(repost.getUser().getName());
				user2.setLocation(repost.getUser().getLocation());
				user2.setTags(tags);
				user2.setFollowersCount(repost.getUser().getFollowersCount());
				user2.setFriendsCount(repost.getUser().getFriendsCount());
				user2.setStatusesCount(repost.getUser().getStatusesCount());

				if(user2.getId()==user1.getId())
				{
					//user2.setStatusesCount(status.getUser().getStatusesCount());
					System.out.println("是同一个人"+","+"发的微博数:"+status.getUser().getStatusesCount());
				}else
				{
					user2.setStatusesCount(repost.getUser().getStatusesCount());
					System.out.println("不是同一个人"+","+"发的微博数:"+user2.getStatusesCount());
				}

				//新建转发类对象
				Repost rep=new Repost();
				rep.setUser1Id(user1.getId());
				rep.setUser1Name(user1.getName());
				rep.setUser2Id(user2.getId());
				rep.setUser2Name(user2.getName());
				rep.setRepost_time(repost.getCreatedAt());
				rep.setStatusId(status.getId());
				rep.setStatusText(status.getText());
				//rep.setCommentsText(repost.getText());

				boolean isCommented=false;
        		List<Comment> comments = weibo.getComments(String.valueOf(status.getId()));
        		for(Comment comment : comments) {

				if(repost.getCreatedAt().equals(comment.getCreatedAt()))
				{
					rep.setCommented(true);
				rep.setCommentsText(repost.getText());
				System.out.println("转发时间:"+repost.getCreatedAt());
				System.out.println("评论时间:"+comment.getCreatedAt());
				System.out.println("评论人"+comment.getUser().getId());
				System.out.println("转发人"+rep.getUser2Id());
				System.out.println("评论内容:"+rep.getCommentsText());

				System.out.println("转发的详细内容为:"+rep.toString());

				}else
				{
					//rep.setCommentsText(null);
					/*
					System.out.println("转发时间:"+repost.getCreatedAt());
					System.out.println("评论时间:"+comment.getCreatedAt());
					System.out.println("评论人"+comment.getUser().getId());
					System.out.println("转发人"+rep.getUser2Id());
					System.out.println("评论内容:"+rep.getCommentsText());

					System.out.println("转发的详细内容为:"+rep.toString());
					*/
				}
        		}

				Relation relation = new Relation();
				relation.setUser1Id(user1.getId());
				relation.setUser1Name(user1.getName());
				relation.setUser2Id(user2.getId());
				relation.setUser2Name(user2.getName());
				//re.setCommentsNum(0);
				System.out.println("初始rtNum: " + relation.getRtNum());

				String user1Id=String.valueOf(relation.getUser1Id());
				String user2Id=String.valueOf(relation.getUser2Id());

				System.out.println("user1Id: " + user1Id);
				System.out.println("user2Id: " + user2Id);

				//数据库的save操作
				//session.saveOrUpdate(user1);
        	    if(user1.getId()==user2.getId())
        	    {}
        	    else
        	    {
        	    	System.out.println("save评论人");
        	    session.merge(user2);
        	    }
        	    System.out.println("save转发表");
        	    session.saveOrUpdate(rep);

        	    String hql="from weibo4j.Relation relation where (relation.user1Id=:user1Id and relation.user2Id=:user2Id) or (relation.user1Id=:user2Id and relation.user2Id=:user1Id)";
        	    Query query = session.createQuery(hql);
           	    query.setString("user1Id",user1Id);
           	    query.setString("user2Id",user2Id);

           	    List<Relation> list1 = query.list();
           	    Iterator itr = list1.iterator();
           	    int rtNum=0;
           	    int rtAndCommentNum=0;

           	if(itr.hasNext()){
           		if(rep.isCommented())
           		{

         	       System.out.println("relation表不为空,在getComment类中已保存过,不再保存");
         	       /*
       		       relation=(Relation)itr.next();
       		       rtAndCommentNum=relation.getRtAndCommentNum();
       		       rtAndCommentNum++;
    	    	   relation.setRtAndCommentNum(rtAndCommentNum);
        	       session.merge(relation);
        	       System.out.println("存之后的rtAndCommentNum1: " + relation.getRtAndCommentNum());
        	       */

        	     } else
            		{
           	        System.out.println("relation表不为空,只存转发数");
          		    relation=(Relation)itr.next();
          		    rtNum=relation.getRtNum();
          		    rtNum++;
       	    	    relation.setRtNum(rtNum);
           	        session.saveOrUpdate(relation);
           	        System.out.println("存之后的rtNum1: " + relation.getRtNum());
      	     }
           	}
           	else {
           		if(rep.isCommented())
           		{

         	        System.out.println("relation表为空,在getComment类中已保存过,不再保存");
         	        /*
       	            relation.setRtAndCommentNum(1);
                	session.merge(relation);
                	System.out.println("存之后的rtAndCommentNum0: " + relation.getRtAndCommentNum());
                	 */

                 }else
                 {
             	    System.out.println("relation表为空,只存转发数");
           	        relation.setRtNum(1);
                    session.saveOrUpdate(relation);
                    System.out.println("存之后的rtNum0: " + relation.getRtNum());
                 }

           	}
	        }//for(Status repost:Repost)
				System.out.println("*********************************************************************");

			}//for (Status status : statuses)

		} catch (Exception e) {
			e.printStackTrace();
		}
		tx.commit();
		session.close();
		//sf.close();
	} catch (HibernateException e) {
		e.printStackTrace();
	}
		System.out.println("repost保存完成!");
	}

	private static Weibo getWeibo(boolean isOauth,String[] args) {
		Weibo weibo = new Weibo();
		if(isOauth) {//oauth验证方式 args[0]:访问的token;args[1]:访问的密匙
			weibo.setToken(args[0], args[1]);
		}else {//用户登录方式
    		weibo.setUserId(args[0]);//用户名/ID
    		weibo.setPassword(args[1]);//密码
		}
		return weibo;
	}

}


text:
<?php

?>
<?php

/**
 * TicketsStatus form base class.
 *
 * @method TicketsStatus getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseTicketsStatusForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'name'          => new sfWidgetFormInputText(),
      'group'         => new sfWidgetFormInputText(),
      'sort_order'    => new sfWidgetFormInputText(),
      'default_value' => new sfWidgetFormInputText(),
      'active'        => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'name'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'group'         => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'sort_order'    => new sfValidatorInteger(array('required' => false)),
      'default_value' => new sfValidatorInteger(array('required' => false)),
      'active'        => new sfValidatorString(array('max_length' => 1, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('tickets_status[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'TicketsStatus';
  }

}


text:
using System;
using System.Threading;
using System.Globalization;

namespace Problem_1_Math_Expression
{
    class Program
    {
        static void Main(string[] args)
        {
            // Setting invariant culture to avoid problems with floating point
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            // Read N
            string nAsString = Console.ReadLine();
            decimal N = decimal.Parse(nAsString);

            // Read M
            string mAsString = Console.ReadLine();
            decimal M = decimal.Parse(mAsString);

            // Read P
            string pAsString = Console.ReadLine();
            decimal P = decimal.Parse(pAsString);

            // Calculating expression
            decimal result =
                (N * N + (1 / (M * P)) + 1337) /
                (N - 128.523123123M * P)
                + (decimal)Math.Sin((int)M % 180);

            // Write the result to the console
            Console.WriteLine("{0:0.000000}", result);
        }
    }
}


text:
using System;
using System.Collections;

using PervasiveDigital.Utilities;

namespace PervasiveDigital.Net.Azure.Storage
{
    public class CloudStorageAccount
    {
        public string AccountName { get; set; }
        public string AccountKey { get; set; }
        public Hashtable UriEndpoints { get; set; }

        public CloudStorageAccount(string accountName, string accountKey, Hashtable uriEndpoints)
        {
            AccountName = accountName;
            AccountKey = accountKey;
            UriEndpoints = uriEndpoints;

            //checkUriEndpoints
            //must be 3 known keys (Blob, Queue, Table)
            //must not end with a trailing slash
        }

        public CloudStorageAccount(string accountName, string accountKey) : this (accountName,accountKey,GetDefaultUriEndpoints(accountName))
        {
        }

        private static Hashtable GetDefaultUriEndpoints(string accountName)
        {
            var defaults = new Hashtable(3);
            defaults.Add("Blob", StringUtilities.Format("http://{0}.blob.core.windows.net", accountName));
            defaults.Add("Queue", StringUtilities.Format("http://{0}.queue.core.windows.net", accountName));
            defaults.Add("Table", StringUtilities.Format("http://{0}.table.core.windows.net", accountName));
            return defaults;
        }

        public static CloudStorageAccount Parse(string connectionString)
        {
            throw new NotImplementedException();
        }
    }
}


text:
#include <aws/cloudfront/model/InvalidationSummary.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

#include <utility>

using namespace Aws::Utils::Xml;
using namespace Aws::Utils;

namespace Aws
{
namespace CloudFront
{
namespace Model
{

InvalidationSummary::InvalidationSummary() :
    m_idHasBeenSet(false),
    m_createTimeHasBeenSet(false),
    m_statusHasBeenSet(false)
{
}

InvalidationSummary::InvalidationSummary(const XmlNode& xmlNode) :
    m_idHasBeenSet(false),
    m_createTimeHasBeenSet(false),
    m_statusHasBeenSet(false)
{
  *this = xmlNode;
}

InvalidationSummary& InvalidationSummary::operator =(const XmlNode& xmlNode)
{
  XmlNode resultNode = xmlNode;

  if(!resultNode.IsNull())
  {
    XmlNode idNode = resultNode.FirstChild("Id");
    if(!idNode.IsNull())
    {
      m_id = StringUtils::Trim(idNode.GetText().c_str());
      m_idHasBeenSet = true;
    }
    XmlNode createTimeNode = resultNode.FirstChild("CreateTime");
    if(!createTimeNode.IsNull())
    {
      m_createTime = DateTime(StringUtils::Trim(createTimeNode.GetText().c_str()).c_str(), DateFormat::ISO_8601);
      m_createTimeHasBeenSet = true;
    }
    XmlNode statusNode = resultNode.FirstChild("Status");
    if(!statusNode.IsNull())
    {
      m_status = StringUtils::Trim(statusNode.GetText().c_str());
      m_statusHasBeenSet = true;
    }
  }

  return *this;
}

void InvalidationSummary::AddToNode(XmlNode& parentNode) const
{
  Aws::StringStream ss;
  if(m_idHasBeenSet)
  {
   XmlNode idNode = parentNode.CreateChildElement("Id");
   idNode.SetText(m_id);
  }

  if(m_createTimeHasBeenSet)
  {
     XmlNode createTimeNode = parentNode.CreateChildElement("CreateTime");
     createTimeNode.SetText(m_createTime.ToGmtString(DateFormat::ISO_8601));
  }

  if(m_statusHasBeenSet)
  {
   XmlNode statusNode = parentNode.CreateChildElement("Status");
   statusNode.SetText(m_status);
  }

}

} // namespace Model
} // namespace CloudFront
} // namespace Aws


text:
//Apache2, 2012, Hernan J Gonzalez, https://github.com/leonbloy/pngcs

namespace Hjg.Pngcs.Zlib
{
    // DEFLATE compression strategy
    public enum EDeflateCompressStrategy
    {
        Filtered,
        Huffman,
        Default
    }
}


text:
package simpleframework;

import battlecode.common.Direction;
import battlecode.common.GameActionException;
import battlecode.common.RobotController;

public class SoldierHandler extends RobotHandler {

	protected SoldierHandler(RobotController rc) {
		super(rc);
		// TODO Auto-generated constructor stub
	}

	@Override
	protected void doTheThing() throws GameActionException {
		if (rc.isCoreReady()) {
			if (!attackNearby()) {
				// move randomly
				Direction moveDir = findRandomMoveDirection();
				if (moveDir != null) {
					rc.move(moveDir);
				}
			}
		}
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:shareInterpolator="false"
    android:fillAfter="true" >
    <translate android:duration="1000" android:fromXDelta="-100%" android:toXDelta="0%"/>
</set>


text:
class AddAttachmentFotoToInscricoes < ActiveRecord::Migration
  def self.up
    change_table :inscricoes do |t|
      t.attachment :foto
    end
  end

  def self.down
    remove_attachment :inscricoes, :foto
  end
end


text:
class CreateScifindingCredentials < ActiveRecord::Migration
  def change
    create_table :scifinding_credentials do |t|
      t.string :username
      t.string :encrypted_password
      t.string :encrypted_current_token
      t.string :encrypted_refreshed_token
      t.datetime :token_expires_at
      t.datetime :token_requested_at
      t.timestamps null: false
    end unless ActiveRecord::Base.connection.table_exists? "scifinding_credentials"
  end
end


text:
import benchexec.tools.template
import benchexec.result as result

class Tool(benchexec.tools.template.BaseTool2):
    """
    Tool info for MLB
    (https://github.com/MLB-SE/Experiment).
    """

    def executable(self, tool_locator):
        return tool_locator.find_executable("run.sh")

    def version(self, executable):
        return self._version_from_tool(executable, arg="-version")

    def name(self):
        return "MLB"

    def cmdline(self, executable, options, task, rlimits):
        cmd = [executable]
        if options:
            cmd = cmd + options
        if task.property_file:
            cmd.append(task.property_file)
        return cmd + list(task.input_files_or_identifier)

    def determine_result(self, run):
        # parse output
        status = result.RESULT_ERROR
        for line in run.output:
            if "==> FALSE" in line:
                status = result.RESULT_FALSE_PROP
            elif "==> TRUE" in line:
                status = result.RESULT_TRUE_PROP
            elif "==> UNKNOWN" in line:
                status = result.RESULT_UNKNOWN

        return status


text:
import sys

from keystone.common import cms
from oslo_config import cfg
from oslo_log import log
from oslo_serialization import jsonutils
from oslo_utils import importutils
from oslo_utils import timeutils
import six

from keystone.common import controller
from keystone.common import dependency
from keystone.common import wsgi
from keystone import config
from keystone.models import token_model
from keystone import exception
from keystone.i18n import _, _LI, _LW
from keystone.resource import controllers as resource_controllers

LOG = log.getLogger(__name__)

CONF = cfg.CONF

# registry of authentication methods
AUTH_METHODS = {}
AUTH_PLUGINS_LOADED = False

def load_auth_methods():
    global AUTH_PLUGINS_LOADED

    if AUTH_PLUGINS_LOADED:
        # Only try and load methods a single time.
        return
    # config.setup_authentication should be idempotent, call it to ensure we
    # have setup all the appropriate configuration options we may need.
    config.setup_authentication()
    for plugin in CONF.auth.methods:
        if '.' in plugin:
            # NOTE(morganfainberg): if '.' is in the plugin name, it should be
            # imported rather than used as a plugin identifier.
            plugin_class = plugin
            driver = importutils.import_object(plugin)
            if not hasattr(driver, 'method'):
                raise ValueError(_('Cannot load an auth-plugin by class-name '
                                   'without a "method" attribute defined: %s'),
                                 plugin_class)

            LOG.info(_LI('Loading auth-plugins by class-name is deprecated.'))
            plugin_name = driver.method
        else:
            plugin_name = plugin
            plugin_class = CONF.auth.get(plugin)
            driver = importutils.import_object(plugin_class)
        if plugin_name in AUTH_METHODS:
            raise ValueError(_('Auth plugin %(plugin)s is requesting '
                               'previously registered method %(method)s') %
                             {'plugin': plugin_class, 'method': driver.method})
        AUTH_METHODS[plugin_name] = driver
    AUTH_PLUGINS_LOADED = True

def get_auth_method(method_name):
    global AUTH_METHODS
    if method_name not in AUTH_METHODS:
        raise exception.AuthMethodNotSupported()
    return AUTH_METHODS[method_name]

class AuthContext(dict):
    """Retrofitting auth_context to reconcile identity attributes.

    The identity attributes must not have conflicting values among the
    auth plug-ins. The only exception is `expires_at`, which is set to its
    earliest value.

    """

    # identity attributes need to be reconciled among the auth plugins
    IDENTITY_ATTRIBUTES = frozenset(['user_id', 'project_id',
                                     'access_token_id', 'domain_id',
                                     'expires_at'])

    def __setitem__(self, key, val):
        if key in self.IDENTITY_ATTRIBUTES and key in self:
            existing_val = self[key]
            if key == 'expires_at':
                # special treatment for 'expires_at', we are going to take
                # the earliest expiration instead.
                if existing_val != val:
                    LOG.info(_LI('"expires_at" has conflicting values '
                                 '%(existing)s and %(new)s.  Will use the '
                                 'earliest value.'),
                             {'existing': existing_val, 'new': val})
                if existing_val is None or val is None:
                    val = existing_val or val
                else:
                    val = min(existing_val, val)
            elif existing_val != val:
                msg = _('Unable to reconcile identity attribute %(attribute)s '
                        'as it has conflicting values %(new)s and %(old)s') % (
                            {'attribute': key,
                             'new': val,
                             'old': existing_val})
                raise exception.Unauthorized(msg)
        return super(AuthContext, self).__setitem__(key, val)

# TODO(blk-u): this class doesn't use identity_api directly, but makes it
# available for consumers. Consumers should probably not be getting
# identity_api from this since it's available in global registry, then
# identity_api should be removed from this list.
@dependency.requires('identity_api', 'resource_api')
class AuthInfo(object):
    """Encapsulation of "auth" request."""

    @staticmethod
    def create(context, auth=None):
        auth_info = AuthInfo(context, auth=auth)
        auth_info._validate_and_normalize_auth_data()
        return auth_info

    def __init__(self, context, auth=None):
        self.context = context
        self.auth = auth
        self._scope_data = (None, None, None, None)
        # self._scope_data is (domain_id, project_id, unscoped)
        # project scope: (None, project_id, None, None)
        # domain scope: (domain_id, None, None, None)
        # unscoped: (None, None, None, 'unscoped')

    def _assert_project_is_enabled(self, project_ref):
        # ensure the project is enabled
        try:
            self.resource_api.assert_project_enabled(
                project_id=project_ref['id'],
                project=project_ref)
        except AssertionError as e:
            LOG.warning(six.text_type(e))
            six.reraise(exception.Unauthorized, exception.Unauthorized(e),
                        sys.exc_info()[2])

    def _assert_domain_is_enabled(self, domain_ref):
        try:
            self.resource_api.assert_domain_enabled(
                domain_id=domain_ref['id'],
                domain=domain_ref)
        except AssertionError as e:
            LOG.warning(six.text_type(e))
            six.reraise(exception.Unauthorized, exception.Unauthorized(e),
                        sys.exc_info()[2])

    def _lookup_domain(self, domain_info):
        domain_id = domain_info.get('id')
        domain_name = domain_info.get('name')
        domain_ref = None
        if not domain_id and not domain_name:
            raise exception.ValidationError(attribute='id or name',
                                            target='domain')
        try:
            if domain_name:
                domain_ref = self.resource_api.get_domain_by_name(
                    domain_name)
            else:
                domain_ref = self.resource_api.get_domain(domain_id)
        except exception.DomainNotFound as e:
            LOG.exception(six.text_type(e))
            raise exception.Unauthorized(e)
        self._assert_domain_is_enabled(domain_ref)
        return domain_ref

    def _lookup_project(self, project_info):
        project_id = project_info.get('id')
        project_name = project_info.get('name')
        project_ref = None
        if not project_id and not project_name:
            raise exception.ValidationError(attribute='id or name',
                                            target='project')
        try:
            if project_name:
                if 'domain' not in project_info:
                    raise exception.ValidationError(attribute='domain',
                                                    target='project')
                domain_ref = self._lookup_domain(project_info['domain'])
                project_ref = self.resource_api.get_project_by_name(
                    project_name, domain_ref['id'])
            else:
                project_ref = self.resource_api.get_project(project_id)
                # NOTE(morganfainberg): The _lookup_domain method will raise
                # exception.Unauthorized if the domain isn't found or is
                # disabled.
                self._lookup_domain({'id': project_ref['domain_id']})
        except exception.ProjectNotFound as e:
            raise exception.Unauthorized(e)
        self._assert_project_is_enabled(project_ref)
        return project_ref

    def _validate_and_normalize_scope_data(self):
        """Validate and normalize scope data."""
        if 'scope' not in self.auth:
            return
        if sum(['project' in self.auth['scope'],
                'domain' in self.auth['scope'],
                'unscoped' in self.auth['scope']]) != 1:
            raise exception.ValidationError(
                attribute='project, domain or unscoped',
                target='scope')
        if 'unscoped' in self.auth['scope']:
            self._scope_data = (None, None, 'unscoped')
            return
        if 'project' in self.auth['scope']:
            project_ref = self._lookup_project(self.auth['scope']['project'])
            self._scope_data = (None, project_ref['id'], None)
        elif 'domain' in self.auth['scope']:
            domain_ref = self._lookup_domain(self.auth['scope']['domain'])
            self._scope_data = (domain_ref['id'], None, None)

    def _validate_auth_methods(self):
        if 'identity' not in self.auth:
            raise exception.ValidationError(attribute='identity',
                                            target='auth')

        # make sure auth methods are provided
        if 'methods' not in self.auth['identity']:
            raise exception.ValidationError(attribute='methods',
                                            target='identity')

        # make sure all the method data/payload are provided
        for method_name in self.get_method_names():
            if method_name not in self.auth['identity']:
                raise exception.ValidationError(attribute=method_name,
                                                target='identity')

        # make sure auth method is supported
        for method_name in self.get_method_names():
            if method_name not in AUTH_METHODS:
                raise exception.AuthMethodNotSupported()

    def _validate_and_normalize_auth_data(self):
        """Make sure "auth" is valid."""
        # make sure "auth" exist
        if not self.auth:
            raise exception.ValidationError(attribute='auth',
                                            target='request body')

        self._validate_auth_methods()
        self._validate_and_normalize_scope_data()

    def get_method_names(self):
        """Returns the identity method names.

        :returns: list of auth method names

        """
        # Sanitizes methods received in request's body
        # Filters out duplicates, while keeping elements' order.
        method_names = []
        for method in self.auth['identity']['methods']:
            if method not in method_names:
                method_names.append(method)
        return method_names

    def get_method_data(self, method):
        """Get the auth method payload.

        :returns: auth method payload

        """
        if method not in self.auth['identity']['methods']:
            raise exception.ValidationError(attribute=method,
                                            target='identity')
        return self.auth['identity'][method]

    def get_scope(self):
        """Get scope information.

        Verify and return the scoping information.

        :returns: (domain_id, project_id, unscoped).
                   If scope to a project, (None, project_id, None)
                   will be returned.
                   If scoped to a domain, (domain_id, None, None)
                   will be returned.
                   If unscoped, (None, None, 'unscoped') will be
                   returned.

        """
        return self._scope_data

    def set_scope(self, domain_id=None, project_id=None, unscoped=None):
        """Set scope information."""
        if domain_id and project_id:
            msg = _('Scoping to both domain and project is not allowed')
            raise ValueError(msg)
        self._scope_data = (domain_id, project_id, unscoped)

@dependency.requires('assignment_api', 'catalog_api', 'identity_api',
                     'resource_api', 'token_provider_api')
class Auth(controller.Controller):

    # Note(atiwari): From V3 auth controller code we are
    # calling protection() wrappers, so we need to setup
    # the member_name and  collection_name attributes of
    # auth controller code.
    # In the absence of these attributes, default 'entity'
    # string will be used to represent the target which is
    # generic. Policy can be defined using 'entity' but it
    # would not reflect the exact entity that is in context.
    # We are defining collection_name = 'tokens' and
    # member_name = 'token' to facilitate policy decisions.
    collection_name = 'tokens'
    member_name = 'token'

    def __init__(self, *args, **kw):
        super(Auth, self).__init__(*args, **kw)
        config.setup_authentication()

    def authenticate_for_token(self, context, auth=None):
        """Authenticate user and issue a token."""
        include_catalog = 'nocatalog' not in context['query_string']
        auth_info = AuthInfo.create(context, auth=auth)
        auth_context = AuthContext(extras={},
                                       method_names=[],
                                       bind={})
        self.authenticate(context, auth_info, auth_context)

        self._check_and_set_default_scoping(auth_info, auth_context)
        (domain_id, project_id, unscoped) = auth_info.get_scope()

        method_names = auth_info.get_method_names()
        method_names += auth_context.get('method_names', [])
            # make sure the list is unique
        method_names = list(set(method_names))
        expires_at = auth_context.get('expires_at')
            # NOTE(morganfainberg): define this here so it is clear what the
            # argument is during the issue_v3_token provider call.
        metadata_ref = None

        token_audit_id = auth_context.get('audit_id')

        (token_id, token_data) = self.token_provider_api.issue_v3_token(
                auth_context['user_id'], method_names, expires_at, project_id,
                domain_id, auth_context, metadata_ref, include_catalog,
                parent_audit_id=token_audit_id)

        return render_token_data_response(token_id, token_data,
                                              created=True)

    def _check_and_set_default_scoping(self, auth_info, auth_context):
        (domain_id, project_id, unscoped) = auth_info.get_scope()
        if domain_id or project_id:
            # scope is specified
            return

        # Do not scope if request is for explicitly unscoped token
        if unscoped is not None:
            return

    def authenticate(self, context, auth_info, auth_context):
        """Authenticate user."""

        # The 'external' method allows any 'REMOTE_USER' based authentication
        # In some cases the server can set REMOTE_USER as '' instead of
        # dropping it, so this must be filtered out
        if context['environment'].get('REMOTE_USER'):
            try:
                external = get_auth_method('external')
                external.authenticate(context, auth_info, auth_context)
            except exception.AuthMethodNotSupported:
                # This will happen there is no 'external' plugin registered
                # and the container is performing authentication.
                # The 'kerberos'  and 'saml' methods will be used this way.
                # In those cases, it is correct to not register an
                # 'external' plugin;  if there is both an 'external' and a
                # 'kerberos' plugin, it would run the check on identity twice.
                LOG.debug("No 'external' plugin is registered.")
            except exception.Unauthorized:
                # If external fails then continue and attempt to determine
                # user identity using remaining auth methods
                LOG.debug("Authorization failed for 'external' auth method.")

        # need to aggregate the results in case two or more methods
        # are specified
        auth_response = {'methods': []}
        for method_name in auth_info.get_method_names():
            method = get_auth_method(method_name)
            resp = method.authenticate(context,
                                       auth_info.get_method_data(method_name),
                                       auth_context)
            if resp:
                auth_response['methods'].append(method_name)
                auth_response[method_name] = resp

        if auth_response["methods"]:
            # authentication continuation required
            raise exception.AdditionalAuthRequired(auth_response)

        if 'user_id' not in auth_context:
            msg = _('User not found')
            raise exception.Unauthorized(msg)

    def _check_subject_token(self, context, protection, *args, **kwargs):
        target = {}

        if context.get('subject_token_id') is not None:
            ks_token = token_model.KeystoneToken(
                token_id=context['subject_token_id'],
                token_data=self.token_provider_api.validate_token(
                    context['subject_token_id']))
            target.setdefault('token', {})
            target['token']['user_id'] = ks_token.user_id
            target['token']['id'] = ks_token.token_id
            target['token']['domain_id'] = ks_token.user_domain_id
            if ks_token.project_scoped:
                target['token']['scope'] = 'project'
                target['token']['scope_project_id'] = ks_token.project_id
                target['token']['scope_domain_id'] = (ks_token.
                                                    project_domain_id)
            elif ks_token.domain_scoped:
                target['token']['scope'] = 'domain'
                target['token']['scope_domain_id'] = ks_token.domain_id
            else:
                raise exception.UnsupportedTokenScope()

        return self.check_protection(context, protection, target)

    @controller.protected(callback=_check_subject_token)
    def check_token(self, context):
        token_id = context.get('subject_token_id')
        token_data = self.token_provider_api.validate_v3_token(
            token_id)
        # NOTE(morganfainberg): The code in
        # ``keystone.common.wsgi.render_response`` will remove the content
        # body.
        return render_token_data_response(token_id, token_data)

    @controller.protected(callback=_check_subject_token)
    def revoke_token(self, context):
        token_id = context.get('subject_token_id')
        return self.token_provider_api.revoke_token(token_id)

    @controller.protected(callback=_check_subject_token)
    def validate_token(self, context):
        token_id = context.get('subject_token_id')
        include_catalog = 'nocatalog' not in context['query_string']
        token_data = self.token_provider_api.validate_v3_token(
            token_id)
        if not include_catalog and 'catalog' in token_data['token']:
            del token_data['token']['catalog']
        return render_token_data_response(token_id, token_data)

    @controller.protected()
    def revocation_list(self, context, auth=None):
        if not CONF.token.revoke_by_id:
            raise exception.Gone()
        tokens = self.token_provider_api.list_revoked_tokens()

        for t in tokens:
            expires = t['expires']
            if not (expires and isinstance(expires, six.text_type)):
                t['expires'] = timeutils.isotime(expires)
        data = {'revoked': tokens}
        json_data = jsonutils.dumps(data)
        signed_text = cms.cms_sign_text(json_data,
                                        CONF.signing.certfile,
                                        CONF.signing.keyfile)

        return {'signed': signed_text}

    def _combine_lists_uniquely(self, a, b):
        # it's most likely that only one of these will be filled so avoid
        # the combination if possible.
        if a and b:
            return {x['id']: x for x in a + b}.values()
        else:
            return a or b

    @controller.protected()
    def get_auth_projects(self, context):
        auth_context = self.get_auth_context(context)

        user_id = auth_context.get('user_id')
        user_refs = []
        if user_id:
            try:
                user_refs = self.assignment_api.list_projects_for_user(user_id)
            except exception.UserNotFound:
                # federated users have an id but they don't link to anything
                pass

        group_ids = auth_context.get('group_ids')
        grp_refs = []
        if group_ids:
            grp_refs = self.assignment_api.list_projects_for_groups(group_ids)

        refs = self._combine_lists_uniquely(user_refs, grp_refs)
        return resource_controllers.Project.wrap_collection(context, refs)

    @controller.protected()
    def get_auth_domains(self, context):
        auth_context = self.get_auth_context(context)

        user_id = auth_context.get('user_id')
        user_refs = []
        if user_id:
            try:
                user_refs = self.assignment_api.list_domains_for_user(user_id)
            except exception.UserNotFound:
                # federated users have an id but they don't link to anything
                pass

        group_ids = auth_context.get('group_ids')
        grp_refs = []
        if group_ids:
            grp_refs = self.assignment_api.list_domains_for_groups(group_ids)

        refs = self._combine_lists_uniquely(user_refs, grp_refs)
        return resource_controllers.Domain.wrap_collection(context, refs)

    @controller.protected()
    def get_auth_catalog(self, context):
        auth_context = self.get_auth_context(context)
        user_id = auth_context.get('user_id')
        project_id = auth_context.get('scope_project_id')

        if not project_id:
            raise exception.Forbidden(
                _('A project-scoped token is required to produce a service '
                  'catalog.'))

        # The Controller base methods mostly assume that you're returning
        # either a collection or a single element from a collection, neither of
        # which apply to the catalog. Because this is a special case, this
        # re-implements a tiny bit of work done by the base controller (such as
        # self-referential link building) to avoid overriding or refactoring
        # several private methods.
        return {
            'catalog': self.catalog_api.get_v3_catalog(user_id, project_id),
            'links': {'self': self.base_url(context, path='auth/catalog')}
        }

# FIXME(gyee): not sure if it belongs here or keystone.common. Park it here
# for now.
def render_token_data_response(token_id, token_data, created=False):
    """Render token data HTTP response.

    Stash token ID into the X-Subject-Token header.

    """
    headers = [('X-Subject-Token', token_id)]

    if created:
        status = (201, 'Created')
    else:
        status = (200, 'OK')

    return wsgi.render_response(body=token_data,
                                status=status, headers=headers)


text:
<?php

require_once 'ESys/Calendar.php';

class ESys_Calendar_MonthTest extends PHPUnit_Framework_TestCase {

    public function setup ()
    {
        date_default_timezone_set('America/New_York');
    }

    /**
     * @dataProvider dataProviderMonthsNumbersAndExpectedNames
     */
    public function testGetsName ($monthNumber, $expectedMonthName)
    {
        $month = new ESys_Calendar_Month($monthNumber, 2011);
        $this->assertEquals($expectedMonthName, $month->getName());
    }

    public function dataProviderMonthsNumbersAndExpectedNames ()
    {
        return array(
            array(1, 'January'),
            array(6, 'June'),
        );
    }

    public function testGetsYear ()
    {
        $month = new ESys_Calendar_Month(1, 2011);
        $this->assertEquals(2011, $month->getYear());
    }

    public function testGetsWeeks ()
    {
        $monthWith5Weeks = new ESys_Calendar_Month(12, 2009);
        $weekList = $monthWith5Weeks->getWeeks();
        $firstDay = $this->getFirstDateFromWeekList($weekList);
        $lastDay = $this->getLastDateFromWeekList($weekList);
        $this->assertEquals(5, count($weekList));
        $this->assertEquals('Tuesday', $firstDay->format('l'));
        $this->assertEquals(2, array_search($firstDay, $weekList[0]->getDates()),
            'First day should be third date in first week because weeks start on Sunday.');
        $this->assertEquals('2009-12-01', $firstDay->format('Y-m-d'));
        $this->assertEquals('2009-12-31', $lastDay->format('Y-m-d'));
    }

    public function testDefaultsToSundayAsFirstDayOfWeek ()
    {
        $month = new ESys_Calendar_Month(12, 2009);
        $weekList = $month->getWeeks();
        $firstWeekDateList = $weekList[0]->getDates();
        $firstDate = $firstWeekDateList[0];
        $this->assertEquals('Sunday', $firstDate->format('l'));
    }

    public function testAcceptsAnAlternateFirstDayOfWeek ()
    {
        $wednesdayIndex = 4;
        $monthWithWeeksStartingOnWednesday = new ESys_Calendar_Month(12, 2009, $wednesdayIndex);
        $weekList = $monthWithWeeksStartingOnWednesday->getWeeks();
        $firstWeekDateList = $weekList[0]->getDates();
        $firstDate = $firstWeekDateList[0];
        $this->assertEquals('Wednesday', $firstDate->format('l'));
    }

    protected function getFirstDateFromWeekList ($weekList)
    {
        foreach ($weekList[0]->getDates(true) as $date) {
            if (! $date) {
                continue;
            }
            return $date;
        }
        return null;
    }

    protected function getLastDateFromWeekList ($weekList)
    {
        $lastWeek = $weekList[count($weekList) - 1];
        foreach (array_reverse($lastWeek->getDates(true)) as $date) {
            if (! $date) {
                continue;
            }
            return $date;
        }
        return null;
    }

}


text:
import axios from 'axios'
import {tipResult} from '../../../../../components/Tips/modules/tips'

export function commitHeadImg(items,phone) {
  return (dispatch, getState) => {
    axios.post('/member/HeadImg',items).then(({data}) => {
      if (data.status==200) {
        console.log(phone)
          document.getElementById('memberinfoHeadImg').src = '/public/Headload?member='+phone+"&"+Math.random()
      }else{
          dispatch(tipResult({type:"error",msg:data.msg}))
      }
    })
  }
}

export function submitPhotos(fd){
  return axios.post("/member/submitPhotos",fd)
}

export function modifyBrief(fd){
  return axios.post("/member/modifyBrief",fd)
}

export function getMemberInfo() {
      return axios.get('/member/getMemberInfo')
}

export function modifyNickname(item) {
      return axios.post('/member/modifyNickname',item)
}

export function modifyAddress(item) {
      return axios.post('/member/modifyAddress',item)
}

export function modifySpeciality(items) {
      return axios.post('/member/modifySpeciality',items)
}

export function deleteSpeciality(item) {
	    return axios.post('/member/deleteSpeciality',item)
}

export function addSpeciatity (that,items) {
  return (dispatch, getState) => {
    axios.post('/member/addSpeciality',items).then(({data}) => {
      if (data.status==200) {
          that.setState({showAddSpeciality:false})
          that.props.fetchSpeciality()
      }else if(data.status==600){
          that.props.dispatch({type:"AUTHOUT"})
          that.context.router.push('/login')
      }
      else{
          dispatch(tipResult({type:"error",msg:data.msg}))
      }
    })
  }
}

// ------------------------------------
// Constants
// ------------------------------------
const RECEIVE_SPECIALITIES = 'RECEIVE_SPECIALITIES'
const ADD_SPECIALITIES = 'ADD_SPECIALITIES'
// ------------------------------------
// Actions
// ------------------------------------

export const receiveSpeciality = (value) => ({
  type: RECEIVE_SPECIALITIES,
  value: value,
})

export function fetchSpeciality () {
  return (dispatch, getState) => {
    axios.get('/public/specialities').then(({data}) => {
        if (data.status==200) {
          dispatch(receiveSpeciality(data.data))
        }else{
          dispatch(tipResult({type:"error",msg:data.msg}))
        }
      })
  }
}

export function updateSpeciality (data) {
  return (dispatch, getState) => {
      dispatch(receiveSpeciality(data))
  }
}

// ------------------------------------
// Action Handlers
// ------------------------------------
const ACTION_HANDLERS = {
  [RECEIVE_SPECIALITIES]: (state, action) => {
    return ({...state, text: action.value,isloaded:true})
  },
  [ADD_SPECIALITIES]: (state, action) => {
    return ({...state, text: state.text.concat(action.value)})
  }
}

// ------------------------------------
// Reducer
// ------------------------------------
export const initialState = {
  text: []
}

export default function (state = initialState, action) {
  const handler = ACTION_HANDLERS[action.type]

  return handler ? handler(state, action) : state
}


text:
using System;
using GitVersion.BuildAgents;
using GitVersion.Common;
using GitVersion.Configuration;
using GitVersion.Configuration.Init;
using GitVersion.Extensions;
using GitVersion.Logging;
using GitVersion.VersionCalculation;
using GitVersion.VersionCalculation.Cache;
using GitVersion.VersionConverters.AssemblyInfo;
using GitVersion.VersionConverters.GitVersionInfo;
using GitVersion.VersionConverters.OutputGenerator;
using GitVersion.VersionConverters.WixUpdater;
using LibGit2Sharp;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;

namespace GitVersion
{
    public class GitVersionCoreModule : IGitVersionModule
    {
        public void RegisterTypes(IServiceCollection services)
        {
            services.AddSingleton<ILog, Log>();
            services.AddSingleton<IFileSystem, FileSystem>();
            services.AddSingleton<IEnvironment, Environment>();
            services.AddSingleton<IRepository, GitRepository>();

            services.AddSingleton<IConsole, ConsoleAdapter>();
            services.AddSingleton<IGitVersionCache, GitVersionCache>();

            services.AddSingleton<IGitVersionCacheKeyFactory, GitVersionCacheKeyFactory>();
            services.AddSingleton<IGitVersionContextFactory, GitVersionContextFactory>();
            services.AddSingleton<IConfigFileLocatorFactory, ConfigFileLocatorFactory>();

            services.AddSingleton<IConfigProvider, ConfigProvider>();
            services.AddSingleton<IVariableProvider, VariableProvider>();

            services.AddSingleton<IBaseVersionCalculator, BaseVersionCalculator>();
            services.AddSingleton<IMainlineVersionCalculator, MainlineVersionCalculator>();
            services.AddSingleton<INextVersionCalculator, NextVersionCalculator>();
            services.AddSingleton<IBranchConfigurationCalculator, BranchConfigurationCalculator>();

            services.AddSingleton<IGitVersionCalculateTool, GitVersionCalculateTool>();
            services.AddSingleton<IGitVersionOutputTool, GitVersionOutputTool>();

            services.AddSingleton<IBuildAgentResolver, BuildAgentResolver>();
            services.AddSingleton<IGitPreparer, GitPreparer>();
            services.AddSingleton<IRepositoryMetadataProvider, RepositoryMetadataProvider>();

            services.AddSingleton<IOutputGenerator, OutputGenerator>();
            services.AddSingleton<IGitVersionInfoGenerator, GitVersionInfoGenerator>();
            services.AddSingleton<IWixVersionFileUpdater, WixVersionFileUpdater>();
            services.AddSingleton<IAssemblyInfoFileUpdater, AssemblyInfoFileUpdater>();
            services.AddSingleton<IProjectFileUpdater, ProjectFileUpdater>();

            services.AddSingleton(sp => sp.GetService<IConfigFileLocatorFactory>()?.Create());

            services.AddSingleton(sp =>
            {
                var options = sp.GetService<IOptions<GitVersionOptions>>();
                var contextFactory = sp.GetService<IGitVersionContextFactory>();
                return new Lazy<GitVersionContext>(() => contextFactory?.Create(options?.Value));
            });

            services.AddModule(new BuildServerModule());
            services.AddSingleton(sp => sp.GetService<IBuildAgentResolver>()?.Resolve());

            services.AddModule(new GitVersionInitModule());
            services.AddModule(new VersionStrategyModule());
        }
    }
}


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

#include "app/active-canvas.hh"
#include "app/get-app-context.hh"
#include "commands/command.hh"
#include "commands/set-object-name-cmd.hh"
#include "editors/text-entry-util.hh"
#include "geo/geo-func.hh"
#include "geo/rect.hh"
#include "geo/tri.hh"
#include "objects/object.hh"
#include "rendering/overlay.hh"
#include "tasks/select-object-set-name.hh"
#include "tasks/task.hh"
#include "text/text-buffer.hh"
#include "tools/tool.hh" // Fixme: For TextContext et al., move to new file
#include "util/pos-info.hh"
#include "util-wx/key-codes.hh"

namespace faint{

static Optional<Object*> get_namee(const ActiveCanvas& canvas){
  const objects_t& objects = canvas->GetObjectSelection();
  if (objects.size() == 1){
    return option(objects.back());
  }
  return no_option();
}

static bool valid_name(const utf8_string&){
  return true; // Fixme: Extend, comply with xml NCNAME?
}

class SelectObjectSetName : public Task,
                            public TextContext,
                            public SelectionContext{
public:
  SelectObjectSetName(const ActiveCanvas& canvas) :
    m_active(false),
    m_canvas(canvas)
  {
    get_namee(m_canvas).Visit(
      [&](const Object* object){
        m_active = true;
        get_app_context().BeginTextEntry();
        object->GetName().Visit(
          [&](const utf8_string& s){
            m_text.set(s);
            m_text.caret(m_text.size());
          });
      });
  }

  ~SelectObjectSetName() override{
    if (m_active){
      get_app_context().EndTextEntry();
      m_active = false;
    }
  }

  void Activate() override{
  }

  bool AcceptsPastedText() const override{
    return true;
  }

  TaskResult Char(const KeyInfo& info) override{
    if (info.key.Is(key::esc)){
      // Cancel on escape
      return TaskResult::CHANGE;
    }
    else if (info.key.Is(key::enter)){
      return Commit();
    }
    else if (handle_key_press(info.key, m_text)){
      return TaskResult::DRAW;
    }
    return TaskResult::NONE;
  }

  TaskResult Commit() /* not override */{
    utf8_string name = m_text.get();
    if (!valid_name(name)){
      return TaskResult::DRAW;
    }
    return get_namee(m_canvas).Visit(
      [&](Object* namee){
        Optional<utf8_string> newName(name, !name.empty());
        if (namee->GetName() == newName){
          // Name unchanged
          return TaskResult::CHANGE;
        }
        else {
          m_command.Set(set_object_name_command(namee, newName));
          return TaskResult::COMMIT_AND_CHANGE;
        }
      },
      [](){
        return TaskResult::CHANGE;
      });
  }

  Optional<utf8_string> CopyText() const override{
    utf8_string s = m_text.get_selection();
    if (s.empty()){
      return {};
    }
    else{
      return Optional<utf8_string>(s);
    }
  }

  Optional<utf8_string> CutText() override{
    utf8_string s = m_text.get_selection();
    if (s.empty()){
      return {};
    }
    else{
      m_text.del();
      return Optional<utf8_string>(s);
    }
  }

  bool Delete() override{
    m_text.del();
    return true;
  }

  bool Deselect() override{
    m_text.select_none();
    return true;
  }

  TaskResult DoubleClick(const PosInfo&) override{
    return TaskResult::NONE;
  }

  void Draw(FaintDC&, Overlays& overlays, const PosInfo&) override{
    if (m_active){
      const objects_t& objects = m_canvas->GetObjectSelection();
      if (objects.size() == 1){
        overlays.Textbox(center_point(objects.front()->GetTri()), m_text,
          "Name");
      }
    }
  }

  bool DrawBeforeZoom(Layer) const override{
    return false;
  }

  bool EatsSettings() const override{
    return false;
  }

  Command* GetCommand() override{
    return m_command.Take();
  }

  Cursor GetCursor(const PosInfo&) const override{
    return Cursor::CARET; // Fixme: Only when over textbox
  };

  Task* GetNewTask() override{
    return nullptr;
  }

  IntRect GetRefreshRect(const RefreshInfo&) const override{
    const objects_t& objects = m_canvas->GetObjectSelection();
    if (objects.size() != 1){
      return {};
    }
    return floiled(inflated(bounding_rect(objects.front()->GetTri()),
      100, 10));
  }

  Optional<const faint::HistoryContext&> HistoryContext() const override{
    return {};
  }

  TaskResult MouseDown(const PosInfo&) override{
    return Commit();
  }

  TaskResult MouseUp(const PosInfo&) override{
    return TaskResult::NONE;
  }

  TaskResult MouseMove(const PosInfo&) override{
    return TaskResult::NONE;
  }

  void Paste(const utf8_string& str) override{
    m_text.insert(str);
  }

  virtual TaskResult Preempt(const PosInfo&) override{
    return Commit();
  }

  bool RefreshOnMouseOut() const override{
    return false;
  }

  bool SelectAll() override{
    m_text.select(m_text.all());
    return true;
  }

  void SelectionChange() override{
  }

  Optional<const faint::SelectionContext&> SelectionContext() const override{
    return Optional<const faint::SelectionContext&>(*this);
  }

  void SetLayer(Layer) override{
  }

  Optional<const faint::TextContext&> TextContext() const override{
    return Optional<const faint::TextContext&>(*this);
  }

  void UpdateSettings() override{
  }

  SelectObjectSetName& operator=(const SelectObjectSetName&) = delete;

private:
  bool m_active;
  const ActiveCanvas& m_canvas;
  PendingCommand m_command;
  TextBuffer m_text;
};

Task* select_object_set_name(const ActiveCanvas& canvas){
  return new SelectObjectSetName(canvas);
}

} // namespace


text:
import os

from io import StringIO, BytesIO
from urllib.parse import urljoin

from django.conf import settings
from django.core.files.storage import Storage
from django.core.files.base import File
from django.utils.deconstruct import deconstructible
from django.utils.encoding import filepath_to_uri, force_bytes
from django.core.files.storage import Storage
from django.core.files.base import ContentFile
from django.utils.encoding import filepath_to_uri
from django.utils import timezone

from collections import defaultdict

from germanium.signals import set_up, tear_down

class PathDoesNotExist(Exception):
    pass

class InMemoryNode:
    """
    Base class for files and directories.
    """
    parent = None

    def add_child(self, name, child):
        child.parent = self
        self.children[name] = child

class InMemoryFile(InMemoryNode, File):
    """
    Stores contents of file and stores reference to parent. File interface is identical
    to ContentFile, except that self.size works even after data has been written to it
    """
    def __init__(self, content='', parent=None, name=None):
        #init InMemoryNode
        self.parent = parent
        self.created_at = timezone.now()
        self.last_modified = timezone.now()
        self.last_accessed = timezone.now()

        stream_class = StringIO if isinstance(content, str) else BytesIO
        File.__init__(self, stream_class(content), name=name)

    def __str__(self):
        return '<InMemoryFile: %s>' % self.name

    def __bool__(self):
        return True

    def __nonzero__(self):      # Python 2 compatibility
        return type(self).__bool__(self)

    @property
    def _size(self):
        pos = self.file.tell()
        self.file.seek(0, os.SEEK_END)
        size = self.file.tell()
        self.file.seek(pos)
        return size

    def open(self, mode=None):
        self.seek(0)
        if 'b' in mode:
            if not isinstance(self.file, BytesIO):
                self.file = BytesIO(self.file.getvalue().encode('utf-8'))
        else:
            if not isinstance(self.file, StringIO):
                self.file = StringIO(self.file.getvalue().decode('utf-8'))

    def close(self):
        pass

class InMemoryDir(InMemoryNode):
    """
    Stores dictionary of child directories/files and reference to parent.
    """
    def __init__(self, dirs=None, files=None, parent=None):
        self.children = {}
        self.parent = parent

    def resolve(self, path, create=False, use_bytes=False):
        path = os.path.normpath(path)
        path_bits = path.strip(os.sep).split(os.sep, 1)
        current = path_bits[0]
        rest = path_bits[1] if len(path_bits) > 1 else None
        if not rest:
            if current == '.' or current == '':
                return self
            if current in self.children.keys():
                return self.children[current]
            if not create:
                raise PathDoesNotExist(path)
            content = b'' if use_bytes else ''
            node = InMemoryFile(name=current, content=content)
            self.add_child(current, node)
            return node
        if current in self.children.keys():
            return self.children[current].resolve(rest, create=create, use_bytes=use_bytes)
        if not create:
            raise PathDoesNotExist(path)
        node = InMemoryDir()
        self.add_child(current, node)
        return self.children[current].resolve(rest, create=create, use_bytes=use_bytes)

    def ls(self, path=''):
        return list(self.resolve(path).children.keys())

    def listdir(self, dir):
        nodes = tuple(self.resolve(dir).children.items())
        dirs = [k for (k, v) in nodes if isinstance(v, InMemoryDir)]
        files = [k for (k, v) in nodes if isinstance(v, InMemoryFile)]
        return [dirs, files]

    def delete(self, path):
        node = self.resolve(path)
        for name, child in node.parent.children.items():
            if child is node:
                del node.parent.children[name]
                break

    def exists(self, name):
        try:
            self.resolve(name)
        except PathDoesNotExist:
            return False
        else:
            return True

    def size(self, name):
        return self.resolve(name).size

    def open(self, path, mode="r"):
        create = "w" in mode
        use_bytes = "b" in mode
        f = self.resolve(path, create=create, use_bytes=use_bytes)
        f.open(mode)
        f.last_accessed = timezone.now()
        return f

    def save(self, path, content):
        mode = 'wb' if isinstance(content, bytes) else 'w'
        with self.open(path, mode) as f:
            f.write(content)
        f.last_modified = timezone.now()
        return path

test_filesystems = defaultdict(lambda: defaultdict(InMemoryDir))

@deconstructible
class TestInMemoryStorage(Storage):
    """
    Django storage class for in-memory filesystem.
    """

    filesystem_name = 'default'

    def __init__(self, base_url=None):
        if base_url is None:
            base_url = settings.MEDIA_URL
        self.base_url = base_url

    @property
    def filesystem(self):
        return test_filesystems[os.getpid()][self.filesystem_name]

    def listdir(self, dir):
        return self.filesystem.listdir(dir)

    def delete(self, path):
        return self.filesystem.delete(path)

    def exists(self, name):
        return self.filesystem.exists(name)

    def size(self, name):
        return self.filesystem.size(name)

    def _open(self, name, mode="r"):
        return self.filesystem.open(name, mode)

    def _save(self, name, content):
        return self.filesystem.save(name, content.read())

    def url(self, name):
        if self.base_url is None:
            raise ValueError("This file is not accessible via a URL.")
        return urljoin(self.base_url, filepath_to_uri(name))

    def modified_time(self, name):
        file = self.filesystem.resolve(name)
        return file.last_modified

    def accessed_time(self, name):
        file = self.filesystem.resolve(name)
        return file.last_accessed

    def created_time(self, name):
        file = self.filesystem.resolve(name)
        return file.created_at

    def __eq__(self, other):
        return self.filesystem == other.filesystem and self.base_url == other.base_url

def clean_test_filesystem(sender, **kwargs):
    if os.getpid() in test_filesystems:
        del test_filesystems[os.getpid()]

set_up.connect(clean_test_filesystem)
tear_down.connect(clean_test_filesystem)


text:
**Note:** Not maintained

# filetree.js

Recursively list files in directory hierarchy as a readable tree upto specified depth while excluding unwanted folder names

## Install

### Global

```bash
npm install -g filetree.js
```

### Local

```bash
npm install --save filetree.js
```

## CLI Example

Recursively lists files in `myFolder` and subdirectories upto two levels down, excluding any file or folder with the name `node_modules` and `bower_components`. Includes normally hidden files and folders and does not indent file/folder paths based on their depth level.

```bash
./filetree --path ./myFolder \
           --max-depth 2 \
           --exclude node_modules bower_components \
           --all \
           --no-indent
```

## JavaScript Example

Same as the CLI Example.

```js
var filetree = require('filetree.js');
filetree({
    path: './myFolder',
    maxDepth: 2,
    exclude: ['node_modules', 'bower_components'],
    all: true,
    indent: false
});
```

## JavaScript API

All arguments are optional

### filetree(options)
- options.path
  - String
  - Default = Current working directory
  - Print contents of directory at this path (relative or absolute)
- options.maxDepth
  - Integer
  - Default = Unlimited
  - Maximum directory recursion depth
- options.exclude
  - Array:String
  - Default = []
  - Exclude file and folder names
- options.all
  - Boolean
  - Default = false
  - Include files and folders beginning with a period
- options.indent
  - Boolean
  - Default = true
  - Indent paths based on their depth level

## CLI API

All arguments are optional

```bash
filetree [-p <target path>]
         [-m <max recursion depth>]
         [-x <excluded names>]
         [-a]
         [-i]

Options:
  --path, -p       Print contents of directory at this path (relative or
                   absolute)
                    [string] [default: /Users/aihamhammami/Projects/filetree.js]
  --max-depth, -m  Maximum directory recursion depth        [default: Unlimited]
  --exclude, -x    Exclude file and folder names           [array] [default: []]
  --all, -a        Include files and folders beginning with a period
                                                      [boolean] [default: false]
  --indent, -i     Indent paths based on their depth level
                                                       [boolean] [default: true]
  --version, -V    Show version number                                 [boolean]
  --help, -h       Show help                                           [boolean]

Examples:
  filetree -m 0                Only print root directory
  filetree -m 2                Print root and the two lower levels of
                               directories
  filetree -x build tmp test   Exclude multiple folder names
  filetree -p myGitProject -a  Includes .git which is normally ignored
  filetree --no-indent         Prevent the default indentation

Report bugs at https://github.com/aiham/filetree.js/issues
```

## Tests

Run the tests. Uses: mocha, chai, sinon

```bash
npm test
```

## To Do

- Return paths in JS and print in CLI
- Async with promises rather than synchronous

## Change Log

- 2015-10-18 - v0.0.3
  - Fix global command to be `filetree` rather than `filetree.js`
- 2015-10-18 - v0.0.2
  - Allow exclude names to have hanging/trailing slash
- 2015-10-18 - v0.0.1
  - First release


text:
local nahy_shell = {}

ansicolors = require "nahy_shell/ansicolors"

return nahy_shell


text:
package org.assertj.core.api.objectarray;

import static org.assertj.core.util.Lists.newArrayList;
import static org.mockito.Mockito.verify;

import java.util.List;

import org.assertj.core.api.ObjectArrayAssert;
import org.assertj.core.api.ObjectArrayAssertBaseTest;

public class ObjectArrayAssert_containsExactlyElementsOf_Test extends ObjectArrayAssertBaseTest {

  private final List<String> values = newArrayList("Yoda", "Luke");

  @Override
  protected ObjectArrayAssert<Object> invoke_api_method() {
    return assertions.containsExactlyElementsOf(values);
  }

  @Override
  protected void verify_internal_effects() {
    verify(arrays).assertContainsExactly(getInfo(assertions), getActual(assertions), values.toArray());
  }
}


text:
SQLALchemy_demo
===============

a SQLAlchemy demo for postgreSQL and alembic
Demo is on hold for the moment.

### SQLAlchemy_demo uses:

+ [Python-2.7.5+](https://www.python.org/download/releases/2.7.5 "Python")
+ [SQLAlchemy v0.9.4 ](http://docs.sqlalchemy.org/en/rel_0_9/ "SQLAlchemy")
+ [postgresql-9.3](http://www.postgresql.org/download/linux/debian/ "postgres")
+ [alembic](http://alembic.readthedocs.org/en/latest/ "alembic")
+ More to come.... (See TODO.md)

1. setup instructions - python pip and a virtual environment:
---------------
  1. Get [python pip](http://pip.readthedocs.org/en/latest/installing.html "pip") `sudo apt-get install python-pip`
  1. Get virtualenv via pip `pip install virtualenv`
  1. Make a virtual env directory `mkdir virt_env`
  1. Make sqla_demo's venv `virtualenv virt_env/sqla_demo_venv`
  1. Activate the venv `source virt_env/sqla_demo_venv/bin/activate`

2. setup instructions - setup demo
-------------
  1. `git clone https://github.com/jlgoldb2/SQLALchemy_demo.git`
  1. `cd SQLAlchemy_demo`
  1. `pip install -r stable-reqs.txt`

3. setup instructions - postgresql:
---------------
  1. Install postgresql (>=9.1.13) e.g. `sudo apt-get install postgresql`
  1. sudo open pg_hba.conf `sudo gedit /etc/postgresql/9.1/main/pg_hba.conf`
  1. Scroll down. Set up the ph_hba.conf to trust localhost:

        # Database administrative login by Unix domain socket
        local   all     postgres                         trust

        # "local" is for Unix domain socket connections only
        local   all     all                             trust

4. postgres and psql
---------------

  1. `$ sudo su postgres`
  2. `$psql`

=======
  1.  add user postgres `sudo adduser postgres`  <-- may already exist. it's okay. proceed.
  1. give postgres a password `sudo passwd postgres`
  1. follow the prompts; enter the same password twice.
  1. check to see in server is started `service postgresql status`
  1. starts the postgres server`sudo service postgresql start`
  1. change user to postgres for postgresql connection `sudo su postgres`
  1. start the postgresql shell `psql`
  1. lists databases on the pSQL server postgres=# `\l`

    + the `postgres=#` means you are currently on the postgres db inside psql
    + You should see 3 databases: postgres, template0, and template1. Leave them alone. They are for advanced use/users only.

  1. press 'q' to exit that view
  1. list users postgres=# `\du`

5. create a user and a db
-----------

  1. create a user: postgres=# `CREATE USER jasonlouis;`
      + you should see a `CREATE ROLE` message to confirm success
      + notice the `;` at the end of the command. it executes the SQL code.
  1. add a password (`password`) to the user `jasonlouis`: postgres=# `ALTER ROLE jasonlouis WITH PASSWORD 'password';`
      + you should see a `ALTER ROLE` message to confirm success
  1. create `testdb` owned by our user `jasonlouis`: postgres=# `CREATE DATABASE testdb WITH OWNER jasonlouis;`
      + should see a `CREATE DATABASE` if it worked.

6. run the tests:
----------
  1. run the tests.
  1. interpret.
  1. move on.

7. run the app:
------------
  1. Run the app.
  1. go through the config prompts.
  1. Look at the tables of the active database.
  1. Look at the tables in python

8. change the tables:
------------
  1. `git checkout table-change`
  1. oh no!! the tables are different.
  1. we gotta change our tables.
  1. move on.

9. demo alembic
------
  * alembic has:
    + schema
    + create_migration
    + migrate
    + rollback

  1. look at schema
  1. look at create_migration
  1. look at files.
  1. migrate.
  1. look at files again. see diffs.
  1. rollback.
  1. look at files. looks like orig.

DEV
------
+ stable requirements frozen with `pip freeze > stable-reqs.txt`
+ dev requirements (less stable)  `pip freeze > dev-reqs.txt`
+ instruction sets:
-------
  + [intall postgreSQL in 9 steps](http://www.thegeekstuff.com/2009/04/linux-postgresql-install-and-configure-from-source/ "postgresql install")


text:
[![Build Status](https://travis-ci.org/nerdalert/gopher-net-ctl.svg?branch=master)](https://travis-ci.org/nerdalert/gopher-net-ctl)

# gopher-net-cli
CLI for Gopher Net Router

### Example Advertise a new route

-Example adding a prefix to advertise into the tables (only a couple of fields are plumbed in until it uses the daemon data structures):

	gopher-net-ctl -d add route --prefix=172.15.14.0/24  --nexthop=172.16.86.1

-Example Output in Quagga

	ub134(config-router)# do sho ip route
	Codes: K - kernel route, C - connected, S - static, R - RIP,
	       O - OSPF, I - IS-IS, B - BGP, A - Babel,
	       > - selected route, * - FIB route

	K>* 0.0.0.0/0 via 172.16.86.2, eth0
	C>* 127.0.0.0/8 is directly connected, lo
	B>* 172.15.14.0/24 [200/0] via 172.16.86.1, eth0, 00:00:03
	C>* 172.16.86.0/24 is directly connected, eth0

### Example remove the advertised route

-This will stop advertising the requested prefix. There is some cidr from the specified node.from the specified note a new route

	gopher-net-ctl -d delete route --prefix=172.15.14.0/24

Example Output in Quagga

	ub134(config-router)# do sho ip route
	Codes: K - kernel route, C - connected, S - static, R - RIP,
	       O - OSPF, I - IS-IS, B - BGP, A - Babel,
	       > - selected route, * - FIB route

	K>* 0.0.0.0/0 via 172.16.86.2, eth0
	C>* 127.0.0.0/8 is directly connected, lo
	C>* 172.16.86.0/24 is directly connected, eth0

### Host Route Support

This and the API will also support hostnames that are resolvable by the target node/bgp speaker.

-Add a hosts DNS name (or VIP) to be advertised.

	gopher-net-ctl -d add route --prefix=google-public-dns-a.google.com  --nexthop=172.16.86.1

-The the resolved address will be advertised into the IGP/EGP as in the Quagga interface output below that is peered to an instance of the gnet daemon.

	ub134(config-router)# do sho ip route
	Codes: K - kernel route, C - connected, S - static, R - RIP,
	       O - OSPF, I - IS-IS, B - BGP, A - Babel,
	       > - selected route, * - FIB route

	K>* 0.0.0.0/0 via 172.16.86.2, eth0
	B>* 8.8.8.8/32 [200/0] via 172.16.86.1, eth0, 00:00:08
	C>* 127.0.0.0/8 is directly connected, lo
	B>* 172.15.14.0/24 [200/0] via 172.16.86.1, eth0, 00:07:46
	C>* 172.16.86.0/24 is directly connected, eth0

## Contributing

Jump in and join us!

### Testing

Simple run `make` prior to a PR. Test files are slim at the moment.

### Install godep

We use godep for dependency management and versioning. Please see the project page for more details about [godep](https://github.com/tools/godep)

    $ go get github.com/tools/godep

The following should drop you into the Godep project directory. If it doesn't there is a GOPATH issue.

    $ cd $GOPATH/src/github.com/tools/godep
    $ go build ./...
    $ go install ./...

### Verify Godep install

Now you should be able to run godep and it should be in your $PATH from you Go environment.

    $ godep
    Godep is a tool for managing Go package dependencies.

    Usage:

         godep command [arguments]

    The commands are:

        save     list and copy dependencies into Godeps
        go       run the go tool with saved dependencies
        get      download and install packages with specified dependencies
        path     print GOPATH for dependency code
        restore  check out listed dependency versions in GOPATH
        update   use different revision of selected packages

    Use "godep help [command]" for more information about a command.

### Using Godep

Import should be normal to begin with:

`import "github.com/codegangsta/cli"`

    $ go build ./...

then running godep save will create the .Godep directory in the project.

    $ godep save -r ./...

Now your imports should look like this:

`"github.com/gopher-net/gnet-ctl/Godeps/_workspace/src/github.com/codegangsta/cli"`


text:
NS_ASSUME_NONNULL_BEGIN

@protocol DWDPPendingRequestItem <DWDPBasicUserItem>

@end

NS_ASSUME_NONNULL_END


text:
'use strict';

var Dispatcher = require('flux').Dispatcher;
var assign = require('object-assign');

var AppDispatcher = assign(new Dispatcher(), {

    // TODO Not sure we need these to variants at this stage
    handleViewAction: function(action) {
        this.dispatch({
            source: 'VIEW_ACTION',
            action: action
        });
    },

    handleServerAction: function(action) {
        this.dispatch({
            source: 'SERVER_ACTION',
            action: action
        });
    }

});

module.exports = AppDispatcher;


text:
@class IDEInspectorKeyPath, NSComboBox, NSMutableDictionary, NSString;

@interface SKEResourceProperty : IDEInspectorProperty
{
    NSComboBox *_comboBox;
    IDEInspectorKeyPath *_valueKeyPath;
    NSString *_extension;
    NSString *_placeholder;
    NSMutableDictionary *_resources;
}

- (void).cxx_destruct;
- (id)findIndicatorContentViewWithContext:(id)arg1;
- (void)setupRefreshTriggersAndConfigure;
- (void)refresh;
- (void)userDidChangeValue:(id)arg1;
- (id)suggestedSceneNames;
- (double)baseline;

@end


text:
package edu.umd.cs.findbugs.ba;

import java.util.concurrent.AbstractExecutorService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor;

import org.apache.bcel.Repository;
import org.apache.bcel.classfile.JavaClass;

/**
 * @author pugh
 */
public class CheckReturnAnnotationDatabase extends AnnotationDatabase<CheckReturnValueAnnotation> {

    private JavaClass throwableClass, threadClass;

    public CheckReturnAnnotationDatabase() {
        setAddClassOnly(true);
        loadAuxiliaryAnnotations();
        setAddClassOnly(false);
    }

    @Override
    public void loadAuxiliaryAnnotations() {
        if (IGNORE_BUILTIN_ANNOTATIONS)
            return;
        boolean missingClassWarningsSuppressed = AnalysisContext.currentAnalysisContext().setMissingClassWarningsSuppressed(true);

        addMethodAnnotation("java.util.Iterator", "hasNext", "()Z", false, CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW);
        addMethodAnnotation("java.io.File", "createNewFile", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.io.File", "delete", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.io.File", "mkdir", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.io.File", "mkdirs", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.io.File", "renameTo", "(Ljava/io/File;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.io.File", "setLastModified", "(J)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.io.File", "setReadOnly", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.io.File", "setWritable", "(ZZ)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.util.Enumeration", "hasMoreElements", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addMethodAnnotation("java.security.MessageDigest", "digest", "([B)[B", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);

        addMethodAnnotation("java.util.concurrent.locks.ReadWriteLock", "readLock", "()Ljava/util/concurrent/locks/Lock;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_HIGH);
        addMethodAnnotation("java.util.concurrent.locks.ReadWriteLock", "writeLock", "()Ljava/util/concurrent/locks/Lock;",
                false, CheckReturnValueAnnotation.CHECK_RETURN_VALUE_HIGH);
        addMethodAnnotation("java.util.concurrent.locks.Condition", "await", "(JLjava/util/concurrent/TimeUnit;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.util.concurrent.CountDownLatch", "await", "(JLjava/util/concurrent/TimeUnit;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addMethodAnnotation("java.util.concurrent.locks.Condition", "awaitUntil", "(Ljava/util/Date;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.util.concurrent.locks.Condition", "awaitNanos", "(J)J", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.util.concurrent.Semaphore", "tryAcquire", "(JLjava/util/concurrent/TimeUnit;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_HIGH);
        addMethodAnnotation("java.util.concurrent.Semaphore", "tryAcquire", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_HIGH);
        addMethodAnnotation("java.util.concurrent.locks.Lock", "tryLock", "(JLjava/util/concurrent/TimeUnit;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_HIGH);
        addMethodAnnotation("java.util.concurrent.locks.Lock", "newCondition", "()Ljava/util/concurrent/locks/Condition;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_HIGH);
        addMethodAnnotation("java.util.concurrent.locks.Lock", "tryLock", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_HIGH);
        addMethodAnnotation("java.util.concurrent.BlockingQueue", "offer",
                "(Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.util.concurrent.BlockingQueue", "offer", "(Ljava/lang/Object;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);

        addMethodAnnotation("java.util.concurrent.ConcurrentLinkedQueue", "offer", "(Ljava/lang/Object;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.util.concurrent.DelayQueue", "offer", "(Ljava/lang/Object;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.util.concurrent.LinkedBlockingQueue", "offer", "(Ljava/lang/Object;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW_BAD_PRACTICE);
        addMethodAnnotation("java.util.LinkedList", "offer", "(Ljava/lang/Object;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.util.Queue", "offer", "(Ljava/lang/Object;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW_BAD_PRACTICE);
        addMethodAnnotation("java.util.concurrent.ArrayBlockingQueue", "offer", "(Ljava/lang/Object;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.util.concurrent.SynchronousQueue", "offer", "(Ljava/lang/Object;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation("java.util.PriorityQueue", "offer", "(Ljava/lang/Object;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.util.concurrent.PriorityBlockingQueue", "offer", "(Ljava/lang/Object;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);

        addWarningAboutSubmit(ExecutorService.class);
        addWarningAboutSubmit(ThreadPoolExecutor.class);
        addWarningAboutSubmit(ScheduledThreadPoolExecutor.class);
        addWarningAboutSubmit(AbstractExecutorService.class);

        addMethodAnnotation("java.util.concurrent.BlockingQueue", "poll", "(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;",
                false, CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addMethodAnnotation("java.util.Queue", "poll", "()Ljava/lang/Object;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW);

        addDefaultMethodAnnotation("java.lang.String", CheckReturnValueAnnotation.CHECK_RETURN_VALUE_HIGH);
        addMethodAnnotation("java.lang.String", "getBytes", "(Ljava/lang/String;)[B", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.lang.String", "charAt", "(I)C", false, CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW);
        addMethodAnnotation("java.lang.String", "toString", "()Ljava/lang/String;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW);
        addMethodAnnotation("java.lang.String", "length", "()I", false, CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW);
        addMethodAnnotation("java.lang.String", "matches", "(Ljava/lang/String;)Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW);
        addMethodAnnotation("java.lang.String", "intern", "()Ljava/lang/String;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addMethodAnnotation("java.lang.String", "<init>", "([BLjava/lang/String;)V", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.lang.String", "<init>", "(Ljava/lang/String;)V", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW);
        addMethodAnnotation("java.lang.String", "<init>", "()V", false, CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW);
        addDefaultMethodAnnotation("java.math.BigDecimal", CheckReturnValueAnnotation.CHECK_RETURN_VALUE_HIGH);
        addMethodAnnotation("java.math.BigDecimal", "inflate", "()Ljava/math/BigDecimal;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.math.BigDecimal", "toBigIntegerExact", "()Ljava/math/BigInteger;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.math.BigDecimal", "longValueExact", "()J", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.math.BigDecimal", "intValueExact", "()I", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.math.BigDecimal", "shortValueExact", "()S", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.math.BigDecimal", "byteValueExact", "()B", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.math.BigDecimal", "<init>", "(Ljava/lang/String;)V", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.math.BigDecimal", "intValue", "()I", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.math.BigDecimal", "stripZerosToMatchScale", "(J)Ljava/math/BigDecimal;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);

        addDefaultMethodAnnotation("java.math.BigInteger", CheckReturnValueAnnotation.CHECK_RETURN_VALUE_HIGH);
        addMethodAnnotation("java.math.BigInteger", "precision", "()I", true,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addMethodAnnotation("java.math.BigInteger", "addOne", "([IIII)I", true,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.math.BigInteger", "subN", "([I[II)I", true,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.math.BigInteger", "<init>", "(Ljava/lang/String;)V", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addDefaultMethodAnnotation("java.sql.Connection", CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addDefaultMethodAnnotation("java.net.InetAddress", CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addMethodAnnotation("java.net.InetAddress", "getByName", "(Ljava/lang/String;)Ljava/net/InetAddress;", true,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.net.InetAddress", "getAllByName", "(Ljava/lang/String;)[Ljava/net/InetAddress;", true,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE);
        addMethodAnnotation("java.lang.ProcessBuilder", "redirectErrorStream", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);

        addMethodAnnotation("java.lang.ProcessBuilder", "redirectErrorStream", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addMethodAnnotation("java.lang.ProcessBuilder", "redirectErrorStream", "()Z", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);

        addDefaultMethodAnnotation("jsr166z.forkjoin.ParallelArray", CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addDefaultMethodAnnotation("jsr166z.forkjoin.ParallelLongArray", CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addDefaultMethodAnnotation("jsr166z.forkjoin.ParallelDoubleArray", CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);

        addMethodAnnotation(java.sql.Statement.class, "executeQuery", "(Ljava/lang/String;)Ljava/sql/ResultSet;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        addMethodAnnotation(java.sql.PreparedStatement.class, "executeQuery", "()Ljava/sql/ResultSet;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM);
        AnalysisContext.currentAnalysisContext().setMissingClassWarningsSuppressed(missingClassWarningsSuppressed);

        try {
            throwableClass = Repository.lookupClass("java.lang.Throwable");
        } catch (ClassNotFoundException e) {
            AnalysisContext.reportMissingClass(e);
        }
        try {
            threadClass = Repository.lookupClass("java.lang.Thread");
        } catch (ClassNotFoundException e) {
            AnalysisContext.reportMissingClass(e);
        }
    }

    /**
     * @param c
     */
    private void addWarningAboutSubmit(Class<? extends ExecutorService> c) {
        addMethodAnnotation(c.getName(), "submit",
                "(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
        addMethodAnnotation(c.getName(), "submit",
                "(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW_BAD_PRACTICE);
        addMethodAnnotation(c.getName(), "submit",
                "(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/Future;", false,
                CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE);
    }

    @Override
    public CheckReturnValueAnnotation getResolvedAnnotation(Object o, boolean getMinimal) {
        if (!(o instanceof XMethod))
            return null;
        XMethod m = (XMethod) o;
        if (m.getName().startsWith("access$"))
            return null;
        else if (m.getName().equals("<init>")) {
            try {
                if (throwableClass != null && Repository.instanceOf(m.getClassName(), throwableClass))
                    return CheckReturnValueAnnotation.CHECK_RETURN_VALUE_VERY_HIGH;
            } catch (ClassNotFoundException e) {
                AnalysisContext.reportMissingClass(e);
            }
            if (m.getClassName().equals("java.lang.Thread"))
                return CheckReturnValueAnnotation.CHECK_RETURN_VALUE_VERY_HIGH;
            try {

                if (threadClass != null && Repository.instanceOf(m.getClassName(), threadClass))
                    return CheckReturnValueAnnotation.CHECK_RETURN_VALUE_LOW;
            } catch (ClassNotFoundException e) {
                AnalysisContext.reportMissingClass(e);
            }
        } else if (m.getName().equals("equals") && m.getSignature().equals("(Ljava/lang/Object;)Z") && !m.isStatic())
            return CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM;
        else if (m.getSignature().endsWith(")Ljava/lang/String;")
                && (m.getClassName().equals("java.lang.StringBuffer") || m.getClassName().equals("java.lang.StringBuilder")))
            return CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM;
        return super.getResolvedAnnotation(o, getMinimal);
    }

}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>be.aca.oauth2</groupId>
    <artifactId>oauth2-flows-demo-full</artifactId>
    <version>2014.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>OAuth 2 - Flows Demo (Complete)</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.3.2</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.2.7.v20150116</version>
            </plugin>
        </plugins>
    </build>
</project>