text:
Patterns builds on the excellent
[AnythingSlider](https://github.com/CSS-Tricks/AnythingSlider/wiki)
(licensed under LGPL 3) to provide a very simple way to create
carousels. Just by adding a `pat-carousel` class to your markup you can
turn anything into a beautiful carousel.

Carousels usually use an unordered list to define all panels:

This is not required though: any element can be used as container and
for panels. For example using a sequence of divs in a section:

This is panel 1

....

This is panel 2

....

There are no restrictions on the content that you use in a panels: you
can use images, videos, or any other HTML content.

Any links in the page that point directly to a panel will cause the
carousel to jump to the linked panel when clicked.

As you can see in the reports screenshot
     AcmeReports(TM) can generate beautiful reports.

Such links will automatically get a `current` class when the panel they
are pointing to is displayed.

### Lazy loading

The carousel supports lazy loading. To use this simply give your images
a `data-src` attribute. When a panel is about to be displayed the
carousel will move all `data-src` attributes to `src`

### Customizing behaviour

The default carousel is quite spartan. You can customize it through
options in the `data-pat-carousel` attribute.

>    This plugin is not fully stable yet. The available options and spelling may
>    change in the future.

| Setting | Default | Description |
| ------- | ------- | ----------- |
| `auto-play` | true | Indicates if the carousel should start playing automatically. If `control-arrows` is enabled users will be able to control this manually.|
| ------- | ------- | ----------- |
| `loop` | true | Indicates if the carousel will loop. |
| ------- | ------- | ----------- |
| `resize` | false | If enabled the carousel will be resized to fill its parent. |
| ------- | ------- | ----------- |
| `expand` | false | If enable all panels will be resizes to fill the carousel. If not enabled the will dynamically adjust its size to match the currently shown panel. |
| ------- | ------- | ----------- |
| `control-arrows` | false | If enabled back and forward-arrows are are created. Note that users can always use swipes and keyboard to control the carousel as well. |
| ------- | ------- | ----------- |
| `control-navigation` | false | If enabled a list of links to navigate within the carousel is created. |
| ------- | ------- | ----------- |
| `control-startstop` | false | If enabled a button to start and stop carousel animation is added. |
| ------- | ------- | ----------- |
| `time-delay` | 3000 | The time in milliseconds a single panel is shown when animation is active. |
| ------- | ------- | ----------- |
| `time-animation` | 600 | The duration of a transition animation in milliseconds. |
| ------- | ------- | ----------- |

redpajama_set_name: RedPajamaGithub


text:
'use strict';

var chai = require('chai');
var nodemailer = require('../src/nodemailer');
var sinon = require('sinon');
var http = require('http');
var fs = require('fs');
var expect = chai.expect;
var SMTPServer = require('smtp-server').SMTPServer;
var crypto = require('crypto');

chai.config.includeStack = true;

var PORT_NUMBER = 8397;

describe('Nodemailer unit tests', function() {
    var nm, transport;

    beforeEach(function() {
        transport = {
            name: 'testsend',
            version: '1',
            send: function(data, callback) {
                callback();
            }
        };
        nm = nodemailer.createTransport(transport);
    });

    it('should create Nodemailer transport object', function() {
        expect(nm).to.exist;
    });

    describe('Hooking plugins', function() {
        it('should add a plugin to queue', function() {
            nm.use('compile', 'abc');
            nm.use('compile', 'def');

            expect(nm._plugins).to.deep.equal({
                compile: [
                    'abc',
                    'def'
                ],
                stream: []
            });
        });

        it('should process compile and stream plugins', function(done) {
            var compilePlugin = sinon.stub().yields(null);
            var streamPlugin = sinon.stub().yields(null);

            nm.use('compile', compilePlugin);
            nm.use('compile', streamPlugin);

            nm.sendMail({
                subject: 'test'
            }, function() {
                expect(compilePlugin.callCount).to.equal(1);
                expect(compilePlugin.args[0][0].data.subject).to.equal('test');
                expect(compilePlugin.args[0][0].message).to.exist;

                expect(streamPlugin.callCount).to.equal(1);
                expect(streamPlugin.args[0][0].data.subject).to.equal('test');
                expect(streamPlugin.args[0][0].message).to.exist;
                done();
            });
        });
    });

    describe('#sendMail', function() {
        it('should process sendMail', function(done) {
            sinon.stub(transport, 'send').yields(null, 'tere tere');

            nm.sendMail({
                subject: 'test'
            }, function(err, info) {
                expect(transport.send.callCount).to.equal(1);
                expect(info).to.equal('tere tere');
                transport.send.restore();
                done();
            });
        });

        it('should return transport error', function(done) {
            sinon.stub(transport, 'send').yields('tere tere');

            nm.sendMail({
                subject: 'test'
            }, function(err) {
                expect(transport.send.callCount).to.equal(1);
                expect(err).to.equal('tere tere');
                transport.send.restore();
                done();
            });
        });

        it('should override xMailer', function(done) {
            sinon.stub(transport, 'send', function(mail, callback) {
                expect(mail.message.getHeader('x-mailer')).to.equal('yyyy');
                callback();
            });
            nm.sendMail({
                subject: 'test',
                xMailer: 'yyyy'
            }, function() {
                expect(transport.send.callCount).to.equal(1);
                transport.send.restore();
                done();
            });
        });

        it('return invalid configuration error', function(done) {
            nm = nodemailer.createTransport('SMTP', {});
            nm.sendMail({
                subject: 'test',
                xMailer: 'yyyy'
            }, function(err) {
                expect(err).to.exist;
                done();
            });
        });
    });

    describe('Resolver tests', function() {
        var port = 10337;
        var server;

        beforeEach(function(done) {
            server = http.createServer(function(req, res) {
                res.writeHead(200, {
                    'Content-Type': 'text/plain'
                });
                res.end('
Tere, tere

vana kere!
\n');
            });

            server.listen(port, done);
        });

        afterEach(function(done) {
            server.close(done);
        });

        it('should set text from html string', function(done) {
            var mail = {
                data: {
                    html: '
Tere, tere

vana kere!
\n'
                }
            };
            nm.resolveContent(mail.data, 'html', function(err, value) {
                expect(err).to.not.exist;
                expect(value).to.equal('
Tere, tere

vana kere!
\n');
                done();
            });
        });

        it('should set text from html buffer', function(done) {
            var mail = {
                data: {
                    html: new Buffer('
Tere, tere

vana kere!
\n')
                }
            };
            nm.resolveContent(mail.data, 'html', function(err, value) {
                expect(err).to.not.exist;
                expect(value).to.deep.equal(mail.data.html);
                done();
            });
        });

        it('should set text from a html file', function(done) {
            var mail = {
                data: {
                    html: {
                        path: __dirname + '/fixtures/message.html'
                    }
                }
            };
            nm.resolveContent(mail.data, 'html', function(err, value) {
                expect(err).to.not.exist;
                expect(value).to.deep.equal(new Buffer('
Tere, tere

vana kere!
\n'));
                done();
            });
        });

        it('should set text from an html url', function(done) {
            var mail = {
                data: {
                    html: {
                        path: 'http://localhost:' + port + '/message.html'
                    }
                }
            };
            nm.resolveContent(mail.data, 'html', function(err, value) {
                expect(err).to.not.exist;
                expect(value).to.deep.equal(new Buffer('
Tere, tere

vana kere!
\n'));
                done();
            });
        });

        it('should set text from a html stream', function(done) {
            var mail = {
                data: {
                    html: fs.createReadStream(__dirname + '/fixtures/message.html')
                }
            };
            nm.resolveContent(mail.data, 'html', function(err, value) {
                expect(err).to.not.exist;
                expect(mail).to.deep.equal({
                    data: {
                        html: new Buffer('
Tere, tere

vana kere!
\n')
                    }
                });
                expect(value).to.deep.equal(new Buffer('
Tere, tere

vana kere!
\n'));
                done();
            });
        });

        it('should return an error', function(done) {
            var mail = {
                data: {
                    html: {
                        path: 'http://localhost:' + (port + 1000) + '/message.html'
                    }
                }
            };
            nm.resolveContent(mail.data, 'html', function(err) {
                expect(err).to.exist;
                done();
            });
        });

        it('should return encoded string as buffer', function(done) {
            var str = '
Tere, tere

vana kere!
\n';
            var mail = {
                data: {
                    html: {
                        encoding: 'base64',
                        content: new Buffer(str).toString('base64')
                    }
                }
            };
            nm.resolveContent(mail.data, 'html', function(err, value) {
                expect(err).to.not.exist;
                expect(value).to.deep.equal(new Buffer(str));
                done();
            });
        });

        describe('data uri tests', function() {

            it('should resolve with mime type and base64', function(done) {
                var mail = {
                    data: {
                        attachment: {
                            path: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
                        }
                    }
                };
                nm.resolveContent(mail.data, 'attachment', function(err, value) {
                    expect(err).to.not.exist;
                    expect(value).to.deep.equal(new Buffer('iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', 'base64'));
                    done();
                });
            });

            it('should resolve with mime type and plaintext', function(done) {
                var mail = {
                    data: {
                        attachment: {
                            path: 'data:image/png,tere%20tere'
                        }
                    }
                };
                nm.resolveContent(mail.data, 'attachment', function(err, value) {
                    expect(err).to.not.exist;
                    expect(value).to.deep.equal(new Buffer('tere tere'));
                    done();
                });
            });

            it('should resolve with plaintext', function(done) {
                var mail = {
                    data: {
                        attachment: {
                            path: 'data:,tere%20tere'
                        }
                    }
                };
                nm.resolveContent(mail.data, 'attachment', function(err, value) {
                    expect(err).to.not.exist;
                    expect(value).to.deep.equal(new Buffer('tere tere'));
                    done();
                });
            });

            it('should resolve with mime type, charset and base64', function(done) {
                var mail = {
                    data: {
                        attachment: {
                            path: 'data:image/png;charset=iso-8859-1;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
                        }
                    }
                };
                nm.resolveContent(mail.data, 'attachment', function(err, value) {
                    expect(err).to.not.exist;
                    expect(value).to.deep.equal(new Buffer('iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', 'base64'));
                    done();
                });
            });
        });
    });
});

describe('Nodemailer integration tests', function() {
    this.timeout(10000);
    var server;

    beforeEach(function(done) {
        server = new SMTPServer({
            authMethods: ['PLAIN', 'XOAUTH2'],
            disabledCommands: ['STARTTLS'],

            onData: function(stream, session, callback) {
                var hash = crypto.createHash('md5');
                stream.on('data', function(chunk) {
                    hash.update(chunk);
                });
                stream.on('end', function() {
                    callback(null, hash.digest('hex'));
                });
            },

            onAuth: function(auth, session, callback) {
                if (auth.method !== 'XOAUTH2') {
                    if (auth.username !== 'testuser' || auth.password !== 'testpass') {
                        return callback(new Error('Invalid username or password'));
                    }
                } else {
                    if (auth.username !== 'testuser' || auth.accessToken !== 'testtoken') {
                        return callback(null, {
                            data: {
                                status: '401',
                                schemes: 'bearer mac',
                                scope: 'my_smtp_access_scope_name'
                            }
                        });
                    }
                }
                callback(null, {
                    user: 123
                });
            },
            onMailFrom: function(address, session, callback) {
                if (!/@valid.sender/.test(address.address)) {
                    return callback(new Error('Only user@valid.sender is allowed to send mail'));
                }
                return callback(); // Accept the address
            },
            onRcptTo: function(address, session, callback) {
                if (!/@valid.recipient/.test(address.address)) {
                    return callback(new Error('Only user@valid.recipient is allowed to receive mail'));
                }
                return callback(); // Accept the address
            },
            logger: false
        });

        server.listen(PORT_NUMBER, done);
    });

    afterEach(function(done) {
        server.close(done);
    });

    it('should log in and send mail', function(done) {
        var nm = nodemailer.createTransport({
            host: 'localhost',
            port: PORT_NUMBER,
            auth: {
                user: 'testuser',
                pass: 'testpass'
            },
            ignoreTLS: true
        });

        var mailData = {
            from: 'from@valid.sender',
            sender: 'sender@valid.sender',
            to: ['to1@valid.recipient', 'to2@valid.recipient', 'to@invalid.recipient'],
            subject: 'test',
            date: new Date('Mon, 31 Jan 2011 23:01:00 +0000'),
            messageId: 'abc@def',
            xMailer: 'aaa',
            text: 'uuu'
        };

        nm.sendMail(mailData, function(err, info) {
            expect(err).to.not.exist;
            expect(info.accepted).to.deep.equal([
                'to1@valid.recipient',
                'to2@valid.recipient'
            ]);
            expect(info.rejected).to.deep.equal([
                'to@invalid.recipient'
            ]);
            expect(info.messageId).to.equal('abc@def');
            expect(/538ec1431ce376bc46f11b0f51849beb/i.test(info.response)).to.be.true;
            done();
        });
    });

    it('should response auth error', function(done) {
        var nm = nodemailer.createTransport({
            host: 'localhost',
            port: PORT_NUMBER,
            auth: {
                user: 'invalid user',
                pass: 'testpass'
            },
            ignoreTLS: true
        });

        var mailData = {
            from: 'from@valid.sender',
            to: ['to1@valid.recipient', 'to2@valid.recipient', 'to@invalid.recipient'],
            subject: 'test',
            date: new Date('Mon, 31 Jan 2011 23:01:00 +0000'),
            messageId: 'abc@def',
            xMailer: 'aaa',
            text: 'uuu'
        };

        nm.sendMail(mailData, function(err, info) {
            expect(err).to.exist;
            expect(info).to.not.exist;
            expect(err.code).to.equal('EAUTH');
            done();
        });
    });

    it('should response envelope error', function(done) {
        var nm = nodemailer.createTransport({
            host: 'localhost',
            port: PORT_NUMBER,
            auth: {
                user: 'testuser',
                pass: 'testpass'
            },
            ignoreTLS: true
        });

        var mailData = {
            from: 'from@valid.sender',
            to: ['to@invalid.recipient'],
            subject: 'test',
            date: new Date('Mon, 31 Jan 2011 23:01:00 +0000'),
            messageId: 'abc@def',
            xMailer: 'aaa',
            text: 'uuu'
        };

        nm.sendMail(mailData, function(err, info) {
            expect(err).to.exist;
            expect(info).to.not.exist;
            expect(err.code).to.equal('EENVELOPE');
            done();
        });
    });

    it('should override envelope', function(done) {
        var nm = nodemailer.createTransport({
            host: 'localhost',
            port: PORT_NUMBER,
            auth: {
                user: 'testuser',
                pass: 'testpass'
            },
            ignoreTLS: true
        });

        var mailData = {
            from: 'from@valid.sender',
            to: ['to1@valid.recipient', 'to2@valid.recipient', 'to@invalid.recipient'],
            subject: 'test',
            date: new Date('Mon, 31 Jan 2011 23:01:00 +0000'),
            messageId: 'abc@def',
            xMailer: 'aaa',
            text: 'uuu',
            envelope: {
                from: 'aaa@valid.sender',
                to: 'vvv@valid.recipient'
            }
        };

        nm.sendMail(mailData, function(err, info) {
            expect(err).to.not.exist;
            expect(info.accepted).to.deep.equal([
                'vvv@valid.recipient'
            ]);
            expect(info.rejected).to.deep.equal([]);
            expect(info.messageId).to.equal('abc@def');
            expect(/eaa13435e1401328be32bc7a4c629f9f/i.test(info.response)).to.be.true;
            done();
        });
    });
});


text:
package com.fruit.sales.web.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

//@EnableWebMvc
//@Configuration
public class WebConfig extends WebMvcConfigurerAdapter{

	@Override
	public void addCorsMappings(CorsRegistry registry) {

		System.out.println("------");
		registry.addMapping("/rest/**").
		allowedOrigins("*")
		.allowCredentials(true);

//		registry.addMapping("/**")
//		.allowedOrigins("*")
//		.allowedMethods(HttpMethod.GET.name(), HttpMethod.HEAD.name(), HttpMethod.POST.name(), HttpMethod.PUT.name())
//		.allowedHeaders("*")
//		.allowCredentials(true)
//		.maxAge(1800);
	}

}


text:
jest.mock('./executePrettierOnBufferRange');

const buildMockTextEditor = require('../../tests/mocks/textEditor');
const executePrettierOnBufferRange = require('./executePrettierOnBufferRange');
const executePrettierOnEmbeddedScripts = require('./executePrettierOnEmbeddedScripts');

test('retrieves buffer ranges for embedded scripts and executes prettier on them', () => {
  const entireFileRange = {
    start: { row: 0, column: 0 },
    end: { row: 4, column: 5 },
  };
  const editor = buildMockTextEditor({
    backwardsScanInBufferRange: (regex, range, iterator) => iterator({ range: entireFileRange }),
  });

  executePrettierOnEmbeddedScripts(editor);

  const expectedScriptRange = { start: { row: 1, column: 0 }, end: { row: 4, column: 5 } };
  expect(executePrettierOnBufferRange).toHaveBeenCalledWith(editor, expectedScriptRange);
});


text:
kudo
====

A python library for communicating with the [KuDo](http://kudo.co.id)
payment gateway.

The author of this library is not associated with KuDo and this software
is not endorsed by Kudo

Synopsis
---

    # get you some kudo
    import kudo

    # create an instance of the kudo service
    mykudo = kudo.Kudo(api_key='your-api-key')

    # notify kudo of orders submitted through your system
    resp = mykudo.create_order()
    resp = mykudo.lookup_order(order_id='the-order-id')
    resp = mykudo.cancel_order(order_id='the-order-id')


text:
import os
import unittest

import numpy as np

from pymatgen.analysis.magnetism.jahnteller import JahnTellerAnalyzer, Species
from pymatgen.io.cif import CifParser
from pymatgen.util.testing import PymatgenTest

class JahnTellerTest(unittest.TestCase):
    def setUp(self):
        self.jt = JahnTellerAnalyzer()

    def test_jahn_teller_species_analysis(self):
        # 1 d-shell electron
        m = self.jt.get_magnitude_of_effect_from_species("Ti3+", "", "oct")
        self.assertEqual(m, "weak")

        # 2 d-shell electrons
        m = self.jt.get_magnitude_of_effect_from_species("Ti2+", "", "oct")
        self.assertEqual(m, "weak")
        m = self.jt.get_magnitude_of_effect_from_species("V3+", "", "oct")
        self.assertEqual(m, "weak")

        # 3
        m = self.jt.get_magnitude_of_effect_from_species("V2+", "", "oct")
        self.assertEqual(m, "none")
        m = self.jt.get_magnitude_of_effect_from_species("Cr3+", "", "oct")
        self.assertEqual(m, "none")

        # 4
        m = self.jt.get_magnitude_of_effect_from_species("Cr2+", "high", "oct")
        self.assertEqual(m, "strong")
        m = self.jt.get_magnitude_of_effect_from_species("Cr2+", "low", "oct")
        self.assertEqual(m, "weak")
        m = self.jt.get_magnitude_of_effect_from_species("Mn3+", "high", "oct")
        self.assertEqual(m, "strong")
        m = self.jt.get_magnitude_of_effect_from_species("Mn3+", "low", "oct")
        self.assertEqual(m, "weak")

        # 5
        m = self.jt.get_magnitude_of_effect_from_species("Mn2+", "high", "oct")
        self.assertEqual(m, "none")
        m = self.jt.get_magnitude_of_effect_from_species("Mn2+", "low", "oct")
        self.assertEqual(m, "weak")
        m = self.jt.get_magnitude_of_effect_from_species("Fe3+", "high", "oct")
        self.assertEqual(m, "none")
        m = self.jt.get_magnitude_of_effect_from_species("Fe3+", "low", "oct")
        self.assertEqual(m, "weak")

        # 6
        m = self.jt.get_magnitude_of_effect_from_species("Fe2+", "high", "oct")
        self.assertEqual(m, "weak")
        m = self.jt.get_magnitude_of_effect_from_species("Fe2+", "low", "oct")
        self.assertEqual(m, "none")
        m = self.jt.get_magnitude_of_effect_from_species("Co3+", "high", "oct")
        self.assertEqual(m, "weak")
        m = self.jt.get_magnitude_of_effect_from_species("Co3+", "low", "oct")
        self.assertEqual(m, "none")

        # 7
        m = self.jt.get_magnitude_of_effect_from_species("Co2+", "high", "oct")
        self.assertEqual(m, "weak")
        m = self.jt.get_magnitude_of_effect_from_species("Co2+", "low", "oct")
        self.assertEqual(m, "strong")

        # 8
        m = self.jt.get_magnitude_of_effect_from_species("Ni2+", "", "oct")
        self.assertEqual(m, "none")

        # 9
        m = self.jt.get_magnitude_of_effect_from_species("Cu2+", "", "oct")
        self.assertEqual(m, "strong")

        # 10
        m = self.jt.get_magnitude_of_effect_from_species("Cu+", "", "oct")
        self.assertEqual(m, "none")
        m = self.jt.get_magnitude_of_effect_from_species("Zn2+", "", "oct")
        self.assertEqual(m, "none")

    def test_jahn_teller_structure_analysis(self):
        parser = CifParser(os.path.join(PymatgenTest.TEST_FILES_DIR, "LiFePO4.cif"))
        LiFePO4 = parser.get_structures()[0]

        parser = CifParser(os.path.join(PymatgenTest.TEST_FILES_DIR, "Fe3O4.cif"))
        Fe3O4 = parser.get_structures()[0]

        self.assertTrue(self.jt.is_jahn_teller_active(LiFePO4))
        self.assertTrue(self.jt.is_jahn_teller_active(Fe3O4))

        LiFePO4_analysis = {
            "active": True,
            "strength": "weak",
            "sites": [
                {
                    "ligand": "O2-",
                    "ligand_bond_length_spread": 0.2111,
                    "ligand_bond_lengths": {2.2951, 2.2215, 2.2383, 2.1382, 2.084, 2.0863},
                    "strength": "weak",
                    "motif": "oct",
                    "motif_order_parameter": 0.1441,
                    "site_indices": [4, 5, 6, 7],
                    "species": "Fe2+",
                    "spin_state": "unknown",
                }
            ],
        }
        jt_predicted = self.jt.get_analysis(LiFePO4)
        # order does not matter
        jt_predicted["sites"][0]["ligand_bond_lengths"] = set(jt_predicted["sites"][0]["ligand_bond_lengths"])
        self.assertDictEqual(LiFePO4_analysis, jt_predicted)

    def test_mu_so(self):
        SpeciesCo = Species(symbol="Co", oxidation_state=4)
        self.assertAlmostEqual(np.sqrt(3), JahnTellerAnalyzer.mu_so(SpeciesCo, "oct", "low"))
        self.assertAlmostEqual(np.sqrt(35), JahnTellerAnalyzer.mu_so(SpeciesCo, "oct", "high"))
        SpeciesNa = Species(symbol="Na", oxidation_state=1)
        self.assertEqual(None, JahnTellerAnalyzer.mu_so(SpeciesNa, "oct", "high"))

if __name__ == "__main__":
    unittest.main()


text:
echo "Installing tools"
# already installed are: autoconf automake libtool pkg-config
#brew install curl perl 1>/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install curl perl 1>/dev/null


text:
__author__ = 'wcong'
import sys
from twisted.internet import reactor
from ants.node import node
from ants import settings
from conf import settings as project_settings
import logging
import argparse

'''
what we do
start the node
let the node do what he need to do
'''

parser = argparse.ArgumentParser(description='ants -- scale crawler')
parser.add_argument('-tcp_port', help='transport port', type=int, dest='tcp_port')
parser.add_argument('-http_port', help='http port', type=int, dest='http_port')

class Bootstrap():
    def __init__(self, args):
        logging.info("do not panic,it is shipping")
        self.setting = settings.Settings()
        self.setting.setmodule(project_settings)
        if args:
            cmd_args = parser.parse_args(args)
            if cmd_args.tcp_port:
                self.setting.set('TRANSPORT_PORT', cmd_args.tcp_port)
            if cmd_args.http_port:
                self.setting.set('HTTP_PORT', cmd_args.http_port)

    # #
    # we init almost everything in node manager
    def start(self):
        node_manager = node.NodeManager(self.setting)
        node_manager.start()
        reactor.run()


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

traceur.define('syntax', function() {
  'use strict';

  var assert = traceur.assert;

  /**
   * A Token in a javascript file.
   * Immutable.
   * A plain old data structure. Should contain data members and simple
   * accessors only.
   * @param {traceur.syntax.TokenType} type
   * @param {traceur.util.SourceRange} location
   * @constructor
   */
  function Token(type, location) {
    this.type = type;
    this.location = location;
  }

  Token.prototype = {
    /** @return {traceur.util.SourcePosition} */
    getStart: function() {
      return this.location.start;
    },

    toString: function() {
      return this.type.toString();
    },

    /** @return {traceur.syntax.IdentifierToken} */
    asIdentifier: function() {
      assert(this instanceof traceur.syntax.IdentifierToken);
      return this;
    },

    /** @return {traceur.syntax.LiteralToken} */
    asLiteral: function() {
      assert(this instanceof traceur.syntax.LiteralToken);
      return this;
    }
  };

  // Export
  return {
    Token: Token
  };
});


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace System.Security.Permissions
{
    [System.FlagsAttribute]
    public enum EnvironmentPermissionAccess
    {
        AllAccess = 3,
        NoAccess = 0,
        Read = 1,
        Write = 2,
    }
}


text:
package org.protempa.graph;

import org.apache.commons.collections4.map.ReferenceMap;

import java.util.Map;

/**
 *
 * @author Andrew Post
 */
public class WeightFactory {

    /**
     * Special value representing positive infinity.
     */
    public static final Weight POS_INFINITY = new Weight(true);
    /**
     * Special value representing negative infinity.
     */
    public static final Weight NEG_INFINITY = new Weight(false);
    /**
     * Special value representing the smallest possible positive value.
     */
    public static final Weight POS_EPSILON = new Weight(1L);
    /**
     * Special value representing the smallest possible negative value.
     */
    public static final Weight NEG_EPSILON = new Weight(-1L);
    /**
     * Special value representing zero.
     */
    public static final Weight ZERO = new Weight(0L);

    private static final Map<Number, Weight> cache = new ReferenceMap<>();

    public Weight getInstance() {
        return getInstance(null);
    }

    public Weight getInstance(Number val) {
        Weight weight;
        synchronized (cache) {
            weight = cache.get(val);
            if (weight == null) {
                weight = new Weight(val);
                cache.put(val, weight);
            }
        }
        return weight;
    }
}


text:
/// <reference types="react" />
import * as React from "react";
import * as Tether from "tether";
import { AbstractComponent } from "../../common/abstractComponent";
import * as PosUtils from "../../common/position";
import { IProps } from "../../common/props";
import * as TetherUtils from "../../common/tetherUtils";
import { IOverlayableProps } from "../overlay/overlay";
export declare enum PopoverInteractionKind {
    CLICK = 0,
    CLICK_TARGET_ONLY = 1,
    HOVER = 2,
    HOVER_TARGET_ONLY = 3,
}
export interface IPopoverProps extends IOverlayableProps, IProps {
    /** HTML props for the backdrop element. Can be combined with `backdropClassName`. */
    backdropProps?: React.HTMLProps<HTMLDivElement>;
    /**
     * The content displayed inside the popover.
     * This can instead be provided as the second `children` element (first is `target`).
     */
    content?: string | JSX.Element;
    /**
     * Constraints for the underlying Tether instance.
     * If defined, this will overwrite `tetherOptions.constraints`.
     * See http://tether.io/#constraints.
     * @deprecated since v1.12.0; use `tetherOptions.constraints` instead.
     */
    constraints?: TetherUtils.ITetherConstraint[];
    /**
     * Initial opened state when uncontrolled.
     * @default false
     */
    defaultIsOpen?: boolean;
    /**
     * The amount of time in milliseconds the popover should remain open after the
     * user hovers off the trigger. The timer is canceled if the user mouses over the
     * target before it expires. This option only applies when `interactionKind` is `HOVER` or
     * `HOVER_TARGET_ONLY`.
     * @default 300
     */
    hoverCloseDelay?: number;
    /**
     * The amount of time in milliseconds the popover should wait before opening after the the
     * user hovers over the trigger. The timer is canceled if the user mouses away from the
     * target before it expires. This option only applies when `interactionKind` is `HOVER` or
     * `HOVER_TARGET_ONLY`.
     * @default 150
     */
    hoverOpenDelay?: number;
    /**
     * Whether a non-inline popover should automatically inherit the dark theme from its parent.
     * @default true
     */
    inheritDarkTheme?: boolean;
    /**
     * The kind of interaction that triggers the display of the popover.
     * @default PopoverInteractionKind.CLICK
     */
    interactionKind?: PopoverInteractionKind;
    /**
     * Prevents the popover from appearing when `true`.
     * @default false
     */
    isDisabled?: boolean;
    /**
     * Enables an invisible overlay beneath the popover that captures clicks and prevents
     * interaction with the rest of the document until the popover is closed.
     * This prop is only available when `interactionKind` is `PopoverInteractionKind.CLICK`.
     * When modal popovers are opened, they become focused.
     * @default false
     */
    isModal?: boolean;
    /**
     * Whether the popover is visible. Passing this prop puts the popover in
     * controlled mode, where the only way to change visibility is by updating this property.
     * @default undefined
     */
    isOpen?: boolean;
    /**
     * Callback invoked in controlled mode when the popover open state *would* change due to
     * user interaction based on the value of `interactionKind`.
     */
    onInteraction?: (nextOpenState: boolean) => void;
    /**
     * Whether the popover should open when its target is focused.
     * If `true`, target will render with `tabindex="0"` to make it focusable via keyboard navigation.
     * This prop is only available when `interactionKind` is `HOVER` or `HOVER_TARGET_ONLY`.
     * @default true
     */
    openOnTargetFocus?: boolean;
    /**
     * A space-delimited string of class names that are applied to the popover (but not the target).
     */
    popoverClassName?: string;
    /**
     * Callback invoked when the popover opens after it is added to the DOM.
     */
    popoverDidOpen?: () => void;
    /**
     * Callback invoked when a popover begins to close.
     */
    popoverWillClose?: () => void;
    /**
     * Callback invoked before the popover opens.
     */
    popoverWillOpen?: () => void;
    /**
     * Space-delimited string of class names applied to the
     * portal that holds the popover if `inline = false`.
     */
    portalClassName?: string;
    /**
     * The position (relative to the target) at which the popover should appear.
     * @default Blueprint.Common.Position.RIGHT
     */
    position?: PosUtils.Position;
    /**
     * The name of the HTML tag to use when rendering the popover target wrapper element (`.pt-popover-target`).
     * @default "span"
     */
    rootElementTag?: string;
    /**
     * The target element to which the popover content is attached.
     * This can instead be provided as the first `children` element.
     */
    target?: string | JSX.Element;
    /**
     * Options for the underlying Tether instance.
     * See http://tether.io/#options
     */
    tetherOptions?: Partial<Tether.ITetherOptions>;
    /**
     * Whether the arrow's offset should be computed such that it always points at the center
     * of the target. If false, arrow position is hardcoded via CSS, which expects a 30px target.
     * @default true
     */
    useSmartArrowPositioning?: boolean;
    /**
     * Whether the popover will flip to the opposite side of the target element if there is not
     * enough room in the viewport. This is equivalent to:
     * ```
     * const tetherOptions = {
     *     constraints: [{ attachment: "together", to: "scrollParent" }]
     * };
     * ```
     * @default false
     * @deprecated since v1.15.0; use `tetherOptions.constraints` directly.
     */
    useSmartPositioning?: boolean;
}
export interface IPopoverState {
    isOpen?: boolean;
    ignoreTargetDimensions?: boolean;
    targetHeight?: number;
    targetWidth?: number;
}
export declare class Popover extends AbstractComponent<IPopoverProps, IPopoverState> {
    static defaultProps: IPopoverProps;
    static displayName: string;
    /**
     * DOM element that contains the popover.
     * When `inline={false}`, this element will be portaled outside the usual DOM flow,
     * so this reference can be very useful for testing.
     */
    popoverElement: HTMLElement;
    /** DOM element that contains the target. */
    targetElement: HTMLElement;
    private hasDarkParent;
    private isContentMounting;
    private cancelOpenTimeout;
    private tether;
    private refHandlers;
    constructor(props?: IPopoverProps, context?: any);
    render(): React.DOMElement<React.HTMLProps<HTMLElement>, HTMLElement>;
    componentDidMount(): void;
    componentWillReceiveProps(nextProps: IPopoverProps): void;
    componentWillUpdate(_: IPopoverProps, nextState: IPopoverState): void;
    componentDidUpdate(): void;
    componentWillUnmount(): void;
    protected validateProps(props: IPopoverProps & {
        children?: React.ReactNode;
    }): void;
    private componentDOMChange();
    private renderPopover(content);
    private understandChildren();
    private getArrowPositionStyles();
    private getPopoverTransformOrigin();
    private handleContentMount;
    private handleTargetFocus;
    private handleTargetBlur;
    private handleMouseEnter;
    private handleMouseLeave;
    private handlePopoverClick;
    private handleOverlayClose;
    private handleTargetClick;
    private updateArrowPosition();
    private updateTether();
    private destroyTether();
    private setOpenStateByPropCallback(isOpen, e?, timeout?);
    private setOpenStateDirectly(isOpen);
    private isElementInPopover(element);
    private isHoverInteractionKind();
    private checkDOMForDarkTheme();
}
export declare const PopoverFactory: React.ComponentFactory<IPopoverProps, Popover>;


text:
module SearchObject
  module Plugin
    module WillPaginate
      include Paging

      def self.included(base)
        base.extend Paging::ClassMethods
      end

      private

      def apply_paging(scope)
        scope.paginate per_page: per_page, page: page.zero? ? nil : page
      end
    end
  end
end


text:
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2013-2014.
// Modifications copyright (c) 2013-2014, Oracle and/or its affiliates.

// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle

// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.

// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_GEOMETRY_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_GEOMETRY_HPP

#include <boost/geometry/geometries/segment.hpp>

#include <boost/geometry/algorithms/covered_by.hpp>

#include <boost/geometry/algorithms/detail/disjoint/linear_linear.hpp>

#include <boost/geometry/algorithms/dispatch/disjoint.hpp>

namespace boost { namespace geometry
{

#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace disjoint
{

template<typename Point, typename Geometry>
struct disjoint_point_linear
{
    static inline
    bool apply(Point const& pt, Geometry const& g)
    {
        return !geometry::covered_by(pt, g);
    }
};

template <typename Geometry1, typename Geometry2>
struct reverse_covered_by
{
    static inline
    bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2)
    {
        return !geometry::covered_by(geometry1, geometry2);
    }
};

}} // namespace detail::disjoint
#endif // DOXYGEN_NO_DETAIL

#ifndef DOXYGEN_NO_DISPATCH
namespace dispatch
{

template<typename Point, typename Linear, std::size_t DimensionCount>
struct disjoint<Point, Linear, DimensionCount, point_tag, linear_tag, false>
    : public detail::disjoint::disjoint_point_linear<Point, Linear>
{};

template <typename Point, typename Areal, std::size_t DimensionCount>
struct disjoint<Point, Areal, DimensionCount, point_tag, areal_tag, false>
    : detail::disjoint::reverse_covered_by<Point, Areal>
{};

template<typename Point, typename Segment, std::size_t DimensionCount>
struct disjoint<Point, Segment, DimensionCount, point_tag, segment_tag, false>
{
    static inline bool apply(Point const& point, Segment const& segment)
    {
        typedef geometry::model::referring_segment<Point const> other_segment;

        other_segment other(point, point);
        return detail::disjoint::disjoint_segment
            <
                Segment, other_segment
            >::apply(segment, other);
    }
};

} // namespace dispatch
#endif // DOXYGEN_NO_DISPATCH

}} // namespace boost::geometry

#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_GEOMETRY_HPP


text:
ActiveRecord::Schema.define(version: 20161026184312) do
  create_table "confirmations", force: :cascade do |t|
    t.integer "hypothesis_id"
    t.bigint  "root"
    t.index ["hypothesis_id"], name: "index_confirmations_on_hypothesis_id"
  end

  create_table "hypotheses", force: :cascade do |t|
    t.string  "value",       limit: 40
    t.integer "terms_count"
    t.string  "factor",      limit: 40
    t.integer "parent_id"
    t.index ["parent_id"], name: "index_hypotheses_on_parent_id"
    t.index ["terms_count"], name: "index_hypotheses_on_terms_count"
  end

  create_table "refutations", force: :cascade do |t|
    t.integer "hypothesis_id"
    t.integer "reason"
    t.bigint  "parameter"
    t.index ["hypothesis_id"], name: "index_refutations_on_hypothesis_id"
  end
end


text:
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.Network.Models
{
    public partial class P2SVpnConnectionRequest : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            if (VpnConnectionIds != null)
            {
                writer.WritePropertyName("vpnConnectionIds");
                writer.WriteStartArray();
                foreach (var item in VpnConnectionIds)
                {
                    writer.WriteStringValue(item);
                }
                writer.WriteEndArray();
            }
            writer.WriteEndObject();
        }
    }
}


text:
from record import RecordTypes, to_string

class Omschrijving:

    """Represents a one to four description records."""

    def __init__(self, lines, default=False):
        """Construct a Description.

        lines   -- the description lines, list of max 4 strings max 32 chars
        default -- whether this is a default description for a batch

        """

        if len(lines) > 4:
            raise ValueError("Descriptions can't contain more than 4 strings.")

        for line in lines:
            if len(line) > 32:
                raise ValueError("Description lines are max 32 characters.")

        self.lines   = lines
        self.default = default

    def write_to_file(self, f):
        if self.default:
            rectype = RecordTypes.VASTEOMSCHRIJVING
        else:
            rectype = RecordTypes.OMSCHRIJVING

        for line in self.lines:
            f.write(to_string(rectype, omschrijving=line) + '\n')


text:
**Algorithm Complexity:**  You need to know basic **Big-O** and be able to analyze common algorithms.

research:
- [is Big-O for you](https://www.youtube.com/watch?v=-Yv2qljLrns)
- [Big-O (java)](https://www.youtube.com/watch?v=V6mKVRU1evU)
- [Intro to Algorithms](https://www.teaching-materials.org/algorithms/#/1)
- [Time Complexity](https://www.teaching-materials.org/algorithms/#/25)
- [Space Complexity](https://www.teaching-materials.org/algorithms/#/50)

ans:
- ![Big O Cheatsheet](data_structures_and_algorithms/big-o-cheatsheet.pdf)
- ![time complexity](data_structures_and_algorithms/big-o-time_complicity.png)

```html
    Big O is a measure of complexity:
    How do you know if the algo is good?
    - Time Complexity: How long does the algorithm take?
    - Space Complexity: How much space does the algorithm use?
```

**Sorting:**  You should know the details of at least one n*log(n) sorting algorithm (merge sort).

research:

- [Array Sorting Algorithms](http://bigocheatsheet.com/)
- [Comparison of algorithms](https://en.wikipedia.org/wiki/Sorting_algorithm#Comparison_of_algorithms)
- [visualizer](https://visualgo.net/en/sorting)

ans:
- [**Sorting Algorithms**](http://www.sorting-algorithms.com/)
- [**Merge Sort**](data_structures_and_algorithms/07_merge_sort.rb) n*log(n)
- [**Bubble Sort**](data_structures_and_algorithms/05_bubble_sort.rb)
- [**Selection Sort**](data_structures_and_algorithms/06_selection_sort.rb)

**Linked List**

- [linked-List](data_structures_and_algorithms/10_data_struct_linked_list.rb)
- [Linked-list lab](data_structures_and_algorithms/linked_lists)

**Graphs:**  There are 3 basic ways to represent a graph in memory...

1. Nodes as objects and edges as pointers
2. A matrix containing all edge weights between numbered node x and node y
3. An adjacency list of edges between numbered nodes

familiarize yourself with each representation and its pros & cons.

[From stackOverflow:](https://stackoverflow.com/questions/3287003/three-ways-to-store-a-graph-in-memory-advantages-and-disadvantages)

One way to analyze these is in terms of memory and time complexity (which depends on how you want to access the graph).

Storing nodes as objects with pointers to one another

The memory complexity for this approach is O(n) because you have as many objects as you have nodes. The number of pointers (to nodes) required is up to O(n^2) as each node object may contain pointers for up to n nodes.
The time complexity for this data structure is O(n) for accessing any given node.
Storing a matrix of edge weights

This would be a memory complexity of O(n^2) for the matrix.
The advantage with this data structure is that the time complexity to access any given node is O(1).
Depending on what algorithm you run on the graph and how many nodes there are, you'll have to choose a suitable representation.

- [Objects and pointers]()

	pros:

	cons:

- [Adjacency Matrix and Adjacency List](http://www.geeksforgeeks.org/graph-and-its-representations/)

Adjacency List = An array of linked lists

  pros: Saves space O(|V|+|E|) . In the worst case, there can be C(V, 2) number of edges in a graph thus consuming O(V^2) space.
  Adding a vertex is easier.

  cons: Queries like whether there is an edge from vertex u to vertex v are not efficient and can be done O(V).

You should know the basic graph traversal algorithms: breadth-first search and depth-first search.
Know their computational complexity, their trade-offs, and how to implement them in real code.

note: to solve, you need to understand:

- [recursion](data_structures_and_algorithms/recursion)
- [stack](data_structures_and_algorithms/09_data_struct_stack.rb)
- [queue](data_structures_and_algorithms/08_data_struct_queue.rb)
- [hash-table](data_structures_and_algorithms/11_data_struct_hash_table.rb)
- [linked-List](data_structures_and_algorithms/10_data_struct_linked_list.rb)

research:

- [**video 1**](https://www.youtube.com/watch?v=bIA8HEEUxZI&t=104s&list=PLz95RAb2ze2cornW3VaXSbzVtowrLHZLt&index=4)
- [**HackerRank video**](https://www.youtube.com/watch?v=zaBhtODEL0w)
- [**Discussion-ruby**](https://www.sitepoint.com/graph-algorithms-ruby/)
- [**Write-Up**](http://billleidy.com/blog/advent-of-code-and-graph-data-structure.html)
- [**RGL Gem**](https://www.blackbytes.info/2017/05/graph-theory-in-ruby/)

ans:

- [**Graphs**](data_structures_and_algorithms/graphs.rb)

implement: create Binary tree creation class then use DFS and BFS as methods on it.

note:
DFS recursive, simple but takes longer, need is-visited-flag
BFS better at finding shortest path

**Trees:**  NOTE: Trees are specialized versions of Graphs.
Know about trees; basic tree construction, traversal and manipulation algorithms.
Familiarize yourself with binary trees, n-ary trees, and trie-trees.

- [binary trees](data_structures_and_algorithms/binary_tree)
- [trie-trees](https://www.youtube.com/watch?v=zIjfhVPRZCg)
- [n-ary trees](https://www.youtube.com/watch?v=jGElHK0jZAQ)

Be familiar with at least one type of [balanced binary tree](https://www.google.com/search?q=balanced+binary+tree&rlz=1C5CHFA_enUS731US731&oq=balanced+binary+tree&aqs=chrome..69i57j0l5.950j0j4&sourceid=chrome&ie=UTF-8).
Understand tree traversal algorithms: BFS and DFS, and know the difference between **inorder, postorder and preorder**.

- [in-order](after hackerrank)
- [post-order](after HackerRank)
- [pre-order](after HackerRank)

**Other Data Structures and Algorithms:**  Know how to write a hash table. Know basic sampling techniques and binary search.

ans:

- [**Binary search recursive**](data_structures_and_algorithms/04_binary_search_recursive.rb)
- [**Binary search iterative**](data_structures_and_algorithms/02_binary_search.rb)
- [**Hash Table video**](https://www.youtube.com/watch?v=h2d9b_nEzoA)
- [**Hash Table example**](https://gist.github.com/arjans/db79d5ba3b644fd41b197a882b2b5ee1)

**Optimizations** Be prepared to discuss different ways to optimize your Algorithm. Making an Algorithm take less time or space.

ans:
- Experiment with different sort types

**Mathematics:**  Basic knowledge of counting problems, probability problems, and other Discrete Math 101 situations.
Spend some time before the interview refreshing your memory on (or teaching yourself) the essentials of combinatorics
and probability. You should be familiar with n-choose-k problems and their ilk.

ans:
 - [**n-choose-k**](data_structures_and_algorithms/12_n-choose-k.rb)

### RESOURCES:

 - [Book: Programing Problems in Ruby interview](https://www.amazon.com/Programming-Problems-Ruby-Bradley-Green-ebook/dp/B00EPQ4R6S/ref=pd_sim_351_1?_encoding=UTF8&psc=1&refRID=1H4PE8E07VK9NG1DGW3M)
 - [codewars](https://www.codewars.com/?language=ruby)
 - [Intro to Algorithms](https://www.teaching-materials.org/algorithms/#/1)
 - [Khan Academy](https://www.khanacademy.org/computing/computer-science/algorithms)

### [Abstract Data Structures Overview:](https://www.teaching-materials.org/algorithms/#/16)

 ![Data Structure Overview](data_structures_and_algorithms/abstract_data_structures.png)

 - Linked-list
 - Graph
 - Tree
 - queue


text:
local M = {}

function M:init()

end

function M:start()
	pprint("test exit contract start")
	local a = 1 > 'a'
	exit('hello')
	local thinkyoung = require 'thinkyoung'
	thinkyoung.error("error")
	pprint("after exit")
end

pprint("test exit contract loaded")

return M


text:
/**
 * General purpose utility classes for providing OAuth1.0 and OAuth2.0 credentials.
 */
package com.here.account.auth;


text:
API Cookbook
============

This page provides some examples, tutorials as notebooks to help you use the API of ``PBxplore``.

Basically, PBxplore is structured around 3 modules:

PBxplore.structure
------------------

This module handles the reading of PDB files and trajectory files.
Its 2 major functions `chain_from_files()` and `chain_from_trajectory` are direclty exposed
at the package level.

Look at the notebook  :doc:`PB assignation <./notebooks/Assignement>` for further information.

.. note:: `chain_from_trajectory()` requires the installation of python library `MDAnalysis <http://www.mdanalysis.org/>`_

PBxplore.io
-----------

This module is about the I/O of all files other than PDB.
It handles the reading/writing of fasta files and the writing of
flat analysis files (phi/psi files, Neq files).

Look at the notebook  :doc:`Writing PB in file <./notebooks/Assignement>` for further information.

PBxplore.analysis
-----------------

This module handle all analysis functions, ploting functions and clustering one available with the package.
You can:

* generate map of the distribution of PBs along protein sequence with `plot_map()`.
* compute :ref:`Neq` with `compute_neq()` and generate the plot with `plot_neq()`.
* generate WebLogo-like representation of PBs frequency along protein sequence with `generate_weblogo()`.
* cluster conformations of a same protein based on PB similarities.

Look at the notebook :doc:`Visualize protein deformability <./notebooks/Deformability>`
for further information.

.. note:: Plotting functions require `Matplotlib <http://matplotlib.org/>`_.

.. note:: `generate_weblogo()` requires `Weblogo3 <http://weblogo.threeplusone.com/>`_.

.. toctree::
   :maxdepth: 1

   ./notebooks/Assignement
   ./notebooks/WritePB
   ./notebooks/Deformability


text:
package org.apache.openaz.xacml.pdp.policy;

import org.apache.openaz.xacml.api.StatusCode;
import org.apache.openaz.xacml.pdp.eval.EvaluationContext;
import org.apache.openaz.xacml.pdp.eval.EvaluationException;

/**
 * Expression extends {@link org.apache.openaz.xacml.pdp.policy.PolicyComponent} to represent a XACML
 * ExpressionType element.
 */
public abstract class Expression extends PolicyComponent {

    public Expression(StatusCode statusCodeIn, String statusMessageIn) {
        super(statusCodeIn, statusMessageIn);
    }

    public Expression(StatusCode statusCodeIn) {
        super(statusCodeIn);
    }

    public Expression() {
    }

    /**
     * Evaluates this Expression in the given
     * {@link org.apache.openaz.xacml.pdp.eval.EvaluationContext}.
     *
     * @param evaluationContext the EvaluationContext in which to evaluate this
     *            Expression
     * @param policyDefaults the {@link org.apache.openaz.xacml.pdp.policy.PolicyDefaults} to use in evaluating
     *            this Expression
     * @return a {@link org.apache.openaz.xacml.pdp.policy.ExpressionResult}
     */
    public abstract ExpressionResult evaluate(EvaluationContext evaluationContext,
                                              PolicyDefaults policyDefaults) throws EvaluationException;
}


text:
var __extends = this.__extends || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};
function areThe(items, actual1, actual2) {
    return (items[0] == actual1 || items[0] == actual2) && (items[1] == actual1 || items[1] == actual2);
}
var MovableItem = (function () {
    function MovableItem(xPos, yPos, xAccel, yAccel, width, height, name, type) {
        this.xPosition = xPos;
        this.yPosition = yPos;
        this.xAcceleration = xAccel;
        this.yAcceleration = yAccel;
        this.width = width;
        this.height = height;
        this.name = name;
        this.type = type;
    }
    MovableItem.prototype.tick = function () {
        this.xPosition += this.xAcceleration;
        this.yPosition += this.yAcceleration;
    };
    MovableItem.prototype.centerX = function () {
        return this.xPosition + (this.width / 2);
    };
    MovableItem.prototype.centerY = function () {
        return this.yPosition;
    };
    MovableItem.prototype.isNear = function (item) {
        return (Math.abs(this.centerX() - item.centerX()) < this.width && Math.abs(this.centerY() - item.centerY()) < this.height);
    };
    return MovableItem;
})();
var ShotNuke = (function (_super) {
    __extends(ShotNuke, _super);
    function ShotNuke(parent) {
        _super.call(this, parent.xPosition, parent.yPosition, parent.xAcceleration * 2, parent.yAcceleration * 2, 32, 32, "shotNuke", parent.type);
    }
    return ShotNuke;
})(MovableItem);
var Canada = (function (_super) {
    __extends(Canada, _super);
    function Canada(x, y) {
        _super.call(this, x, y, 1, 1, 32, 32, "canada", "canada");
    }
    return Canada;
})(MovableItem);
var Mexico = (function (_super) {
    __extends(Mexico, _super);
    function Mexico(x, y) {
        _super.call(this, x, y, 0, 0, 32, 32, "mexico", "mexico");
    }
    return Mexico;
})(MovableItem);
var Nuke = (function (_super) {
    __extends(Nuke, _super);
    function Nuke(x, y) {
        _super.call(this, x, y, 0, 0, 32, 32, "nuke", "nuke");
    }
    return Nuke;
})(MovableItem);
var America = (function (_super) {
    __extends(America, _super);
    function America(x, y) {
        _super.call(this, x, y, 10, 10, 32, 32, "america", "america");
        this.xPosition = randomBetween(0, window.innerWidth);
        this.yPosition = randomBetween(0, window.innerHeight);
    }
    America.prototype.tick = function () {
        this.xAcceleration = randomBetween(0, 5);
        this.yAcceleration = randomBetween(0, 5);
        this.xPosition += this.xAcceleration;
        this.yPosition += this.yAcceleration;
    };
    return America;
})(MovableItem);
var SmartBomb = (function (_super) {
    __extends(SmartBomb, _super);
    function SmartBomb(parent) {
        _super.call(this, parent.xPosition, parent.yPosition, parent.xAcceleration, 1, 32, 32, "smartbomb", "smartbomb");
        this.theParent = parent;
    }
    SmartBomb.prototype.tick = function () {
        this.xAcceleration = this.theParent.xAcceleration * 2;
        this.xPosition += this.xAcceleration;
        this.yPosition += this.yAcceleration;
    };
    return SmartBomb;
})(MovableItem);
var movableItems = new Array();
var labels = new Array();
function randomBetween(num1, num2) {
    return Math.floor((Math.random() * num2) + num1);
}
var GameObject = (function () {
    function GameObject(entity, picture) {
        this.picture = picture;
        this.entity = entity;
    }
    GameObject.prototype.update = function () {
        this.entity.tick();
        this.picture.style.left = this.entity.xPosition.toString() + "px";
        this.picture.style.top = this.entity.yPosition.toString() + "px";
    };
    return GameObject;
})();
var ControlledLabel = (function () {
    function ControlledLabel(label, textObject) {
        this.label = label;
        this.textObject = textObject;
    }
    ControlledLabel.prototype.update = function () {
        this.label.innerHTML = this.textObject.toString();
    };
    return ControlledLabel;
})();
var GameController = (function () {
    function GameController(mexicoResource, canadaResource, americaResource, nukeResource) {
        /* Game State Controls */
        this.activeNuke = null;
        this.points = 0;
        this.mexicoResource = mexicoResource;
        this.canadaResource = canadaResource;
        this.americaResource = americaResource;
        this.nukeResource = nukeResource;
        this.streaks = new Array();
    }
    GameController.prototype.wrap = function (item) {
        var type = item.name;
        var image = document.createElement("img");
        image.style.position = "absolute";
        image.height = 32;
        image.width = 32;
        if (type == "mexico") {
            image.src = this.mexicoResource;
        }
        else if (type == "canada") {
            image.src = this.canadaResource;
        }
        else if (type == "america") {
            image.src = this.americaResource;
        }
        else if (type == "nuke") {
            image.src = this.nukeResource;
        }
        else if (type == "shotNuke") {
            image.src = this.nukeResource;
        }
        else if (type == "smartbomb") {
            image.src = this.americaResource;
        }
        return new GameObject(item, image);
    };
    GameController.prototype.generateItem = function (xPos, yPos, type) {
        var mvIt;
        if (type == "mexico") {
            mvIt = new Mexico(xPos, yPos);
        }
        else if (type == "canada") {
            mvIt = new Canada(xPos, yPos);
        }
        else if (type == "america") {
            mvIt = new America(xPos, yPos);
        }
        else if (type == "nuke") {
            mvIt = new Nuke(xPos, yPos);
        }
        else if (type == "shotNuke") {
            mvIt = new ShotNuke(this.getGameObjectByName("canada").entity);
        }
        else if (type == "smartbomb") {
            mvIt = new SmartBomb(this.getGameObjectByName("canada").entity);
        }
        var wrapped = this.wrap(mvIt);
        movableItems.push(wrapped);
        document.getElementById("body").appendChild(wrapped.picture);
        return wrapped;
    };
    GameController.prototype.plotRandom = function (type) {
        this.generateItem(randomBetween(10, window.innerWidth), randomBetween(10, window.innerHeight), type);
    };
    GameController.prototype.shootNuke = function () {
        this.generateItem(0, 0, "shotNuke");
    };
    GameController.prototype.shootSmartBomb = function () {
        this.generateItem(150, 150, "smartbomb");
    };
    GameController.prototype.shootNukeFromParent = function (parent) {
        var mvIt = new ShotNuke(parent);
        var image = document.createElement("img");
        image.style.position = "absolute";
        image.height = 32;
        image.width = 32;
        image.src = this.nukeResource;
        movableItems.push(new GameObject(mvIt, image));
    };
    GameController.prototype.getGameObjectByName = function (name) {
        for (var i = 0; i < movableItems.length; i = i + 1) {
            if (movableItems[i].entity.name == name) {
                return movableItems[i];
            }
        }
        return null;
    };
    GameController.prototype.updateAll = function () {
        document.getElementById("statusbar").innerText = this.points.toString() + " points.";
        Streaks.streakCheck();
        for (var i = 0; i < movableItems.length; i = i + 1) {
            movableItems[i].update();
        }
        for (var i = 0; i < movableItems.length; i++) {
            labels[i].update();
        }
    };
    GameController.prototype.collisionDetection = function () {
        var element, otherElement;
        for (var i = 0; i < movableItems.length; i = i + 1) {
            element = movableItems[i];
            for (var b = 0; b < movableItems.length; b++) {
                otherElement = movableItems[b];
                if (element.entity.isNear(otherElement.entity) && otherElement != element) {
                    this.collisionEvent(element, otherElement);
                }
            }
        }
    };
    GameController.prototype.collisionEvent = function (item1, item2) {
        if (item1.entity.name == "canada" && item2.entity.name == "nuke") {
            CollisionEvents.canadaNukeCollision(item1, item2);
        }
        else if (item1.entity.name == "canada" && item2.entity.name == "mexico") {
            CollisionEvents.canadaMexicoCollision(item1, item2);
        }
        else if (item1.entity.name == "shotNuke" && item2.entity.name == "mexico") {
            CollisionEvents.shotNukeMexicoCollision(item1, item2);
        }
        else if (item1.entity.name == "shotNuke" && item2.entity.name == "nuke") {
            CollisionEvents.shotNukeNuke(item1, item2);
        }
        else if (item1.entity.name == "mexico" && item2.entity.name == "mexico") {
            CollisionEvents.mexicoMexico(item1, item2);
        }
        else if (item1.entity.name == "smartbomb" && item2.entity.name == "mexico") {
            CollisionEvents.smartbombMexico(item1, item2);
        }
        else if (item1.entity.name == "smartbomb" && item2.entity.name == "nuke") {
            CollisionEvents.smartbombNuke(item1, item2);
        }
        else if (item1.entity.name == "america" && item2.entity.name != "canada") {
            CollisionEvents.americaImpact(item1, item2);
        }
    };
    GameController.prototype.clean = function () {
        var theNukes = movableItems.filter(function (x) { return x.entity.name == "nuke"; });
        if (theNukes.length > 25) {
            for (var i = 0; i < theNukes.length; i++) {
                CollisionEvents.removeElement(theNukes[i]);
            }
        }
        controller.plotRandom("nuke");
        for (var i = 0; i < movableItems.length; i++) {
            if (movableItems[i].entity.xPosition > window.innerWidth || movableItems[i].entity.yPosition > window.innerHeight || movableItems[i].entity.yPosition < 0) {
                if (movableItems[i].entity.name == "canada") {
                    alert("You have lost with " + controller.points + " points");
                    location.reload();
                }
                CollisionEvents.removeElement(movableItems[i]);
            }
        }
    };
    GameController.prototype.handleInput = function (input) {
        var canadaElement = this.getGameObjectByName("canada");
        var xFactor = 0;
        if (input == "W" || input == "w") {
            canadaElement.entity.yAcceleration -= 3 + xFactor;
        }
        else if (input == "A" || input == "a") {
            canadaElement.entity.xAcceleration -= 3 + xFactor;
        }
        else if (input == "S" || input == "s") {
            canadaElement.entity.yAcceleration += 3 + xFactor;
        }
        else if (input == "D" || input == "d") {
            canadaElement.entity.xAcceleration += 3 + xFactor;
        }
        else if (input == "P" || input == "p") {
            this.shootSmartBomb();
        }
    };
    GameController.prototype.start = function () {
        var _this = this;
        var timer = setInterval(function () {
            _this.collisionDetection();
            _this.updateAll();
        }, 10);
        var otherTimer = setInterval(function () {
            _this.clean();
        }, 5000);
    };
    return GameController;
})();
var CollisionEvents = (function () {
    function CollisionEvents() {
    }
    CollisionEvents.removeElement = function (item) {
        document.getElementById("body").removeChild(item.picture);
        movableItems.splice(movableItems.indexOf(item), 1);
    };
    CollisionEvents.canadaNukeCollision = function (canada, nuke) {
        controller.points++;
        controller.plotRandom("nuke");
        controller.plotRandom("mexico");
        CollisionEvents.removeElement(nuke);
    };
    CollisionEvents.canadaMexicoCollision = function (canada, nuke) {
        alert("Game Over. Score: " + controller.points);
        location.reload();
    };
    CollisionEvents.shotNukeMexicoCollision = function (shotNuke, mexico) {
        controller.points += 2;
        controller.plotRandom("nuke");
        mexico.entity.xAcceleration = randomBetween(-10, 10);
        mexico.entity.yAcceleration = randomBetween(-10, 10);
    };
    CollisionEvents.americaImpact = function (item1, item2) {
        controller.points++;
        CollisionEvents.removeElement(item1);
        CollisionEvents.removeElement(item2);
    };
    CollisionEvents.shotNukeNuke = function (shotNuke, nuke) {
        controller.points++;
        controller.plotRandom("nuke");
        CollisionEvents.removeElement(shotNuke);
        for (var i = 0; i < 10; i++) {
            controller.plotRandom("nuke");
        }
        var theNukes = movableItems.filter(function (x) { return x.entity.name == "nuke"; });
        for (var i = 0; i < theNukes.length; i++) {
            theNukes[i].entity.xAcceleration = randomBetween(-10, 10);
            theNukes[i].entity.yAcceleration = randomBetween(-10, 10);
        }
        controller.plotRandom("nuke");
    };
    CollisionEvents.mexicoMexico = function (mexico1, mexico2) {
        CollisionEvents.shotNukeMexicoCollision(mexico1, mexico2);
    };
    CollisionEvents.smartbombNuke = function (smartbomb, nuke) {
        controller.plotRandom("nuke");
        controller.plotRandom("nuke");
        CollisionEvents.removeElement(nuke);
        smartbomb.entity.yAcceleration = -5;
    };
    CollisionEvents.smartbombMexico = function (smartbomb, mexico) {
        controller.generateItem(mexico.entity.xPosition, mexico.entity.yPosition, "nuke");
        CollisionEvents.removeElement(mexico);
    };
    return CollisionEvents;
})();
var Streaks = (function () {
    function Streaks() {
    }
    Streaks.streakCheck = function () {
        if (controller.points > 0 && controller.lastStreak != controller.points) {
            controller.lastStreak = controller.points;
            if (controller.points % 2 == 0) {
                this.streak("shotNuke");
            }
            if (controller.points % 10 == 0) {
                this.streak("america");
            }
            if (controller.points % 25 == 0) {
                this.streak("smartbomb");
            }
        }
    };
    Streaks.streak = function (streakName) {
        var canadaElement = controller.getGameObjectByName("canada");
        if (streakName == "shotNuke") {
            controller.shootNuke();
        }
        else if (streakName == "smartBomb") {
            controller.shootSmartBomb();
        }
        else if (streakName == "america") {
            for (var i = 0; i < 15; i++) {
                controller.generateItem(150, 150, "america");
            }
        }
    };
    return Streaks;
})();
/* *** Actual Game Setup (with webpage)*** */
var controller;
// Sets up the Controller and runs it
function setup() {
    controller = new GameController("Content/mexico.png", "Content/canada.png", "Content/america.png", "Content/nuke.png");
    controller.generateItem(250, 250, "canada");
    controller.generateItem(150, 150, "nuke");
    // Pass key events to "handle"
    document.onkeypress = function (evt) {
        controller.handleInput(evt.key);
    };
    var statusbar = document.createElement("h1");
    document.getElementById("body").appendChild(statusbar);
    labels.push(new ControlledLabel(statusbar, controller.getGameObjectByName("canada").entity.yAcceleration));
    controller.start();
}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>create_new_salt (User)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />

# File app/models/user.rb, line 147
  def create_new_salt
    return self.salt = self.object_id.to_s + rand.to_s
  end


text:
import logging

from django.contrib.auth.models import Group, Permission
from django.core.management.base import BaseCommand
from django.db.models import Q

class Command(BaseCommand):
    """
    """
    help = (
        "Add an auth.Group that gives basic CMS Permissions. User --plugin or --cms to add additional perms."
        "")

    def add_arguments(self, parser):
        parser.add_argument(
            '--cms-base',
            required=False,
            action='store_const',
            const=True,
            default=False,
            help="Basic CMS permissions (edit and publish pages, etc).")
        parser.add_argument(
            '--cms-publish',
            required=False,
            action='store_const',
            const=True,
            default=False,
            help="adds exactly 'can publish page' permission).",
        )
        parser.add_argument(
            '--cms-superuser',
            required=False,
            action='store_const',
            const=True,
            default=False,
            help="Superuser CMS permissions (add own users, page permissions, etc, etc).",
        )
        parser.add_argument(
            '--plugin',
            required=False,
            action='store_const',
            const=True,
            default=False,
            help="""
Searches for permissions with 'plugin' in their content type's app_label (ex.: cmsplugin_googlemaps), adds to group.""")
        parser.add_argument(
            '--cms',
            action='store_const',
            const=True,
            default=False,
            required=False,
            help="""
Searches for permissions with 'cms' in their content type's app_label (ex.:djangocms_text_ckeditor), adds to group.""")
        parser.add_argument(
            '--name',
            required=False,
            default='cms_base',
            help="""
Name of group. Defaults to cms_base.""")
        parser.add_argument(
            '--force',
            action='store_const',
            const=True,
            required=False,
            help="""
Force overwrite of existing group and it's permissions.""")

    def handle(self, *args, **options):
        group_name = options.get('name')
        # copy
        groups = Group.objects.filter(name=group_name)
        if groups.count():
            if not options.get('force', None):
                exit("use --force to overwrite existing groups!")
            if groups.count() > 1:
                exit("more than one group with name that name ({}) found! exiting.".format(group_name))
            group = groups.first()
        else:
            group = Group.objects.create(name=group_name)

        group.permissions.clear()
        if options.get('cms_base'):
            q_filter = Q(content_type__app_label='cms')
            q_exclude = Q(name__icontains='user')
            q_exclude |= Q(name__icontains='permission')
            q_exclude |= Q(name__icontains='publish')
            self.add_permission(group, q_filter, q_exclude)
        if options.get('cms_publish'):
            q_filter = Q(content_type__app_label='cms')
            q_filter &= Q(name__icontains='publish')
            self.add_permission(group, q_filter)
        if options.get('cms_superuser'):
            q_filter = Q(content_type__app_label='cms')
            self.add_permission(group, q_filter)
        if options.get('cms'):
            q_filter = Q(content_type__app_label__icontains='cms')
            q_exclude = Q(content_type__app_label='cms')
            self.add_permission(group, q_filter, q_exclude)
        if options.get('plugin'):
            q_filter = Q(content_type__app_label__icontains='plugin')
            q_exclude = Q(content_type__app_label='cms')
            self.add_permission(group, q_filter, q_exclude)

        print(logging.INFO, 'Group created! ({})'.format(group_name))
        print(logging.INFO, 'Following permissions were granted:')
        for perm in group.permissions.all():
            print(logging.INFO, '{}'.format(perm))

    def add_permission(self, group, q_filter=Q(), q_exclude=Q()):
        perms = Permission.objects.filter(q_filter).exclude(q_exclude)
        group.permissions.add(*perms)


text:
/**
 * The type of redux action to set Audio Mode device list.
 *
 * {
 *     type: _SET_AUDIOMODE_DEVICES,
 *     devices: Array
 * }
 *
 * @protected
 */
export const _SET_AUDIOMODE_DEVICES = '_SET_AUDIOMODE_DEVICES';

/**
 * The type of redux action to set Audio Mode module's subscriptions.
 *
 * {
 *     type: _SET_AUDIOMODE_SUBSCRIPTIONS,
 *     subscriptions: Array|undefined
 * }
 *
 * @protected
 */
export const _SET_AUDIOMODE_SUBSCRIPTIONS = '_SET_AUDIOMODE_SUBSCRIPTIONS';


text:
#pragma once
#include <aws/workmail/WorkMail_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/workmail/model/FolderConfiguration.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace WorkMail
{
namespace Model
{
  class AWS_WORKMAIL_API GetDefaultRetentionPolicyResult
  {
  public:
    GetDefaultRetentionPolicyResult();
    GetDefaultRetentionPolicyResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    GetDefaultRetentionPolicyResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The retention policy ID.

     */
    inline const Aws::String& GetId() const{ return m_id; }

    /**
     *
The retention policy ID.

     */
    inline void SetId(const Aws::String& value) { m_id = value; }

    /**
     *
The retention policy ID.

     */
    inline void SetId(Aws::String&& value) { m_id = std::move(value); }

    /**
     *
The retention policy ID.

     */
    inline void SetId(const char* value) { m_id.assign(value); }

    /**
     *
The retention policy ID.

     */
    inline GetDefaultRetentionPolicyResult& WithId(const Aws::String& value) { SetId(value); return *this;}

    /**
     *
The retention policy ID.

     */
    inline GetDefaultRetentionPolicyResult& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}

    /**
     *
The retention policy ID.

     */
    inline GetDefaultRetentionPolicyResult& WithId(const char* value) { SetId(value); return *this;}

    /**
     *
The retention policy name.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
The retention policy name.

     */
    inline void SetName(const Aws::String& value) { m_name = value; }

    /**
     *
The retention policy name.

     */
    inline void SetName(Aws::String&& value) { m_name = std::move(value); }

    /**
     *
The retention policy name.

     */
    inline void SetName(const char* value) { m_name.assign(value); }

    /**
     *
The retention policy name.

     */
    inline GetDefaultRetentionPolicyResult& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
The retention policy name.

     */
    inline GetDefaultRetentionPolicyResult& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}

    /**
     *
The retention policy name.

     */
    inline GetDefaultRetentionPolicyResult& WithName(const char* value) { SetName(value); return *this;}

    /**
     *
The retention policy description.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
The retention policy description.

     */
    inline void SetDescription(const Aws::String& value) { m_description = value; }

    /**
     *
The retention policy description.

     */
    inline void SetDescription(Aws::String&& value) { m_description = std::move(value); }

    /**
     *
The retention policy description.

     */
    inline void SetDescription(const char* value) { m_description.assign(value); }

    /**
     *
The retention policy description.

     */
    inline GetDefaultRetentionPolicyResult& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
The retention policy description.

     */
    inline GetDefaultRetentionPolicyResult& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}

    /**
     *
The retention policy description.

     */
    inline GetDefaultRetentionPolicyResult& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
The retention policy folder configurations.

     */
    inline const Aws::Vector<FolderConfiguration>& GetFolderConfigurations() const{ return m_folderConfigurations; }

    /**
     *
The retention policy folder configurations.

     */
    inline void SetFolderConfigurations(const Aws::Vector<FolderConfiguration>& value) { m_folderConfigurations = value; }

    /**
     *
The retention policy folder configurations.

     */
    inline void SetFolderConfigurations(Aws::Vector<FolderConfiguration>&& value) { m_folderConfigurations = std::move(value); }

    /**
     *
The retention policy folder configurations.

     */
    inline GetDefaultRetentionPolicyResult& WithFolderConfigurations(const Aws::Vector<FolderConfiguration>& value) { SetFolderConfigurations(value); return *this;}

    /**
     *
The retention policy folder configurations.

     */
    inline GetDefaultRetentionPolicyResult& WithFolderConfigurations(Aws::Vector<FolderConfiguration>&& value) { SetFolderConfigurations(std::move(value)); return *this;}

    /**
     *
The retention policy folder configurations.

     */
    inline GetDefaultRetentionPolicyResult& AddFolderConfigurations(const FolderConfiguration& value) { m_folderConfigurations.push_back(value); return *this; }

    /**
     *
The retention policy folder configurations.

     */
    inline GetDefaultRetentionPolicyResult& AddFolderConfigurations(FolderConfiguration&& value) { m_folderConfigurations.push_back(std::move(value)); return *this; }

  private:

    Aws::String m_id;

    Aws::String m_name;

    Aws::String m_description;

    Aws::Vector<FolderConfiguration> m_folderConfigurations;
  };

} // namespace Model
} // namespace WorkMail
} // namespace Aws


text:
package com.orientechnologies.orient.core.index;

import java.util.Map;

import com.orientechnologies.orient.core.db.record.OIdentifiable;

/**
 * Dictionary index similar to unique index but does not check for updates, just executes changes. Last put always wins and override
 * the previous value.
 *
 * @author Luca Garulli
 *
 */
public class OIndexDictionary extends OIndexOneValue {

  public OIndexDictionary(String typeId, String algorithm, OIndexEngine<OIdentifiable> engine, String valueContainerAlgorithm) {
    super(typeId, algorithm, engine, valueContainerAlgorithm);
  }

  public OIndexOneValue put(Object key, final OIdentifiable value) {
    modificationLock.requestModificationLock();

    key = getCollatingValue(key);

    try {
      acquireExclusiveLock();
      try {
        checkForKeyType(key);
        indexEngine.put(key, value);
        return this;

      } finally {
        releaseExclusiveLock();
      }
    } finally {
      modificationLock.releaseModificationLock();
    }
  }

  @Override
  protected void putInSnapshot(Object key, OIdentifiable value, Map<Object, Object> snapshot) {
    key = getCollatingValue(key);
    snapshot.put(key, value.getIdentity());
  }

  @Override
  protected void removeFromSnapshot(Object key, OIdentifiable value, Map<Object, Object> snapshot) {
    key = getCollatingValue(key);
    snapshot.put(key, RemovedValue.INSTANCE);
  }

  @Override
  protected void commitSnapshot(Map<Object, Object> snapshot) {
    for (Map.Entry<Object, Object> snapshotEntry : snapshot.entrySet()) {
      Object key = snapshotEntry.getKey();
      checkForKeyType(key);

      Object snapshotValue = snapshotEntry.getValue();
      if (snapshotValue.equals(RemovedValue.INSTANCE))
        indexEngine.remove(key);
      else
        indexEngine.put(key, (OIdentifiable) snapshotValue);
    }
  }

  /**
   * Disables check of entries.
   */
  @Override
  public void checkEntry(final OIdentifiable iRecord, final Object key) {
  }

  public boolean canBeUsedInEqualityOperators() {
    return true;
  }

  public boolean supportsOrderedIterations() {
    return false;
  }
}


text:
<!--

    Licensed to Apereo under one or more contributor license
    agreements. See the NOTICE file distributed with this work
    for additional information regarding copyright ownership.
    Apereo licenses this file to you under the Apache License,
    Version 2.0 (the "License"); you may not use this file
    except in compliance with the License.  You may obtain a
    copy of the License at the following location:

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

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

-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <pluginGroups/>
  <servers>
    <server>
      <id>sonatype-nexus-snapshots</id>
      <username>${env.SONATYPE_USER}</username>
      <password>${env.SONATYPE_PWD}</password>
    </server>
  </servers>
  <mirrors/>
  <proxies/>
  <profiles/>
  <activeProfiles/>
</settings>


text:
'use strict'

// like a promise
// if a value is added, it is queued until the first then()
// if then() is called before a value is available,
//   the returned promise is deferred
//   and queued up for later resolution eg when the next value is available or the
//   Result is completed.

const CLOSED = Promise.resolve()

module.exports = class Result {
  constructor () {
    this._isClosed = false
    this._pendingPromises = []
    this._pendingVals = []

    // TODO Nice to have ...array argument -> add()
  }

  add (val) {
    if (this.isClosed) {
      throw new Error('cannot add() to a closed Result')
    }

    if (this._pendingPromises.length > 0) {
      this._finishPromises(val)
    } else {
      this._pendingVals.push(val)
    }
  }

  get isClosed () {
    return this._isClosed
  }

  get hasValues () {
    return this._pendingVals.length > 0
  }

  /**
   * Requests the next value, wrapped in a promise.
   * If no more values are available and the Result
   * is closed, a Promise resolved to undefined is returned.
   * Else, the returned promise will resolve or reject
   * when the next value is added.
   *
   * @param {Function} res
   * @param {Function} rej
   * @return {Promise}
   */
  then (res, rej) {
    if (this.hasValues) {
      const val = this._pendingVals.shift()
      const method = val instanceof Error ? 'reject' : 'resolve'
      return Promise[method](val).then(res, rej)
    }

    if (this.isClosed) {
      // no more values will ever be available
      return CLOSED.then(res, rej)
    }

    const p = new Promise((resolve, reject) => {
      this._pendingPromises.push({ resolve, reject })
    })

    return p.then(res, rej)
  }

  close (val) {
    this.add(val)
    this._isClosed = true
  }

  _finishPromises (val) {
    const method = val instanceof Error ? 'reject' : 'resolve'

    let promise
    while ((promise = this._pendingPromises.shift())) {
      promise[method](val)
    }
  }
}


text:
/**
 * Created by user on 5/7/14.
 */

$(function() {
    var refreshContent = function(url) {
        $.ajax({
            url: url
        }).done(function(data) {
            $('.content').replaceWith(data);
        });
    };

    $('body').on('submit', '#add_form', function(e) {
        e.preventDefault();

        $.ajax({
            type: 'POST',
            url: $(this).attr('action'),
            data: $(this).serialize()
        }).done(function() {
            refreshContent(window.location.href);
        });
    });

    // Edit
    $('body').on('click', 'a.edit', function(e) {
        e.preventDefault();

        $.ajax({
            url: $(this).attr('href')
        }).done(function(data) {
            $('.modal .modal-content').html(data);
            $('.modal').modal();
        });
    });

    $('.modal').on('submit', 'form[name=rra_testbundle_contact]', function(e) {
        e.preventDefault();

        $.ajax({
            type: 'PUT',
            url: $(this).attr('action'),
            data: $(this).serialize()
        }).done(function() {
            $.when(refreshContent(window.location.href)).then(function() {
                $('.modal').modal('hide');
            });
        });
    });
    // End Edit

    $('body').on('click', '.delete', function(e) {
        e.preventDefault();

        if(!confirm('Delete record?')) {
            return false;
        }

        $.ajax({
            type: 'DELETE',
            url: $(this).attr('href')
        }).done(function(data) {
            refreshContent(window.location.href);
        }).error(function() {
            alert('Delete error.');
        });
    });

    // Pagination, sorting
    $('body').on('click', '.table th a, .pagination a', function(e) {
        e.preventDefault();
        refreshContent($(this).attr('href'));
    });

    $(document).on('focusin', '.phoneNumber', function() {
        $('.phoneNumber').mask("+999 99 999-99-99");
    });

});


text:
package gov.sandia.cognition.statistics.method;

import gov.sandia.cognition.annotation.PublicationReference;
import gov.sandia.cognition.annotation.PublicationType;
import gov.sandia.cognition.statistics.distribution.BinomialDistribution;
import gov.sandia.cognition.util.AbstractCloneableSerializable;
import java.util.Collection;
import java.util.Iterator;

/**
 * This is an implementation of the Fisher Sign Test, which is a robust
 * nonparameteric test to determine if two groups have a different mean.
 * However, because the test has essentially no assumptions, it generates
 * very loose confidence bounds.
 * @author Kevin R. Dixon
 * @since  2.0
 *
 */
@ConfidenceTestAssumptions(
    name="Fisher Sign Test",
    alsoKnownAs="Sign Test",
    description={
        "Determines if there is a statistically significant between the means of two groups",
        "A robust nonparameteric alternative to the paired Student's t-test."
    },
    assumptions={
        "The data from each group is sampled independently of each other."
    },
    nullHypothesis="The means of the two groups is the same.",
    dataPaired=true,
    dataSameSize=true,
    distribution=BinomialDistribution.CDF.class,
    reference=@PublicationReference(
        author="Eric W. Weisstein",
        title="Fisher Sign Test",
        type=PublicationType.WebPage,
        year=2009,
        url="http://mathworld.wolfram.com/FisherSignTest.html"
    )
)
public class FisherSignConfidence
    extends AbstractCloneableSerializable
    implements NullHypothesisEvaluator<Collection<? extends Number>>
{

    /**
     * Default Constructor
     */
    public FisherSignConfidence()
    {
    }

    @Override
    public FisherSignConfidence.Statistic evaluateNullHypothesis(
        Collection<? extends Number> data1,
        Collection<? extends Number> data2)
    {

        if (data1.size() != data2.size())
        {
            throw new IllegalArgumentException(
                "data1 and data2 must have same number of elements.");
        }

        int N = 0;
        int b = 0;

        Iterator<? extends Number> i1 = data1.iterator();
        Iterator<? extends Number> i2 = data2.iterator();
        while (i1.hasNext())
        {
            double v1 = i1.next().doubleValue();
            double v2 = i2.next().doubleValue();

            // N tells us how many samples aren't equal
            if (v1 != v2)
            {
                N++;
            }

            // b tells me how many samples where data1 is bigger
            if (v1 > v2)
            {
                b++;
            }

        }

        return new FisherSignConfidence.Statistic(b, N);
    }

    /**
     * Contains the parameters from the Sign Test null-hypothesis evaluation
     */
    public static class Statistic
        extends AbstractConfidenceStatistic
    {

        /**
         * Number of samples where data1 was different than data2
         */
        private int numDifferent;

        /**
         * Number of sample where data1 was greater than data2
         */
        private int numPositiveSign;

        /**
         * Creates a new instance of Statistic
         *
         * @param numPositiveSign Number of samples where data1 was greater than data2
         * @param numDifferent Number of samples where data1 was different than data2
         */
        public Statistic(
            int numPositiveSign,
            int numDifferent)
        {
            // Insignificant chance is a binomial with p=0.5, so the pvalue of
            // Sign Test is the chance of seeing "b" times where data1 is bigger
            // out of N different samples, where chance is 0.5.  Thus, we have
            // cdf(b,N,0.5) as the chance of seeing more than chance
            super(2.0 * Math.min(
                BinomialDistribution.CDF.evaluate(numDifferent, numPositiveSign, 0.5),
                1.0 - BinomialDistribution.CDF.evaluate(numDifferent, numPositiveSign, 0.5)));

            if (numPositiveSign > numDifferent)
            {
                throw new IllegalArgumentException(
                    "numPositiveSign must be <= numDifferent");
            }
            this.setNumPositiveSign(numPositiveSign);
            this.setNumDifferent(numDifferent);
        }

        /**
         * Getter for numDifferent
         * @return
         * Number of samples where data1 was different than data2
         */
        public int getNumDifferent()
        {
            return this.numDifferent;
        }

        /**
         * Setter for numDifferent
         * @param numDifferent
         * Number of samples where data1 was different than data2
         */
        protected void setNumDifferent(
            int numDifferent)
        {
            this.numDifferent = numDifferent;
        }

        /**
         * Getter for numPositiveSign
         * @return
         * Number of sample where data1 was greater than data2
         */
        public int getNumPositiveSign()
        {
            return this.numPositiveSign;
        }

        /**
         * Setter for numPositiveSign
         * @param numPositiveSign
         * Number of sample where data1 was greater than data2
         */
        protected void setNumPositiveSign(
            int numPositiveSign)
        {
            this.numPositiveSign = numPositiveSign;
        }

        @Override
        public double getTestStatistic()
        {
            return this.numPositiveSign;
        }

    }

}


text:
<!DOCTYPE html>
<html lang="en" ng-app='FreeAgent'>
<head>
    <title>FreeAgent</title>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">

    <meta property="og:title" content="FreeAgent" />
    <meta property="og:type" content="website" />
    <meta property="og:site_name" content="FreeAgent" />
    <meta property="og:url" content="http://wine.BesslerAndBessler.com" />
    <meta property="og:description"
            content="" />
    <meta property="og:image" content="" />

    <link rel='stylesheet' href='/css/site.css' />
    <link rel='stylesheet' href='/css/team.css' />
    <link rel='stylesheet' href='/css/matches.css' />
    <link rel='stylesheet' href='/css/splash.css' />
    <link href='http://fonts.googleapis.com/css?family=Montserrat:400,300,300italic,400italic,500,500italic,700,700italic' rel='stylesheet' type='text/css'>

</head>
<body ng-controller='Main'>
    <div ng-view></div>

    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular-route.min.js"></script>

    <script src="Views/js/services/playerServices.js?v=1"></script>
    <script src="Views/js/apps.js?v=1"></script>
    <script src="Views/js/controllers.js?v=1"></script>
    <script src="Views/js/directives.js?v=1"></script>
    <script src="Views/js/filters.js?v=1"></script>

</body>
</html>