text:
''' Provide a base class for Bokeh Application handler classes.

When a Bokeh server session is initiated, the Bokeh server asks the Application
for a new Document to service the session. To do this, the Application first
creates a new empty Document, then it passes this new Document to the
``modify_document`` method of each of its handlers. When all handlers have
updated the Document, it is used to service the user session.

Below is an example outline of a custom handler that might modify documents
based off information in some database:

.. code-block:: python

    class DatabaseHandler(Handler):
        """ A Bokeh Application handler to initialize Documents from a database

        """

        def modify_document(self, doc):

            # do some data base lookup here to generate 'plot'

            # add the plot to the document (i.e modify the document)
            doc.add_root(plot)

            # and return it
            return doc

'''

#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
from __future__ import absolute_import, division, print_function, unicode_literals

import logging
log = logging.getLogger(__name__)

#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------

# Standard library imports

# External imports

# Bokeh imports

#-----------------------------------------------------------------------------
# Globals and constants
#-----------------------------------------------------------------------------

__all__ = (
    'Handler',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

class Handler(object):
    ''' Provide a mechanism for Bokeh applications to build up new Bokeh
    Documents.

    '''

    def __init__(self, *args, **kwargs):
        self._failed = False
        self._error = None
        self._error_detail = None
        self._static = None

    # Properties --------------------------------------------------------------

    @property
    def error(self):
        ''' If the handler fails, may contain a related error message.

        '''
        return self._error

    @property
    def error_detail(self):
        ''' If the handler fails, may contain a traceback or other details.

        '''
        return self._error_detail

    @property
    def failed(self):
        ''' ``True`` if the handler failed to modify the doc

        '''
        return self._failed

    # Public methods ----------------------------------------------------------

    def modify_document(self, doc):
        ''' Modify an application document in a specified manner.

        When a Bokeh server session is initiated, the Bokeh server asks the
        Application for a new Document to service the session. To do this,
        the Application first creates a new empty Document, then it passes
        this Document to the ``modify_document`` method of each of its
        handlers. When all handlers have updated the Document, it is used to
        service the user session.

        *Subclasses must implement this method*

        Args:
            doc (Document) : A Bokeh Document to update in-place

        Returns:
            Document

        '''
        raise NotImplementedError("implement modify_document()")

    def on_server_loaded(self, server_context):
        ''' Execute code when the server is first started.

        Subclasses may implement this method to provide for any one-time
        initialization that is necessary after the server starts, but
        before any sessions are created.

        Args:
            server_context (ServerContext) :

        '''
        pass

    def on_server_unloaded(self, server_context):
        ''' Execute code when the server cleanly exits. (Before stopping the
        server's ``IOLoop``.)

        Subclasses may implement this method to provide for any one-time
        tear down that is necessary before the server exits.

        Args:
            server_context (ServerContext) :

        .. warning::
            In practice this code may not run, since servers are often killed
            by a signal.

        '''
        pass

    def on_session_created(self, session_context):
        ''' Execute code when a new session is created.

        Subclasses may implement this method to provide for any per-session
        initialization that is necessary before ``modify_doc`` is called for
        the session.

        Args:
            session_context (SessionContext) :

        '''
        pass

    def on_session_destroyed(self, session_context):
        ''' Execute code when a session is destroyed.

        Subclasses may implement this method to provide for any per-session
        tear-down that is necessary when sessions are destroyed.

        Args:
            session_context (SessionContext) :

        '''
        pass

    def static_path(self):
        ''' Return a path to app-specific static resources, if applicable.

        '''
        if self.failed:
            return None
        else:
            return self._static

    def url_path(self):
        ''' Returns a default URL path, if applicable.

        Handlers subclasses may optionally implement this method, to inform
        the Bokeh application what URL it should be installed at.

        If multiple handlers specify ``url_path`` the Application will use the
        value from the first handler in its list of handlers.

        '''
        return None

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------


text:
package com.baosight.sts.st.xt.service;

import java.util.Map;

import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.threadlocal.UserSession;
import com.baosight.iplat4j.ee.service.CascadeSelect;
import com.baosight.iplat4j.ep.util.MethodParamConstants;
import com.baosight.sts.st.xt.domain.STXT9901;
import com.baosight.sts.util.BizConstants;

@SuppressWarnings("unchecked")
public class ServiceSTXT9901 extends CascadeSelect {

	public EiInfo initLoad(EiInfo inInfo) {
		inInfo = super.initLoad(inInfo);
		inInfo.addBlock(EiConstant.resultBlock).setRows(null);
		return inInfo;
	}
	// 查询
	public EiInfo query(EiInfo inInfo) {
		String orgId = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));
		inInfo.setCell("inqu_status", 0, "segNo", orgId);
		inInfo.setMethodParam(MethodParamConstants.sqlName, "STXT9901.query");
		inInfo.setMethodParam(MethodParamConstants.daoEPBaseBean, new STXT9901());
		EiInfo outInfo = super.query(inInfo, true);
		return outInfo;
	}
	// 保存
	public EiInfo save(EiInfo inInfo) {
		String segNo = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));
		String userId = String.valueOf(UserSession.getInSessionProperty(BizConstants.USER_ID));
		EiBlock block = inInfo.getBlock("result");
		int j = 0, count = block.getRowCount(),insertnum=0,updatenum=0;
		for (; j < count; j++) {
			Map<String,Object> param = block.getRow(j);
			if(dnvS(param.get("guid")).equals("")){
				param.put("segNo", segNo);
				param.put("createPerson", userId);
				insertnum+=dao.update("STXT9901.insert", param);
			}else if (dnvS(param.get("status")).equals("10")) {
				param.put("segNo", segNo);
				param.put("modiPerson", userId);
				updatenum+=dao.update("STXT9901.update", param);
			}
		}
		inInfo = query(inInfo);
		inInfo.setMsg("保存成功!"+insertnum+"条记录被生成,"+updatenum+"条记录被更新。");
		return inInfo;
	}
	// 失效
	public EiInfo disabled(EiInfo inInfo) {
		try {
			String orgId = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));
			String userId = String.valueOf(UserSession.getInSessionProperty(BizConstants.USER_ID));
			EiBlock block = inInfo.getBlock("result");
			int i = 0, count = block.getRowCount(),num=0;
			for (; i < count; i++) {
				Map<String, Object> param = block.getRow(i);
				String status = dnvString(param.get("status"));
				if (status.equals("10")) {
					param.put("segNo", orgId);
					param.put("modiPerson", userId);
					num+=dao.update("STXT9901.disabled", param);
				}
			}
			inInfo = query(inInfo);
			inInfo.setMsg("设置" + num + "条记录状态为失效!");
		} catch (Exception e) {
			e.printStackTrace();
			inInfo.setStatus(-1);
			inInfo.setMsg(getCause(e));
		}
		return inInfo;
	}
	// 完成
	public EiInfo complete(EiInfo inInfo) {
		try {
			String orgId = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));
			String userId = String.valueOf(UserSession.getInSessionProperty(BizConstants.USER_ID));
			EiBlock block = inInfo.getBlock("result");
			int i = 0, count = block.getRowCount(),num=0;
			for (; i < count; i++) {
				Map<String, Object> param = block.getRow(i);
				String status = dnvString(param.get("status"));
				if (status.equals("10")) {
					param.put("segNo", orgId);
					param.put("modiPerson", userId);
					num+=dao.update("STXT9901.complete", param);
				}
			}
			inInfo = query(inInfo);
			inInfo.setMsg("设置" + num + "条记录状态为完成!");
		} catch (Exception e) {
			e.printStackTrace();
			inInfo.setStatus(-1);
			inInfo.setMsg(getCause(e));
		}
		return inInfo;
	}
}

redpajama_set_name: RedPajamaGithub


text:
# -*- coding: utf-8 -*-
from django.http import HttpRequest
from django.test import TestCase

from ..behaviors import ContentTypeMixin

class GetContentTypeTestCase(TestCase):

    def test_not_provided(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.content_types = ['application/javascript', 'application/xml']
        self.assertEqual(f.get_content_type(), 'application/javascript')

    def test_none_matched(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.request.META['HTTP_ACCEPT'] = 'text/html'
        f.content_types = ['application/javascript', 'application/xml']
        self.assertIsNone(f.get_content_type())

    def test_last_matched(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.request.META['HTTP_ACCEPT'] = 'text/html,application/javascript'
        self.content_types = ['application/javascript', 'text/html']
        self.assertEqual(f.get_content_type(), 'text/html')

    def test_last_matched_2(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.request.META['HTTP_ACCEPT'] = \
            'text/html,application/javascript,application/xml+xhtml'
        f.content_types = ['application/javascript', 'text/html']
        self.assertEqual(f.get_content_type(), 'text/html')

    def test_middle_matched(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.request.META['HTTP_ACCEPT'] = (
            'text/html;q=0.8,application/javascript;q=0.9,'
            'application/xml+xhtml'
        )
        f.content_types = [
            'text/html', 'application/javascript', 'application/xml'
        ]
        self.assertEqual(f.get_content_type(), 'application/javascript')

    def test_none_matched_all_allowed(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.request.META['HTTP_ACCEPT'] = \
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
        f.content_types = [
            'text/plain', 'application/javascript',
        ]
        self.assertEqual(f.get_content_type(), 'text/plain')

class GetAcceptedContentTypes(TestCase):

    def test_not_provided(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        self.assertListEqual(list(f.get_accepted_content_types()),
                             ['*/*'])

    def test_one_provided(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.request.META['HTTP_ACCEPT'] = 'text/html'
        self.assertListEqual(list(f.get_accepted_content_types()),
                             ['text/html'])

    def test_two_provided(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.request.META['HTTP_ACCEPT'] = 'text/html,application/javascript'
        self.assertListEqual(list(f.get_accepted_content_types()),
                             ['text/html', 'application/javascript'])

    def test_three_provided(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.request.META['HTTP_ACCEPT'] = \
            'text/html,application/javascript,application/xml+xhtml'
        self.assertListEqual(list(f.get_accepted_content_types()), [
            'text/html', 'application/javascript', 'application/xml+xhtml',
        ])

    def test_quality_provide(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.request.META['HTTP_ACCEPT'] = (
            'text/html;q=0.8,application/javascript;q=0.9,'
            'application/xml+xhtml'
        )
        self.assertListEqual(list(f.get_accepted_content_types()), [
            'application/xml+xhtml', 'application/javascript', 'text/html',
        ])

    def test_concrete_example(self):
        f = ContentTypeMixin()
        f.request = HttpRequest()
        f.request.META['HTTP_ACCEPT'] = \
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
        self.assertListEqual(list(f.get_accepted_content_types()), [
            'text/html', 'application/xhtml+xml', 'application/xml', '*/*',
        ])


text:
namespace arc {

FakeMemoryInstance::FakeMemoryInstance() = default;
FakeMemoryInstance::~FakeMemoryInstance() = default;

void FakeMemoryInstance::DropCaches(DropCachesCallback callback) {
  std::move(callback).Run(drop_caches_result_);
}

}  // namespace arc


text:
package hu.bme.mit.sette.samplesnippets._1_simple;

import hu.bme.mit.sette.common.snippets.SnippetInputContainer;

public final class TS1a_IfElse_Inputs {
    private TS1a_IfElse_Inputs() {
        throw new UnsupportedOperationException("Static class");
    }

    public static SnippetInputContainer linear() {
        SnippetInputContainer inputs = new SnippetInputContainer(1);

        inputs.addByParameters(2);
        inputs.addByParameters(0);

        return inputs;
    }

    public static SnippetInputContainer linearNoSolution() {
        SnippetInputContainer inputs = new SnippetInputContainer(1);

        inputs.addByParameters(0);

        return inputs;
    }

    public static SnippetInputContainer exception() {
        SnippetInputContainer inputs = new SnippetInputContainer(2);

        inputs.addByExpectedAndParameters(IndexOutOfBoundsException.class, -1);
        inputs.addByParameters(1);

        return inputs;
    }

    public static SnippetInputContainer array() {
        SnippetInputContainer inputs = new SnippetInputContainer(1);

        inputs.addByParameters((Object) null);
        inputs.addByParameters(new int[] { 1 });
        inputs.addByParameters(new int[] { 0 });

        return inputs;
    }
}


text:
class Variants < ActiveRecord::Migration
  def self.up
    create_table :variants do |t|
      t.string :name
      t.boolean :control, :default => false
      t.string :data, :limit => 4096
      t.integer :category_id
      t.integer :site_id
      t.integer :test_id
      t.integer :user_id
      t.timestamps
    end
    add_index :variants, :control
    add_index :variants, :name
    add_index :variants, :test_id
    add_index :variants, :user_id
  end

  def self.down
    drop_table :variants
  end
end


text:
const backoff = {
  exponential (attempt, delay) {
    return Math.floor(Math.random() * Math.pow(2, attempt) * delay);
  },

  fibonacci (attempt, delay) {
    var current = 1;

    if (attempt > current) {

      var prev = 1,
      current = 2;

      for (var index = 2; index < attempt; index++) {
        var next = prev + current;
        prev = current;
        current = next;
      }
    }

    return Math.floor(Math.random() * current * delay);
  }
};

export function createBackoff(type, options) {
  return new Backoff(backoff[type], options);
}

function Backoff (func, options) {
  this.func = func;
  this.attempts = 0;
  this.delay = (typeof(options.initialDelay) !== "undefined")
    ? options.initialDelay
    : 100;
}

Backoff.prototype.backoff = function () {
  setTimeout(this.onReady, this.func(++this.attempts, this.delay));
}


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

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS
 *      API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListSourceLocationsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The maximum number of source locations that you want MediaTailor to return in response to the current request. If
     * there are more than MaxResults source locations, use the value of NextToken in the
     * response to get the next page of results.
     *

     */
    private Integer maxResults;
    /**
     *

     * Pagination token returned by the list request when results exceed the maximum allowed. Use the token to fetch the
     * next page of results.
     *

     */
    private String nextToken;

    /**
     *

     * The maximum number of source locations that you want MediaTailor to return in response to the current request. If
     * there are more than MaxResults source locations, use the value of NextToken in the
     * response to get the next page of results.
     *

     *
     * @param maxResults
     *        The maximum number of source locations that you want MediaTailor to return in response to the current
     *        request. If there are more than MaxResults source locations, use the value of
     *        NextToken in the response to get the next page of results.
     */

    public void setMaxResults(Integer maxResults) {
        this.maxResults = maxResults;
    }

    /**
     *

     * The maximum number of source locations that you want MediaTailor to return in response to the current request. If
     * there are more than MaxResults source locations, use the value of NextToken in the
     * response to get the next page of results.
     *

     *
     * @return The maximum number of source locations that you want MediaTailor to return in response to the current
     *         request. If there are more than MaxResults source locations, use the value of
     *         NextToken in the response to get the next page of results.
     */

    public Integer getMaxResults() {
        return this.maxResults;
    }

    /**
     *

     * The maximum number of source locations that you want MediaTailor to return in response to the current request. If
     * there are more than MaxResults source locations, use the value of NextToken in the
     * response to get the next page of results.
     *

     *
     * @param maxResults
     *        The maximum number of source locations that you want MediaTailor to return in response to the current
     *        request. If there are more than MaxResults source locations, use the value of
     *        NextToken in the response to get the next page of results.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListSourceLocationsRequest withMaxResults(Integer maxResults) {
        setMaxResults(maxResults);
        return this;
    }

    /**
     *

     * Pagination token returned by the list request when results exceed the maximum allowed. Use the token to fetch the
     * next page of results.
     *

     *
     * @param nextToken
     *        Pagination token returned by the list request when results exceed the maximum allowed. Use the token to
     *        fetch the next page of results.
     */

    public void setNextToken(String nextToken) {
        this.nextToken = nextToken;
    }

    /**
     *

     * Pagination token returned by the list request when results exceed the maximum allowed. Use the token to fetch the
     * next page of results.
     *

     *
     * @return Pagination token returned by the list request when results exceed the maximum allowed. Use the token to
     *         fetch the next page of results.
     */

    public String getNextToken() {
        return this.nextToken;
    }

    /**
     *

     * Pagination token returned by the list request when results exceed the maximum allowed. Use the token to fetch the
     * next page of results.
     *

     *
     * @param nextToken
     *        Pagination token returned by the list request when results exceed the maximum allowed. Use the token to
     *        fetch the next page of results.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListSourceLocationsRequest withNextToken(String nextToken) {
        setNextToken(nextToken);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getMaxResults() != null)
            sb.append("MaxResults: ").append(getMaxResults()).append(",");
        if (getNextToken() != null)
            sb.append("NextToken: ").append(getNextToken());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ListSourceLocationsRequest == false)
            return false;
        ListSourceLocationsRequest other = (ListSourceLocationsRequest) obj;
        if (other.getMaxResults() == null ^ this.getMaxResults() == null)
            return false;
        if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
            return false;
        if (other.getNextToken() == null ^ this.getNextToken() == null)
            return false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
        return hashCode;
    }

    @Override
    public ListSourceLocationsRequest clone() {
        return (ListSourceLocationsRequest) super.clone();
    }

}


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

namespace XecMe.Core.Fluent
{
    /// <summary>
    /// Base task builder interface
    /// </summary>
    public interface ITaskBuilder
    {
        /// <summary>
        /// Adds the parameter.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        ITaskBuilder AddParameter(string name, object value);

        /// <summary>
        /// Adds the task to the configuration
        /// </summary>
        void Add();
    }

    /// <summary>
    /// Base task builder for fluent APIs
    /// </summary>
    /// <seealso cref="ITaskBuilder" />
    internal abstract class TaskBuilder: ITaskBuilder
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TaskBuilder"/> class.
        /// </summary>
        /// <param name="config">The configuration.</param>
        /// <param name="name">The name.</param>
        /// <param name="taskType">Type of the task.</param>
        /// <param name="logType">Type of the log.</param>
        /// <exception cref="System.ArgumentException">Task type is either abstract or not if type <see cref="ITask"/></exception>
        internal TaskBuilder(FlowConfiguration config, string name, Type taskType, LogType logType)
        {
            config.NotNull(nameof(config));
            name.NotNull(nameof(name));
            taskType.NotNull(nameof(taskType));

            if (taskType.IsAbstract)
            {
                throw new ArgumentException($"{taskType} is abstract type");
            }
            else if (!(typeof(ITaskAsync).IsAssignableFrom(taskType) || typeof(ITask).IsAssignableFrom(taskType)))
            {
                throw new ArgumentException($"{taskType} must be either of the type {typeof(ITask)} or {typeof(ITaskAsync)}");
            }

            if(taskType is ITaskAsync)
            {
                //taskType =
            }

            Config = config;
            Name = name;
            TaskType = taskType;
            this.TraceType = logType;
            Parameters = new Dictionary<string, object>();
        }

        /// <summary>
        /// Gets the configuration.
        /// </summary>
        /// <value>
        /// The configuration.
        /// </value>
        protected FlowConfiguration Config { get; private set; }

        /// <summary>
        /// Gets the name of the task
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        protected string Name { get; private set; }

        /// <summary>
        /// Gets the type of the task.
        /// </summary>
        /// <value>
        /// The type of the task.
        /// </value>
        protected Type TaskType { get; private set; }

        /// <summary>
        /// Gets or sets the type of the trace.
        /// </summary>
        /// <value>
        /// The type of the trace.
        /// </value>
        protected LogType TraceType { get; set; }

        /// <summary>
        /// Gets the parameters.
        /// </summary>
        /// <value>
        /// The parameters.
        /// </value>
        protected Dictionary<string, object> Parameters { get; private set; }

        /// <summary>
        /// Adds the parameter.
        /// </summary>
        /// <param name="name">Name of the parameter</param>
        /// <param name="value">Value of the parameter</param>
        /// <returns>Returns the reference to the task builder <see cref="ITaskBuilder"/></returns>
        public ITaskBuilder AddParameter(string name, object value)
        {
            name.NotNull(nameof(name));
            value.NotNull(nameof(value));

            Parameters[name] = value;
            return this;
        }

        /// <summary>
        /// Add the task to the configuration
        /// </summary>
        public abstract void Add();
    }
}


text:
(function(insight) {

    /**
     * The BarSeries is an abstract base class for columns and rows.
     * @constructor
     * @extends insight.Series
     * @param {String} name - A uniquely identifying name for this series
     * @param {insight.DataProvider | Object[]} data - An object which contains this series' data
     * @param {insight.Axis} x - The x axis
     * @param {insight.Axis} y - The y axis
     */
    insight.BarSeries = function BarSeries(name, data, x, y) {

        insight.Series.call(this, name, data, x, y);

        // Private variables ------------------------------------------------------------------------------------------

        var self = this;

        // Internal variables -------------------------------------------------------------------------------------------

        self.valueAxis = undefined;
        self.keyAxis = undefined;
        self.classValues = [insight.constants.BarGroupClass];

        // Private functions ------------------------------------------------------------------------------------------

        function tooltipFunction(d) {
            return self.tooltipFormat()(self.valueFunction()(d));
        }

        function duration(d, i) {
            return 200 + (i * 20);
        }

        function opacity() {
            // If we are using selected/notSelected, then make selected more opaque than notSelected
            if (d3.select(this).classed('notselected')) {
                return 0.5;
            }

            //If not using selected/notSelected, make everything opaque
            return 1;
        }

        function seriesSpecificClassName(d) {

            var additionalClass = ' ' + self.name + 'class series';
            var baseClassName = self.itemClassName(d);
            var itemClassName = baseClassName + additionalClass;

            return itemClassName;
        }

        // Internal functions -----------------------------------------------------------------------------------------

        self.isHorizontal = function() {
            return undefined;
        };

        self.barLength = function(d, plotHeight) {
            return undefined;
        };

        self.valuePosition = function(d) {
            return undefined;
        };

        self.draw = function(chart) {

            self.tooltip = chart.tooltip;
            self.selectedItems = chart.selectedItems;

            var groupSelector = 'g.' + self.name + '.' + insight.constants.BarGroupClass,
                barSelector = 'rect.' + self.shortClassName();

            var data = self.dataset();
            var visibleBars = self.keyAxis.domain();

            data = data.filter(function(d) {
                var key = self.keyFunction()(d);
                return insight.utils.arrayContains(visibleBars, key);
            });

            var groups = chart.plotArea
                .selectAll(groupSelector)
                .data(data, self.keyFunction());

            var newGroups = groups.enter()
                .append('g')
                .classed(self.name, true)
                .classed(insight.constants.BarGroupClass, true);

            var newBars = newGroups.selectAll(barSelector);

            newGroups.append('rect')
                .attr('class', self.itemClassName)
                .attr('in_series', self.name)
                .attr('clip-path', 'url(#' + chart.clipPath() + ')')
                .on('mouseover', self.mouseOver)
                .on('mouseout', self.mouseOut)
                .on('click', self.click);

            var seriesTypeCount = chart.countSeriesOfType(self);
            var seriesIndex = chart.seriesIndexByType(self);
            var groupIndex = 0;

            var height = (self.isHorizontal()) ? barBreadth : barLength;
            var width = (self.isHorizontal()) ? barLength : barBreadth;
            var xPosition = (self.isHorizontal()) ? self.valuePosition : keyPosition;
            var yPosition = (self.isHorizontal()) ? keyPosition : self.valuePosition;

            // Select and update all bars
            var allBars = groups.selectAll(barSelector);

            allBars.attr('class', self.itemClassName);

            allBars.transition()
                .duration(duration)
                .attr('x', xPosition)
                .attr('y', yPosition)
                .attr('height', height)
                .attr('width', width)
                .style('opacity', opacity);

            groups.exit().remove();

            // draw helper functions ------------------------------------

            function groupHeight(d) {
                return self.keyAxis.scale.rangeBand(d);
            }

            function barBreadth(d) {

                var heightOfGroup = groupHeight(d);
                var breadth = heightOfGroup / seriesTypeCount;
                return breadth;

            }

            function barLength(d) {
                var plotHeight = (chart.height() - chart.margin().top - chart.margin().bottom);
                return self.barLength(d, plotHeight);
            }

            function keyPosition(d) {

                var groupPositions = self.keyAxis.scale.range();
                var groupPos = groupPositions[groupIndex];

                var barWidth = width(d);
                var position = groupPos + (barWidth * (seriesTypeCount - seriesIndex - 1));

                groupIndex++;

                return position;

            }
        };
    };

    insight.BarSeries.prototype = Object.create(insight.Series.prototype);
    insight.BarSeries.prototype.constructor = insight.BarSeries;
})(insight);


text:
package com.sdw.soft.demo.rocketmq;

import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
import org.apache.rocketmq.common.message.MessageExt;
import org.junit.Test;

import java.util.List;
import java.util.UUID;

/**
 * Created by shangyd on 2018/5/4.
 */
public class ConsumerTest extends RocketMQConfig{

    @Test
    public void testConsumer() {
        DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(group);
        consumer.setNamesrvAddr(nameServerAddr);
        try {
            consumer.subscribe(topic,"*");
        } catch (MQClientException e) {
            e.printStackTrace();
        }
        consumer.setInstanceName(UUID.randomUUID().toString());
        consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET);
        consumer.registerMessageListener(new MessageListenerConcurrently() {
            @Override
            public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) {
                for (MessageExt messageExt : msgs) {
                    String msg = new String(messageExt.getBody());
                    System.out.println("msg data from rocketMQ:" + msg);
                }
                return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
            }
        });
        try {
            consumer.start();
        } catch (MQClientException e) {
            e.printStackTrace();
        }
        System.out.println("RocketMQConsumer started  group=" + consumer.getConsumerGroup() + " instace=" + consumer.getInstanceName());

        try {
            Thread.sleep(Integer.MAX_VALUE);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}


text:
package org.bitj.utils;

import org.bitj.BaseTest;
import org.testng.annotations.Test;

import static org.testng.Assert.assertEquals;

public class DebugTest extends BaseTest {

  @Test
  public void hexToBytes() throws Exception {
    assertEquals( Debug.hexToBytes("00"), bytes(0) );
    assertEquals( Debug.hexToBytes("AF"), bytes(175) );
    assertEquals( Debug.hexToBytes("AF"), bytes(175) );
    assertEquals( Debug.hexToBytes("00 F9 BE B4 D9 00"), bytes(0, 249, 190, 180, 217, 0) );
  }

  @Test
  public void bytesToHex() throws Exception {
    assertEquals( Debug.bytesToHex(bytes(0)), "00" );
    assertEquals( Debug.bytesToHex(bytes(128, 255)), "80 FF" );
    assertEquals( Debug.bytesToHex(bytes(0, 249, 190, 180, 217, 0)), "00 F9 BE B4 D9 00" );
  }

}


text:
from django.contrib.admin.templatetags.admin_modify import *
from django.contrib.admin.templatetags.admin_modify import submit_row as original_submit_row
from django.conf import settings
import random
@register.inclusion_tag('admin/submit_line.html', takes_context=True)
def submit_row(context):
    ctx = original_submit_row(context)
    ctx.update({
        'show_save': context.get('show_save', ctx['show_save']),
        'show_save_and_add_another': context.get('show_save_and_add_another', ctx['show_save_and_add_another']),
        'show_save_and_continue': context.get('show_save_and_continue', ctx['show_save_and_continue']),
        'custom_delete_url': context.get("custom_delete_url",None),
        })
    return ctx

@register.simple_tag
def random_str(a):
    a = ["You are now signed out. Thank you and have a great day",
         "Thanks for spending some quality time with the Web site today.",
         "Thanks for using " +settings.XOS_BRANDING_NAME + " to manage your network today.",
         "You have successfully logged out, Thanks for spending some quality time",
         "The "+settings.XOS_BRANDING_NAME +" team is glad that you used our product to get your work done."]
    return a[random.randint(0,4)]


text:
package com.coolweather.db;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import com.coolweather.model.CityList;
import com.coolweather.model.WeatherInfo;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wsb on 2015/12/25.
 */
public class CoolWeatherDB {
    /*

    *数据库名字
     */
    public static final  String DB_NAME="cool_weather";

    /*
    *数据库版本
     */
    public static final int DB_VERSION=1;
    private static CoolWeatherDB coolWeatherDB;
    private SQLiteDatabase db;

    private CoolWeatherDB(Context context){
        CoolWeatherOpenHelper dbHelper=new CoolWeatherOpenHelper(context
                                ,DB_NAME,null,DB_VERSION);
        db=dbHelper.getWritableDatabase();
    }
    /**
     * 获取CoolWeatherDB的实例。
     */

    public synchronized static CoolWeatherDB getInstance(Context context){
        if(coolWeatherDB==null)
            coolWeatherDB=new CoolWeatherDB(context);
        return coolWeatherDB;
    }

    /**
     * 将所有天气类型存入数据库中,减少访问网络
     * @param obj
     */
    public void saveWeatherId(JSONObject obj){
        if(obj!=null){
            try{
                db.execSQL("insert into WeatherId (wid,weather) values(?,?)"
                        ,new Object[]{obj.getInt("wid"),obj.getString("weather")});
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }

    /**
     * 根据ID查找天气类型
     * @param id
     */

    public String loadWeatherId(String id){
        String weatherType;
        Cursor cursor;
        if((cursor=db.rawQuery("select * from WeatherId where wid=?", new String[]{id})).moveToFirst()){
            weatherType=cursor.getString(cursor.getColumnIndex("weather"));
            return weatherType;
        }else
            return null;

    }

    public void saveWeatherInfo(){
        List<WeatherInfo> weatherInfoList=new ArrayList<>();

    }
    /*
    *将所有城市保存在数据库中
     */
    public void saveCity(JSONObject obj){
        if(obj!=null) {
            try {
                db.execSQL("insert into CityList (id,province,city,district) values(?,?,?,?)"
                        , new Object[]{obj.getInt("id"),obj.getString("province")
                        , obj.getString("city"),obj.getString("district")});
            }catch (Exception e){
                e.printStackTrace();
            }

        }
    }
    /**
     *
     * @param name
     *          传入查询的城市名字
     * @return
     *          返回城市数据List<city>,有可能是某省的所有城市,或单一城市
     */
    public List<CityList> loadCity(String name) {
        List<CityList> cityLists=new ArrayList<CityList>();
        CityList city ;
        Cursor cursor;
        //查询用户输入的是否是省名
        if ((cursor = db.rawQuery("select * from CityList where district LIKE ? or province LIKE ?"
                , new String[]{"%"+name+"%"})).moveToFirst())
            {

            do{
                city = new CityList();
                city.setId(cursor.getInt(cursor.getColumnIndex("id")));
                city.setProvince(cursor.getString(cursor.getColumnIndex("province")));
                city.setCity(cursor.getString(cursor.getColumnIndex("city")));
                city.setDistrict(cursor.getString(cursor.getColumnIndex("district")));
               cityLists.add(city);
            }while (cursor.moveToNext());
        }
            cursor.close();
            return cityLists;
        }
}


text:
package com.speedment.common.codegen.internal.model;

import com.speedment.common.codegen.model.Class;
import com.speedment.common.codegen.model.JavadocTag;
import org.junit.jupiter.api.Test;

import java.util.List;
import java.util.NoSuchElementException;

import static org.junit.jupiter.api.Assertions.*;

final class JavadocTagImplTest extends AbstractTest<JavadocTag> {

    private final static String NAME = "A";

    public JavadocTagImplTest() {
        super(() -> new JavadocTagImpl(NAME),
                a -> a.imports(List.class),
                a -> a.setText("V"),
                a -> a.setValue("V"),
                a -> a.imports(Integer.class),
                a -> a.setText("V"),
                a -> a.setName("B")
        );
    }

    @Test
    void constructor() {
        final String text = "T";
        final JavadocTag tag = new JavadocTagImpl(NAME, text);
        assertEquals(text, tag.getText().orElseThrow(NoSuchElementException::new));
    }

    @Test
    void constructor2() {
        final String text = "T";
        final String value = "V";
        final JavadocTag tag = new JavadocTagImpl(NAME, value, text);
        assertEquals(value, tag.getValue().orElseThrow(NoSuchElementException::new));
        assertEquals(text, tag.getText().orElseThrow(NoSuchElementException::new));
    }

    @Test
    void imports() {
        assertTrue(instance().getImports().isEmpty());
    }

    @Test
    void getValue() {
        assertFalse(instance().getValue().isPresent());
    }

}


text:
CREATE TEMPORARY TABLE duplicate_arraydata AS
  (SELECT a.id FROM arraydata a,
                    (SELECT data_file FROM arraydata GROUP BY data_file HAVING count(*) > 1) d
    WHERE a.data_file = d.data_file AND a.data_set is null
  );

DELETE FROM protocol_application WHERE array_data in (SELECT * FROM duplicate_arraydata);
DELETE FROM image WHERE raw_array_data in (SELECT * FROM duplicate_arraydata);
DELETE FROM derivedarraydata_derivedfrom WHERE derivedarraydata_id in (SELECT * FROM duplicate_arraydata);
DELETE FROM derivedarraydata_derivedfrom WHERE derivedfrom_arraydata_id in (SELECT * FROM duplicate_arraydata);
DELETE FROM arraydata_hybridizations WHERE arraydata_id in (SELECT * FROM duplicate_arraydata);
DELETE FROM arraydata WHERE id IN (SELECT * FROM duplicate_arraydata);

ALTER TABLE arraydata ADD UNIQUE (data_file);


text:
set -e -u -o pipefail # Fail on error

dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd "$dir"

rm -rf osxfuse macfuse

version=${VERSION:?"Need to set VERSION for Fuse"}
if [ "$version" = "4.2.4" ]; then
  tar -xjf /Volumes/Keybase/team/keybase.builds.macos/macfuse/macfuse-4.2.4-src.tbz
  mv macfuse-4.2.4-src macfuse
else
  echo "Unsupported VERSION"
  exit 1
fi

# Patch macfuse to turn it into kbfuse
./patch.sh

# Compile
rm -rf /tmp/kbfuse*
cd macfuse
# If you get an error compiling you might have to run `brew link gettext --force` (see https://github.com/osxfuse/osxfuse/issues/149).
# use 11.3 SDK (-s) and set deployment target 11.13 (-d). Build for macOS 11 kernel, and support up to Darwin 21 (macOS 12).
./build.sh -v 5 -t filesystembundle -- -s 11.3 -d 11.3 --kext="11,11.3,21" --kext="12->11"

cd $dir
rm -rf kbfuse.bundle
ditto /tmp/kbfuse/filesystembundle/kbfuse.fs kbfuse.bundle

# Backup the filesystembundle directory in case we need debug symbols later
cd /tmp/kbfuse/filesystembundle
tar zcvpf $dir/fsbundle.tgz  .

# Sign the kext
cd $dir
codesign --verbose --timestamp --options runtime --sign "Developer ID Application: Keybase, Inc." kbfuse.bundle/Contents/Extensions/11/kbfuse.kext
codesign --verbose --timestamp --options runtime --sign "Developer ID Application: Keybase, Inc." kbfuse.bundle/Contents/Resources/mount_kbfuse
codesign --verbose --timestamp --options runtime --sign "Developer ID Application: Keybase, Inc." kbfuse.bundle/Contents/Resources/load_kbfuse
codesign --verbose --force --deep --timestamp --options runtime --sign "Developer ID Application: Keybase, Inc." kbfuse.bundle

# Verify
codesign --verbose --verify kbfuse.bundle/Contents/Extensions/11/kbfuse.kext
codesign --verbose --verify kbfuse.bundle/Contents/Resources/mount_kbfuse
codesign --verbose --verify kbfuse.bundle/Contents/Resources/load_kbfuse
codesign --verbose --verify kbfuse.bundle


text:
const HtmlWebpackPlugin = require('html-webpack-plugin');
const config = require('frint-config');
const path = require('path');

module.exports = {
  entry: {
    core: path.resolve(__dirname, 'core/index.js')
  },
  devtool: 'source-map',
  output: {
    path: path.resolve(__dirname, 'build/js'),
    filename: '[name].js',
    libraryTarget: 'umd'
  },
  module: {
    rules: [
      {
        test: /\.(js)$/,
        loader: 'babel-loader',
        query: {
          presets: [
            'travix'
          ]
        }
      }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: path.resolve(__dirname, 'layouts/index.ejs'),
      filename: path.resolve(__dirname, 'build/index.html'),
      chunksSortMode({ names }) {
        return names[0] === 'core' ? -1 : 1;
      }
    })
  ],
  externals: []
    .concat(config.lodashExternals)
    .concat(config.rxjsExternals)
    .concat(config.thirdPartyExternals)
    .concat(config.frintExternals)
};


text:
package com.justplay1.shoppist.entity.mappers;

import com.justplay1.shoppist.entity.ListDAO;
import com.justplay1.shoppist.models.ListModel;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.inject.Inject;
import javax.inject.Singleton;

/**
 * Created by Mkhytar Mkhoian.
 */
@Singleton
public class ListDAODataMapper {

    @Inject
    public ListDAODataMapper() {
    }

    public ListModel transformFromDAO(ListDAO dao) {
        ListModel model = null;
        if (dao != null) {
            model = new ListModel(dao.getId(),
                    dao.getName(),
                    dao.getBoughtCount(),
                    dao.getTimeCreated(),
                    dao.getPriority(),
                    dao.getColor(),
                    dao.getSize());
        }
        return model;
    }

    public List<ListModel> transformFromDAO(Collection<ListDAO> daos) {
        List<ListModel> models = new ArrayList<>();
        ListModel model;
        for (ListDAO dao : daos) {
            model = transformFromDAO(dao);
            if (model != null) {
                models.add(model);
            }
        }
        return models;
    }

    public ListDAO transformToDAO(ListModel model) {
        ListDAO dao = null;
        if (model != null) {
            dao = new ListDAO(model.getId(),
                    model.getName(),
                    model.getBoughtCount(),
                    model.getTimeCreated(),
                    model.getPriority(),
                    model.getColor(),
                    model.getSize());
        }
        return dao;
    }

    public List<ListDAO> transformToDAO(Collection<ListModel> models) {
        List<ListDAO> daos = new ArrayList<>();
        ListDAO dao;
        for (ListModel model : models) {
            dao = transformToDAO(model);
            if (dao != null) {
                daos.add(dao);
            }
        }
        return daos;
    }
}


text:
FROM crusaider/baseimage-node

# Install application
ADD app/ /app/

# Install dependencies
WORKDIR /app
RUN npm install --production

# Register service
RUN mkdir /etc/service/nodeapp && \
    echo "#!/bin/sh\nexec /usr/bin/node /app/server.js" > /etc/service/nodeapp/run && \
    chmod +x /etc/service/nodeapp/run

EXPOSE 8080


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="e25f92f9-39a5-4865-a530-4ff95d416472" name="Default" comment="" />
    <ignored path="WebViewer.iws" />
    <ignored path=".idea/workspace.xml" />
    <ignored path=".idea/dataSources.local.xml" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="CoverageDataManager">
    <SUITE FILE_PATH="coverage/WebViewer$main.coverage" NAME="main Coverage Results" MODIFIED="1481816526614" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Python" />
  </component>
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="WebViewer" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="view.xml" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/Python/test/view.xml">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="216">
              <caret line="12" column="6" lean-forward="false" selection-start-line="12" selection-start-column="6" selection-end-line="12" selection-end-column="6" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="parser.py" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/Python/parser.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="552">
              <caret line="72" column="16" lean-forward="true" selection-start-line="72" selection-start-column="16" selection-end-line="72" selection-end-column="16" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="viewer.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/Python/viewer.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="401">
              <caret line="26" column="31" lean-forward="false" selection-start-line="26" selection-start-column="31" selection-end-line="26" selection-end-column="31" />
              <folding>
                <element signature="e#0#10#0" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="web.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/Python/web.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="599">
              <caret line="56" column="0" lean-forward="true" selection-start-line="56" selection-start-column="0" selection-end-line="56" selection-end-column="0" />
              <folding>
                <element signature="e#0#15#0" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="extensions.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/Python/test/extensions.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="0">
              <caret line="0" column="22" lean-forward="true" selection-start-line="0" selection-start-column="22" selection-end-line="0" selection-end-column="22" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="file.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/Python/file.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="0">
              <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="Python Script" />
      </list>
    </option>
  </component>
  <component name="FindInProjectRecents">
    <findStrings>
      <find>print</find>
    </findStrings>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/Python/test/file.py" />
        <option value="$PROJECT_DIR$/Python/test/__init__.py" />
        <option value="$PROJECT_DIR$/Python/__init__.py" />
        <option value="$PROJECT_DIR$/Python/constants.py" />
        <option value="$PROJECT_DIR$/Python/test/view.xml" />
        <option value="$PROJECT_DIR$/Python/test/web.py" />
        <option value="$PROJECT_DIR$/Python/main.py" />
        <option value="$PROJECT_DIR$/Python/test/extensions.py" />
        <option value="$PROJECT_DIR$/Python/viewer.py" />
        <option value="$PROJECT_DIR$/Python/parser.py" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="ProjectFrameBounds">
    <option name="y" value="30" />
    <option name="width" value="1920" />
    <option name="height" value="1170" />
  </component>
  <component name="ProjectLevelVcsManager">
    <OptionsSetting value="false" id="Update" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="Scratches" />
      <pane id="Scope" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="WebViewer" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="WebViewer" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="WebViewer" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="WebViewer" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="Python" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="last_opened_file_path" value="$PROJECT_DIR$/Python" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
  </component>
  <component name="RecentsManager">
    <key name="MoveFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$/Python" />
    </key>
  </component>
  <component name="RunManager" selected="Python.main">
    <configuration default="true" type="PythonConfigurationType" factoryName="Python">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="/usr/bin/python2.7" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="WebViewer" />
      <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
      <option name="SCRIPT_NAME" value="main.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="Tox" factoryName="Tox">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
      <module name="WebViewer" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Attests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="WebViewer" />
      <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Doctests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="WebViewer" />
      <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Nosetests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="WebViewer" />
      <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="PARAMS" value="" />
      <option name="USE_PARAM" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Unittests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="WebViewer" />
      <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="PUREUNITTEST" value="true" />
      <option name="PARAMS" value="" />
      <option name="USE_PARAM" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="py.test">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="WebViewer" />
      <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="testToRun" value="" />
      <option name="keywords" value="" />
      <option name="params" value="" />
      <option name="USE_PARAM" value="false" />
      <option name="USE_KEYWORD" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="main" type="PythonConfigurationType" factoryName="Python">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="/usr/bin/python2.7" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Python" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="WebViewer" />
      <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Python/main.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <list size="1">
      <item index="0" class="java.lang.String" itemvalue="Python.main" />
    </list>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="e25f92f9-39a5-4865-a530-4ff95d416472" name="Default" comment="" />
      <created>1481804545466</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1481804545466</updated>
    </task>
    <task id="LOCAL-00001" summary="Complete XML parser">
      <created>1481816615432</created>
      <option name="number" value="00001" />
      <option name="presentableId" value="LOCAL-00001" />
      <option name="project" value="LOCAL" />
      <updated>1481816615432</updated>
    </task>
    <option name="localTasksCounter" value="2" />
    <servers />
  </component>
  <component name="TodoView">
    <todo-panel id="selected-file">
      <is-autoscroll-to-source value="true" />
    </todo-panel>
    <todo-panel id="all">
      <are-packages-shown value="true" />
      <is-autoscroll-to-source value="true" />
    </todo-panel>
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="30" width="1920" height="1170" extended-state="0" />
    <editor active="false" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.19175911" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32976654" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32879376" sideWeight="0.5029054" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3288201" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.327853" sideWeight="0.49709457" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.327853" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.28239846" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.327853" sideWeight="0.4981511" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection Results" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32976654" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
    <layout-to-restore>
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3294686" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32947975" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2753623" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3294686" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18649517" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32947975" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
    </layout-to-restore>
  </component>
  <component name="Vcs.Log.Tabs.Properties">
    <option name="TAB_STATES">
      <map>
        <entry key="MAIN">
          <value>
            <State>
              <option name="RECENTLY_FILTERED_USER_GROUPS">
                <collection />
              </option>
              <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
                <collection />
              </option>
            </State>
          </value>
        </entry>
      </map>
    </option>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <MESSAGE value="Complete XML parser" />
    <option name="LAST_COMMIT_MESSAGE" value="Complete XML parser" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/Python/test/view.xml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="18">
          <caret line="1" column="19" lean-forward="false" selection-start-line="1" selection-start-column="19" selection-end-line="1" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/parser.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1080">
          <caret line="61" column="45" lean-forward="false" selection-start-line="61" selection-start-column="45" selection-end-line="61" selection-end-column="45" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/main.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="396">
          <caret line="24" column="23" lean-forward="false" selection-start-line="24" selection-start-column="23" selection-end-line="24" selection-end-column="23" />
          <folding>
            <element signature="e#0#22#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/viewer.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding>
            <element signature="e#0#10#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/extensions.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="90">
          <caret line="6" column="68" lean-forward="false" selection-start-line="6" selection-start-column="68" selection-end-line="6" selection-end-column="68" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/file.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/view.xml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="22">
          <caret line="1" column="19" lean-forward="false" selection-start-line="1" selection-start-column="19" selection-end-line="1" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/parser.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1320">
          <caret line="61" column="45" lean-forward="false" selection-start-line="61" selection-start-column="45" selection-end-line="61" selection-end-column="45" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/main.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="484">
          <caret line="24" column="23" lean-forward="false" selection-start-line="24" selection-start-column="23" selection-end-line="24" selection-end-column="23" />
          <folding>
            <element signature="e#0#22#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/viewer.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding>
            <element signature="e#0#10#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/extensions.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="110">
          <caret line="6" column="68" lean-forward="false" selection-start-line="6" selection-start-column="68" selection-end-line="6" selection-end-column="68" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/file.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/view.xml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="264">
          <caret line="12" column="0" lean-forward="false" selection-start-line="12" selection-start-column="0" selection-end-line="12" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/parser.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/main.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="330">
          <caret line="17" column="29" lean-forward="false" selection-start-line="17" selection-start-column="29" selection-end-line="17" selection-end-column="29" />
          <folding>
            <element signature="e#0#22#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/viewer.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1100">
          <caret line="50" column="0" lean-forward="false" selection-start-line="50" selection-start-column="0" selection-end-line="50" selection-end-column="0" />
          <folding>
            <element signature="e#0#10#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/extensions.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="110">
          <caret line="6" column="68" lean-forward="false" selection-start-line="6" selection-start-column="68" selection-end-line="6" selection-end-column="68" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/file.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/view.xml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="264">
          <caret line="12" column="0" lean-forward="false" selection-start-line="12" selection-start-column="0" selection-end-line="12" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/parser.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/main.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="330">
          <caret line="17" column="29" lean-forward="false" selection-start-line="17" selection-start-column="29" selection-end-line="17" selection-end-column="29" />
          <folding>
            <element signature="e#0#22#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/viewer.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1100">
          <caret line="50" column="0" lean-forward="false" selection-start-line="50" selection-start-column="0" selection-end-line="50" selection-end-column="0" />
          <folding>
            <element signature="e#0#10#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/extensions.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="110">
          <caret line="6" column="68" lean-forward="false" selection-start-line="6" selection-start-column="68" selection-end-line="6" selection-end-column="68" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/file.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/view.xml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="198">
          <caret line="9" column="34" lean-forward="false" selection-start-line="9" selection-start-column="34" selection-end-line="9" selection-end-column="34" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/parser.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1584">
          <caret line="73" column="0" lean-forward="false" selection-start-line="73" selection-start-column="0" selection-end-line="73" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/main.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="308">
          <caret line="16" column="29" lean-forward="false" selection-start-line="16" selection-start-column="29" selection-end-line="16" selection-end-column="29" />
          <folding>
            <element signature="e#0#22#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/viewer.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding>
            <element signature="e#0#10#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/extensions.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="110">
          <caret line="6" column="68" lean-forward="false" selection-start-line="6" selection-start-column="68" selection-end-line="6" selection-end-column="68" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/file.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/view.xml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/parser.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1584">
          <caret line="73" column="0" lean-forward="false" selection-start-line="73" selection-start-column="0" selection-end-line="73" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/main.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="308">
          <caret line="16" column="29" lean-forward="false" selection-start-line="16" selection-start-column="29" selection-end-line="16" selection-end-column="29" />
          <folding>
            <element signature="e#0#22#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/parser.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/main.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="88">
          <caret line="4" column="13" lean-forward="false" selection-start-line="4" selection-start-column="13" selection-end-line="4" selection-end-column="13" />
          <folding>
            <element signature="e#0#22#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file:///usr/lib/python2.7/xml/dom/minidom.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="874">
          <caret line="304" column="32" lean-forward="false" selection-start-line="304" selection-start-column="32" selection-end-line="304" selection-end-column="32" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/__init__.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/__init__.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/globals.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="36">
          <caret line="2" column="0" lean-forward="false" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/view.xml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="216">
          <caret line="12" column="6" lean-forward="false" selection-start-line="12" selection-start-column="6" selection-end-line="12" selection-end-column="6" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/test/extensions.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="22" lean-forward="true" selection-start-line="0" selection-start-column="22" selection-end-line="0" selection-end-column="22" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/web.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="599">
          <caret line="56" column="0" lean-forward="true" selection-start-line="56" selection-start-column="0" selection-end-line="56" selection-end-column="0" />
          <folding>
            <element signature="e#0#15#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/file.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/main.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="432">
          <caret line="24" column="0" lean-forward="false" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
          <folding>
            <element signature="e#0#22#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/viewer.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="401">
          <caret line="26" column="31" lean-forward="false" selection-start-line="26" selection-start-column="31" selection-end-line="26" selection-end-column="31" />
          <folding>
            <element signature="e#0#10#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Python/parser.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="552">
          <caret line="72" column="16" lean-forward="true" selection-start-line="72" selection-start-column="16" selection-end-line="72" selection-end-column="16" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
<!DOCTYPE html>

        <title>CSS Test: right float, polygon + padding-box + shape-margin</title>
        <link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
        <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-polygon">
        <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
        <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-margin-property">
        <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#border-box">
        <link rel="match" href="reference/shape-outside-polygon-010-ref.html">
        <meta name="flags" content="ahem" />
        <meta name="assert" content="The test verifies that text wraps around a
                                     right float with a shape-outside defined as
                                     an polygon from the padding box with a shape margin.">

    <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />

The test passes if there is green square and no red.

        XXXXXXXXXXXX XXXXXXXXXXXX XX XX XX XX XXXXXXX XXXXX XXXXX XXXXX XXXXX XXXXXXXXXXXX


text:
import splunktalib.rest as rest
import splunktalib.common.xml_dom_parser as xdp

def _do_rest(uri, session_key):
    resp, content = rest.splunkd_request(uri, session_key)
    if resp is None:
        return None

    if resp.status not in (200, 201):
        return None

    stanza_objs = xdp.parse_conf_xml_dom(content)
    if not stanza_objs:
        return None

    return stanza_objs[0]

class ServerInfo(object):

    def __init__(self, splunkd_uri, session_key):
        uri = "{}/services/server/info".format(splunkd_uri)
        server_info = _do_rest(uri, session_key)
        if server_info is None:
            raise Exception("Failed to init ServerInfo")

        self._server_info = server_info

    def is_captain(self):
        """
        :return: True if splunkd_uri is captain otherwise False
        """

        return "shc_captain" in self._server_info["server_roles"]

    def is_search_head(self):
        for sh in ("search_head", "cluster_search_head"):
            if sh in self._server_info["server_roles"]:
                return True
        return False

    def is_shc_member(self):
        return "cluster_search_head" in self._server_info["server_roles"]

    def version(self):
        return self._server_info["version"]

    def to_dict(self):
        return self._server_info

if __name__ == "__main__":
    import splunktalib.credentials as cred

    sp_uri = "https://localhost:8089"
    skey = cred.CredentialManager.get_session_key("admin", "admin")
    si = ServerInfo(sp_uri, skey)
    assert(not si.is_captain())

    sp_uri = "https://qa-systest-03.sv.splunk.com:1901"
    skey = cred.CredentialManager.get_session_key(
        "admin", "notchagneme")
    si = ServerInfo(sp_uri, skey)
    assert(si.is_captain())
    assert(si.is_search_head())

    sp_uri = "https://qa-systest-01.sv.splunk.com:1901"
    skey = cred.CredentialManager.get_session_key(
        "admin", "notchagneme")
    si = ServerInfo(sp_uri, skey)
    assert(not si.is_captain())
    assert(si.is_search_head())