text:
var server = require('../lib/unhangout-server'),
    models = require('../lib/server-models'),
    expect = require('expect.js'),
    _ = require('underscore')._,
    request = require('superagent'),
    common = require('./common');

var sock;
var session;

describe("HTTP ADMIN USERS API", function() {
    beforeEach(common.standardSetup);
    afterEach(common.standardShutdown);

    function postUsers(user, body, callback) {
        request.post(common.URL + "/admin/users/")
            .set("x-mock-user", user)
            .send(body)
            .redirects(0)
            .end(callback);
    }

    it("allows GET from superusers", function(done) {
        request.get(common.URL + "/admin/users/")
            .set("x-mock-user", "superuser1")
            .redirects(0)
            .end(function(res) {
                expect(res.status).to.be(200);
                done();
            });
    });
    it("denies GET from non-superusers", function(done) {
        request.get(common.URL + "/admin/users/")
            .set("x-mock-user", "admin1")
            .redirects(0)
            .end(function(res) {
                expect(res.status).to.be(401);
                done();
            });
    });
    it("denies POST from non-superusers", function(done) {
        postUsers("admin1", {userId: 1, action: "set-superuser"}, function(res) {
            expect(res.status).to.be(403);
            done();
        });
    });

    it("rejects requests without `action` param", function(done) {
        postUsers("superuser1", {userId: 1, email: "fun@example.com"}, function(res) {
            expect(res.status).to.be(400);
            done();
        });
    });
    it("sets superuser status by id", function(done) {
        var user = common.server.db.users.findWhere({superuser: false});
        expect(user.get("superuser")).to.be(false);
        postUsers("superuser1", {
            userId: user.id,
            action: "set-superuser",
            superuser: true
        }, function(res) {
            expect(res.status).to.be(200);
            expect(common.server.db.users.get(user.id).get("superuser")).to.be(true);
            done()
        });
    });
    it("unsets superuser status by id", function(done) {
        var user = common.server.db.users.findWhere({superuser: true});
        expect(user.get("superuser")).to.be(true);
        postUsers("superuser1", {
            userId: user.id,
            action: "set-superuser",
            superuser: false
        }, function(res) {
            expect(res.status).to.be(200);
            expect(common.server.db.users.get(user.id).get("superuser")).to.be(false);
            done()
        });
    });
    it("sets superuser status by email", function(done) {
        var user = common.server.db.users.findByEmail("regular1@example.com");
        expect(user).to.not.be(undefined);
        expect(user.get("superuser")).to.be(false);
        postUsers("superuser1", {
            email: "regular1@example.com",
            action: "set-superuser",
            superuser: true
        }, function(res) {
            expect(res.status).to.be(200);
            expect(common.server.db.users.get(user.id).get("superuser")).to.be(true);
            done()
        });
    });
    it("unsets superuser status by email", function(done) {
        var user = common.server.db.users.findByEmail("superuser1@example.com");
        expect(user).to.not.be(undefined);
        expect(user.get("superuser")).to.be(true);
        postUsers("superuser1", {
            email: "superuser1@example.com",
            action: "set-superuser",
            superuser: false
        }, function(res) {
            expect(res.status).to.be(200);
            expect(common.server.db.users.get(user.id).get("superuser")).to.be(false);
            done()
        });
    });
    it("rejects request to grant superuser to unknown email", function(done) {
        var user = common.server.db.users.findByEmail("newone@example.com");
        expect(user).to.be(undefined);
        postUsers("superuser1", {
            email: "newone@example.com",
            action: "set-superuser",
            superuser: true
        }, function(res) {
            expect(res.status).to.be(400);
            expect(res.text).to.be("Unknown user");
            var newUser = common.server.db.users.findByEmail("newone@example.com");
            expect(newUser).to.be(undefined);
            done()
        });
    });

    it("adds event admins by id", function(done) {
        var user = common.server.db.users.findByEmail("regular1@example.com");
        var event = common.server.db.events.findWhere({shortName: "writers-at-work"});
        expect(user.isAdminOf(event)).to.be(false);
        postUsers("superuser1", {
            action: "add-event-admin",
            userId: user.id,
            eventId: event.id
        }, function(res) {
            expect(res.status).to.be(200);
            expect(user.isAdminOf(event)).to.be(true);
            expect(user.adminCache[event.id]).to.be(true);
            done();
        });
    });
    it("removes event admins by id", function(done) {
        var event = common.server.db.events.findWhere({shortName: "writers-at-work"});
        var user = common.server.db.users.findByEmail(event.get("admins")[0].email);
        event.set("admins", [{id: user.id}]);

        expect(user.isAdminOf(event)).to.be(true);
        postUsers("superuser1", {
            action: "remove-event-admin",
            userId: user.id,
            eventId: event.id
        }, function(res) {
            expect(res.status).to.be(200);
            expect(user.isAdminOf(event)).to.be(false);
            expect(user.adminCache[event.id]).to.be(undefined);
            expect(event.get("admins")).to.eql([]);
            done();
        });
    });
    it("adds event admins by known email", function(done) {
        var user = common.server.db.users.findByEmail("regular1@example.com");
        var event = common.server.db.events.findWhere({shortName: "writers-at-work"});
        expect(user.isAdminOf(event)).to.be(false);
        postUsers("superuser1", {
            action: "add-event-admin",
            email: user.get("emails")[0].value,
            eventId: event.id
        }, function(res) {
            expect(res.status).to.be(200);
            expect(user.isAdminOf(event)).to.be(true);
            expect(user.adminCache[event.id]).to.be(true);
            done();
        });
    });
    it("removes event admins by known email", function(done) {
        var event = common.server.db.events.findWhere({shortName: "writers-at-work"});
        var email = event.get("admins")[0].email;
        var user = common.server.db.users.findByEmail(email);

        expect(user.isAdminOf(event)).to.be(true);
        postUsers("superuser1", {
            action: "remove-event-admin",
            email: email,
            eventId: event.id
        }, function(res) {
            expect(res.status).to.be(200);
            expect(user.isAdminOf(event)).to.be(false);
            expect(user.adminCache[event.id]).to.be(undefined);
            expect(event.get("admins")).to.eql([]);
            done()
        });
    });
    it("adds event admins by unknown email", function(done) {
        var user = common.server.db.users.findByEmail("nonexistent@example.com");
        expect(user).to.be(undefined);
        var event = common.server.db.events.findWhere({shortName: "writers-at-work"});
        event.set("admins", []);
        postUsers("superuser1", {
            action: "add-event-admin",
            email: "nonexistent@example.com",
            eventId: event.id
        }, function(res) {
            expect(res.status).to.be(200);
            var user = new models.ServerUser({emails: [{value: "nonexistent@example.com"}]});
            expect(user.isAdminOf(event)).to.be(true)

            // No admin cache unless the user is added to our list of users.
            expect(user.adminCache[event.id]).to.be(undefined);
            common.server.db.users.add(user);
            expect(user.adminCache[event.id]).to.be(true);
            common.server.db.users.remove(user);

            done()
        });
    });
    it("removes event admins by unknown email", function(done) {
        var event = common.server.db.events.findWhere({shortName: "writers-at-work"});
        event.set("admins", [{email: "nonexistent@example.com"}]);
        expect(new models.ServerUser({emails: [{value: "nonexistent@example.com"}]}).isAdminOf(event)).to.be(true);

        postUsers("superuser1", {
            action: "remove-event-admin",
            email: "nonexistent@example.com",
            eventId: event.id
        }, function(res) {
            expect(res.status).to.be(200);
            var user = new models.ServerUser({emails: [{value: "nonexistent@example.com"}]})
            expect(event.get("admins")).to.eql([]);
            expect(user.isAdminOf(event)).to.be(false);

            // No cache -- never been populated...
            expect(user.adminCache[event.id]).to.be(undefined);
            common.server.db.users.add(user);
            // but even after population, isn't filled, cause we're no longer admin.
            expect(user.adminCache[event.id]).to.be(undefined);
            common.server.db.users.remove(user);

            done();
        });
    });
    it("removes event admins by email when they were added by id", function(done) {
        var event = common.server.db.events.findWhere({shortName: "writers-at-work"});
        var user = common.server.db.users.findWhere({superuser: false});
        event.set("admins", [{id: user.id}]);
        expect(user.isAdminOf(event)).to.be(true);
        // Make sure it has an email set...
        expect(!!user.get('emails')[0].value).to.be(true);

        postUsers("superuser1", {
            action: "remove-event-admin",
            email: user.get('emails')[0].value,
            eventId: event.id
        }, function(res) {
            expect(res.status).to.be(200);
            expect(user.isAdminOf(event)).to.be(false);
            expect(user.adminCache[event.id]).to.be(undefined);
            expect(event.get("admins")).to.eql([]);
            done();
        });
    });
    it("removes event admins by id when they were added by email", function(done) {
        var event = common.server.db.events.findWhere({shortName: "writers-at-work"});
        var user = common.server.db.users.findWhere({superuser: false});
        event.set("admins", [{email: user.get('emails')[0].value}]);
        expect(user.isAdminOf(event)).to.be(true);
        postUsers("superuser1", {
            action: "remove-event-admin",
            userId: user.id,
            eventId: event.id
        }, function(res) {
            expect(res.status).to.be(200);
            expect(user.isAdminOf(event)).to.be(false);
            expect(user.adminCache[event.id]).to.be(undefined);
            expect(event.get("admins")).to.eql([]);
            done();
        });
    });

    it("Perms: returns false for undefined perms", function() {
        var user = common.server.db.users.find(function(u) {
          return Object.keys(u.get("perms")).length === 0 && u.get("superuser") === false;
        });
        expect(user.get("perms")).to.eql({});
        expect(user.hasPerm("createEvents")).to.be(false);
    });

    it("Perms: rejects requests from non-superusers", function(done) {
        var user = common.server.db.users.findWhere({superuser: false});
        postUsers("admin1", {
            action: "set-perms",
            perms: JSON.stringify({createEvents: true})
        }, function(res) {
            expect(res.status).to.be(403);
            expect(res.text).to.be("Forbidden");
            expect(user.hasPerm("createEvents")).to.be(false);
            done();
        });

    });
    it("Perms: rejects unknown permissions", function(done) {
        var user = common.server.db.users.findWhere({superuser: false});
        expect(user.hasPerm("blah")).to.be(false);
        postUsers("superuser1", {
            action: "set-perms",
            userId: user.id,
            perms: JSON.stringify({blah: true})
        }, function(res) {
            expect(res.status).to.be(400);
            expect(res.text).to.be("Perms not recognized: blah");
            expect(user.hasPerm("blah")).to.be(false);
            done();
        });
    });
    it("Perms: rejects missing perms parameter", function(done) {
        var user = common.server.db.users.findWhere({superuser: false});
        expect(user.hasPerm("createEvents")).to.be(false);
        postUsers("superuser1", {
            action: "set-perms",
            userId: user.id,
        }, function(res) {
            expect(res.status).to.be(400);
            expect(res.text).to.be("Missing `perms` parameter.");
            expect(user.hasPerm("createEvents")).to.be(false);
            done();
        });
    });
    it("Perms: rejects bad JSON without crash", function(done) {
        var user = common.server.db.users.findWhere({superuser: false});
        expect(user.hasPerm("createEvents")).to.be(false);
        postUsers("superuser1", {
            action: "set-perms",
            userId: user.id,
            perms: "{createEvents: true"
        }, function(res) {
            expect(res.status).to.be(400);
            expect(res.text).to.be("Bad JSON for `perms` parameter.");
            expect(user.hasPerm("createEvents")).to.be(false);
            done();
        });
    });
    it("Perms: rejects unknown user", function(done) {
        var user = common.server.db.users.findWhere({superuser: false});
        expect(user.hasPerm("createEvents")).to.be(false);
        postUsers("superuser1", {
            action: "set-perms",
            userId: "nonexistent",
            perms: JSON.stringify({createEvents: true})
        }, function(res) {
            expect(res.status).to.be(400);
            expect(res.text).to.be("Unrecognized user");
            expect(user.hasPerm("createEvents")).to.be(false);
            done();
        });
    });
    it("Perms: sets `createEvents` with well-formed request", function(done) {
        var user = common.server.db.users.findWhere({superuser: false});
        expect(user.hasPerm("createEvents")).to.be(false);
        postUsers("superuser1", {
            action: "set-perms",
            userId: user.id,
            perms: JSON.stringify({createEvents: true})
        }, function(res) {
            expect(res.text).to.be("OK");
            expect(res.status).to.be(200);
            expect(user.hasPerm("createEvents")).to.be(true);
            done();
        });
    });
    it("Perms: unsets `createEvents` with well-formed request", function(done) {
        var user = common.server.db.users.findWhere({superuser: false});
        user.setPerm("createEvents", true);
        expect(user.hasPerm("createEvents")).to.be(true);
        postUsers("superuser1", {
            action: "set-perms",
            userId: user.id,
            perms: JSON.stringify({createEvents: false})
        }, function(res) {
            expect(res.text).to.be("OK");
            expect(res.status).to.be(200);
            expect(user.hasPerm("createEvents")).to.be(false);
            done();
        });
    });
});


text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GW2PAO.Data;
using GW2PAO.Data.UserData;
using GW2PAO.Modules.ZoneCompletion.ViewModels;
using GW2PAO.Utility;

namespace GW2PAO.Modules.ZoneCompletion.Interfaces
{
    /// <summary>
    /// Zone completion controller interface.
    /// Defines primary public functionality of the zone completion controller.
    /// </summary>
    public interface IZoneCompletionController
    {
        /// <summary>
        /// The collection of zone points in the current zone
        /// </summary>
        ObservableCollection<ZoneItemViewModel> ZoneItems { get; }

        /// <summary>
        /// The current character's name
        /// </summary>
        string CharacterName { get; }

        /// <summary>
        /// The current character's position
        /// </summary>
        API.Data.Entities.Point CharacterPosition { get; }

        /// <summary>
        /// The current player's camera direction
        /// </summary>
        API.Data.Entities.Point CameraDirection { get; }

        /// <summary>
        /// The active continent that the player is in
        /// </summary>
        API.Data.Entities.Continent ActiveContinent { get; }

        /// <summary>
        /// The active map that the player is in
        /// </summary>
        API.Data.Entities.Map ActiveMap { get; }

        /// <summary>
        /// The zone completion user data
        /// </summary>
        ZoneCompletionUserData UserData { get; }

        /// <summary>
        /// The interval by which to refresh zone information (in ms)
        /// </summary>
        int ZoneRefreshInterval { get; set; }

        /// <summary>
        /// The interval by which to refresh zone point locations (in ms)
        /// </summary>
        int LocationsRefreshInterval { get; set; }

        /// <summary>
        /// True if a valid map ID is available, else false
        /// </summary>
        bool ValidMapID { get; }

        /// <summary>
        /// The ID of the current map/zone
        /// </summary>
        int CurrentMapID { get; }

        /// <summary>
        /// Starts the controller
        /// </summary>
        void Start();

        /// <summary>
        /// Stops the controller
        /// </summary>
        void Stop();

        /// <summary>
        /// Forces a shutdown of the controller, including all running timers/threads
        /// </summary>
        void Shutdown();
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
using homeControl.ControllerService.Bindings;
using homeControl.Domain.Events;
using homeControl.Domain.Events.Sensors;
using JetBrains.Annotations;
using Serilog;

namespace homeControl.ControllerService.Sensors
{
    [UsedImplicitly]
    internal sealed class SensorEventsProcessor
    {
        private readonly IBindingController _bindingController;
        private readonly IEventReceiver _receiver;
        private readonly ILogger _log;

        public SensorEventsProcessor(IBindingController bindingController, IEventReceiver receiver,
            ILogger log)
        {
            Guard.DebugAssertArgumentNotNull(bindingController, nameof(bindingController));
            Guard.DebugAssertArgumentNotNull(log, nameof(log));
            Guard.DebugAssertArgumentNotNull(receiver, nameof(receiver));

            _bindingController = bindingController;
            _receiver = receiver;
            _log = log;
        }

        public Task Run(CancellationToken ct)
        {
            return _receiver
                .ReceiveEvents<AbstractSensorEvent>()
                .ForEachAsync(async e => await Handle(e), ct);
        }

        private async Task Handle(AbstractSensorEvent sensorEvent)
        {
            Guard.DebugAssertArgumentNotNull(sensorEvent, nameof(sensorEvent));

            if (sensorEvent is SensorActivatedEvent)
            {
                _log.Information("Sensor {SensorId} activated", sensorEvent.SensorId);
                await _bindingController.ProcessSensorActivation(sensorEvent.SensorId);
            }
            else if (sensorEvent is SensorDeactivatedEvent)
            {
                _log.Information("Sensor {SensorId} deactivated", sensorEvent.SensorId);
                await _bindingController.ProcessSensorDeactivation(sensorEvent.SensorId);
            }
            else if (sensorEvent is SensorValueEvent valueEvent)
            {
                _log.Information("Sensor {SensorId} value={value}", sensorEvent.SensorId, valueEvent.Value);
                await _bindingController.ProcessSensorValue(valueEvent.SensorId, valueEvent.Value);
            }
            else
            {
                throw new NotImplementedException();
            }
        }
    }
}


text:
#pragma once

#include "OverlappingPairCallback.h"

namespace BulletSharp
{
	ref class AlignedBroadphasePairArray;

	public ref class OverlapCallback abstract
	{
	internal:
		btOverlapCallback* _native;

		~OverlapCallback();
		!OverlapCallback();

	public:
		bool ProcessOverlap(BroadphasePair^ pair);

		property bool IsDisposed
		{
			virtual bool get();
		}
	};

	public ref class OverlapFilterCallback abstract
	{
	internal:
		btOverlapFilterCallback* _native;

		OverlapFilterCallback(btOverlapFilterCallback* native);

		~OverlapFilterCallback();
		!OverlapFilterCallback();

	protected:
		OverlapFilterCallback();

	public:
		virtual bool NeedBroadphaseCollision(BroadphaseProxy^ proxy0, BroadphaseProxy^ proxy1) abstract;

		property bool IsDisposed
		{
			virtual bool get();
		}
	};

	public ref class OverlappingPairCache abstract : OverlappingPairCallback
	{
	internal:
		OverlappingPairCache(btOverlappingPairCache* native, bool preventDelete);

	private:
		AlignedBroadphasePairArray^ _overlappingPairArray;
#ifndef DISABLE_INTERNAL
		OverlappingPairCallback^ _ghostPairCallback;
#endif

	public:
		void CleanOverlappingPair(BroadphasePair^ pair, Dispatcher^ dispatcher);
		void CleanProxyFromPairs(BroadphaseProxy^ proxy, Dispatcher^ dispatcher);
		BroadphasePair^ FindPair(BroadphaseProxy^ proxy0, BroadphaseProxy^ proxy1);
		void ProcessAllOverlappingPairs(array<OverlapCallback^>^ callback, Dispatcher^ dispatcher);
#ifndef DISABLE_INTERNAL
		void SetInternalGhostPairCallback(OverlappingPairCallback^ ghostPairCallback);
#endif
		void SetOverlapFilterCallback(OverlapFilterCallback^ callback);
		void SortOverlappingPairs(Dispatcher^ dispatcher);

		property bool HasDeferredRemoval
		{
			bool get();
		}

		property int NumOverlappingPairs
		{
			int get();
		}

		property AlignedBroadphasePairArray^ OverlappingPairArray
		{
			AlignedBroadphasePairArray^ get();
		}
		/*
		property BroadphasePair^ OverlappingPairArrayPtr
		{
			BroadphasePair^ get();
		}
		*/
	};

	public ref class HashedOverlappingPairCache : OverlappingPairCache
	{
	private:
		OverlapFilterCallback^ _overlapFilterCallback;

	internal:
		HashedOverlappingPairCache(btHashedOverlappingPairCache* native, bool preventDelete);

	public:
		HashedOverlappingPairCache();

		virtual BroadphasePair^ AddOverlappingPair(BroadphaseProxy^ proxy0, BroadphaseProxy^ proxy1) override;
		bool NeedsBroadphaseCollision(BroadphaseProxy^ proxy0, BroadphaseProxy^ proxy1);
		virtual IntPtr RemoveOverlappingPair(BroadphaseProxy^ proxy0, BroadphaseProxy^ proxy1,
			Dispatcher^ dispatcher) override;
		virtual void RemoveOverlappingPairsContainingProxy(BroadphaseProxy^ proxy0, Dispatcher^ dispatcher) override;

		property int Count
		{
			int get();
		}

		property OverlapFilterCallback^ OverlapFilterCallback
		{
			BulletSharp::OverlapFilterCallback^ get();
			void set(BulletSharp::OverlapFilterCallback^ value);
		}
	};

	public ref class SortedOverlappingPairCache : OverlappingPairCache
	{
	private:
		OverlapFilterCallback^ _overlapFilterCallback;

	public:
		SortedOverlappingPairCache();

		virtual BroadphasePair^ AddOverlappingPair(BroadphaseProxy^ proxy0, BroadphaseProxy^ proxy1) override;
		bool NeedsBroadphaseCollision(BroadphaseProxy^ proxy0, BroadphaseProxy^ proxy1);
		virtual IntPtr RemoveOverlappingPair(BroadphaseProxy^ proxy0, BroadphaseProxy^ proxy1,
			Dispatcher^ dispatcher) override;
		virtual void RemoveOverlappingPairsContainingProxy(BroadphaseProxy^ proxy0, Dispatcher^ dispatcher) override;

		property OverlapFilterCallback^ OverlapFilterCallback
		{
			BulletSharp::OverlapFilterCallback^ get();
			void set(BulletSharp::OverlapFilterCallback^ value);
		}
	};

	public ref class NullPairCache : OverlappingPairCache
	{
	public:
		NullPairCache();

		virtual BroadphasePair^ AddOverlappingPair(BroadphaseProxy^ proxy0, BroadphaseProxy^ proxy1) override;
		virtual IntPtr RemoveOverlappingPair(BroadphaseProxy^ proxy0, BroadphaseProxy^ proxy1,
			Dispatcher^ dispatcher) override;
		virtual void RemoveOverlappingPairsContainingProxy(BroadphaseProxy^ proxy0, Dispatcher^ dispatcher) override;
	};

	class OverlapFilterCallbackWrapper : public btOverlapFilterCallback
	{
	private:
		gcroot<OverlapFilterCallback^> _callback;

	public:
		OverlapFilterCallbackWrapper(OverlapFilterCallback^ callback);

		virtual bool needBroadphaseCollision(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) const;
	};
};


text:
$(function() {
  $(".last-value").click( function() {
    $("#play-event-name").attr('value', $(this).data('event-name'));
    $("#play-event-value").attr('value', $(this).data('event-value'));
    $("#play-events").dialog('open');
    $("#play-event-value").focus();
  });

  $(".active").effect( "highlight",{color:"#FF530D"} );

  $("abbr.timeago").timeago();
});


text:
var auth = require('../auth/Token');
var consts = require('../../../shared/constants');

var toJSON = function(res) {
    if (!res.ok) {
        throw res.statusText;
    }

    return res.json();
};

var get = function(url, useAuth) {
    if(useAuth === undefined) {
        useAuth = true;
    }

    var headers = {};
    if(useAuth) {
        headers.authorization = consts.auth.BEARER + ' ' + auth.getToken()
    }
    return fetch(url, {
        headers: headers,
        method: 'GET'
    }).then(toJSON);
};

var patch = function(url, payload) {
    return fetch(url, {
        headers: {
            authorization: consts.auth.BEARER + ' ' + auth.getToken(),
            'content-type': 'application/json'
        },
        method: 'PATCH',
        body: JSON.stringify(payload)
    }).then(toJSON);
};

module.exports = {
    get: get,
    patch: patch
};


text:
/*
 * Copyright (C) 1998-2004  David Turner and Werner Lemberg
 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
 * Copyright (C) 2007  Red Hat, Inc.
 *
 * This is part of HarfBuzz, an OpenType Layout engine library.
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *


text:
<resources>
    <string name="app_name">reactNativeCalendar</string>
</resources>


text:
#include "../precompiled.h"
#include "FontFaceLayer.h"
#include "FontFaceHandle.h"

namespace Rocket {
namespace Core {
namespace BitmapFont {

FontFaceLayer::FontFaceLayer() : Rocket::Core::FontFaceLayer()
{
	handle = NULL;
	effect = NULL;
}

FontFaceLayer::~FontFaceLayer()
{
}

// Generates the character and texture data for the layer.
bool FontFaceLayer::Initialise(const Rocket::Core::FontFaceHandle* _handle, FontEffect* _effect, const Rocket::Core::FontFaceLayer* clone, bool deep_clone)
{
	(void)(_effect);

	Rocket::Core::BitmapFont::FontFaceHandle
		* bm_font_face_handle;

	handle = _handle;

	bm_font_face_handle = ( Rocket::Core::BitmapFont::FontFaceHandle * ) handle;

	const FontGlyphList& glyphs = handle->GetGlyphs();

	// Clone the geometry and textures from the clone layer.
	if (clone != NULL)
	{
		// Copy the cloned layer's characters.
		characters = clone->characters;

		// Copy (and reference) the cloned layer's textures.
		for (size_t i = 0; i < clone->textures.size(); ++i)
			textures.push_back(clone->textures[i]);
	}
	else
	{
		// Load texture from file
		Texture texture;
		if (!texture.Load( bm_font_face_handle->GetTextureSource() ))
			return false;

		textures.push_back(texture);

		// Initialise the texture layout for the glyphs.
		characters.resize(glyphs.size(), Character());
		for (FontGlyphList::const_iterator i = glyphs.begin(); i != glyphs.end(); ++i)
		{
			const FontGlyph& glyph = *i;

			if(glyph.dimensions.x <= 0 || glyph.dimensions.y <= 0)
				continue;

			Vector2i glyph_origin( glyph.bitmap_dimensions.x, glyph.bitmap_dimensions.y ); // position in texture
			Vector2i glyph_dimensions = glyph.dimensions; // size of char

			Character character;
			character.origin = Vector2f((float) (glyph.bearing.x), (float) (glyph.bearing.y) - handle->GetBaseline()*3 );
			character.dimensions = Vector2f((float) glyph.dimensions.x, (float) glyph.dimensions.y);

			// Set the character's texture index.
			character.texture_index = 0;

			// Generate the character's texture coordinates.
			character.texcoords[0].x = float(glyph_origin.x) / float(bm_font_face_handle->GetTextureWidth());
			character.texcoords[0].y = float(glyph_origin.y) / float(bm_font_face_handle->GetTextureHeight());
			character.texcoords[1].x = float(glyph_origin.x + character.dimensions.x) / float(bm_font_face_handle->GetTextureWidth());
			character.texcoords[1].y = float(glyph_origin.y + character.dimensions.y) / float(bm_font_face_handle->GetTextureHeight());

			characters[glyph.character] = character;

			// Add the character's dimensions into the texture layout engine.
			texture_layout.AddRectangle(glyph.character, glyph_dimensions);
		}

		// Generate the texture layout; this will position the glyph rectangles efficiently and
		// allocate the texture data ready for writing.
		if (!texture_layout.GenerateLayout(512))
			return false;

	}
	return true;
}

// Generates the texture data for a layer (for the texture database).
bool FontFaceLayer::GenerateTexture(const byte*& texture_data, Vector2i& texture_dimensions, int texture_id)
{
	return true;
}

}
}
}


text:
'''
Utilities to help validate input.

Primitive types:
- is_float
- is_int

Files and directories:
- is_valid_file
- is_valid_dir
- is_readable
'''

import os

def is_float(value):
    '''
    Returns True if provided value is a float or can be converted into a float.
    Returns False otherwise.
    '''
    return _is_type(float, value)

def is_int(value):
    '''
    Returns True if provided value is an int or can be converted into an int.
    Returns False otherwise.
    '''
    return _is_type(int, value)

def _is_type(convert, value):
    ''' Returns True if provided value can be converted into provided type, or False otherwise. '''
    try:
        convert(value)
        return True
    except (ValueError, TypeError):
        return False

def is_valid_file(path):
    ''' Returns True if provided file exists and is a file, or False otherwise. '''
    return os.path.exists(path) and os.path.isfile(path)

def is_valid_dir(path):
    ''' Returns True if provided directory exists and is a directory, or False otherwise. '''
    return os.path.exists(path) and os.path.isdir(path)

def is_readable(path):
    '''
    Returns True if provided file or directory exists and can be read with the current user.
    Returns False otherwise.
    '''
    return os.access(os.path.abspath(path), os.R_OK)


text:
package com.example;

import java.time.Duration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.Pollers;
import org.springframework.integration.jdbc.JdbcPollingChannelAdapter;
import org.springframework.jdbc.core.JdbcOperations;

@Configuration
public class IntegrationShutdownConfig {

	private final ShutdownService shutdownService;
	private final JdbcOperations jdbc;

	public IntegrationShutdownConfig(ShutdownService shutdownService, JdbcOperations jdbc) {
		this.shutdownService = shutdownService;
		this.jdbc = jdbc;
	}

	@Bean
	public JdbcPollingChannelAdapter jdbcPollingChannelAdapter() {
		JdbcPollingChannelAdapter jdbcPollingChannelAdapter = new JdbcPollingChannelAdapter(jdbc,
				"select id from stop_signals where stopped = false");
		jdbcPollingChannelAdapter.setUpdateSql("update stop_signals set stopped = true where id = :id");
		return jdbcPollingChannelAdapter;
	}

	@Bean
	public IntegrationFlow stopIntegrationFlow() {
		return IntegrationFlows
				.from(jdbcPollingChannelAdapter(), c -> c.poller(Pollers.fixedDelay(Duration.ofSeconds(1))))
				.handle(shutdownService)
				.get();
	}
}


text:
require_relative '../../../../lib/Item/Equippable/Helmet/helmet.rb'

RSpec.describe Helmet do

  context "constructor" do
    it "has the correct default parameters" do
      helmet = Helmet.new
      expect(helmet.name).to eq "Helmet"
      expect(helmet.price).to eq 0
      expect(helmet.consumable).to eq false
      expect(helmet.type).to eq :helmet
    end

    it "correctly assigns custom parameters" do
      big_hat = Helmet.new(name: "Big Hat",
                           price: 20,
                           consumable: true,
                           stat_change: {attack: 2, defense: 2})
      expect(big_hat.name).to eq "Big Hat"
      expect(big_hat.price).to eq 20
      expect(big_hat.consumable).to eq true
      expect(big_hat.stat_change[:attack]).to eq 2
      expect(big_hat.stat_change[:defense]).to eq 2
      # Cannot be overwritten.
      expect(big_hat.type).to eq :helmet
    end
  end

end


text:
package fosite

import (
	"context"
	"encoding/json"
	"net/http"
	"net/http/httptest"
	"testing"
	"time"

	"github.com/dgraph-io/ristretto"
	"github.com/hashicorp/go-retryablehttp"
	"github.com/pkg/errors"

	"github.com/ory/fosite/internal/gen"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	jose "gopkg.in/square/go-jose.v2"
)

func initServerWithKey(t *testing.T) *httptest.Server {
	var set *jose.JSONWebKeySet
	var h http.HandlerFunc = func(w http.ResponseWriter, r *http.Request) {
		require.NoError(t, json.NewEncoder(w).Encode(set))
	}
	ts := httptest.NewServer(h)

	set = &jose.JSONWebKeySet{
		Keys: []jose.JSONWebKey{
			{
				KeyID: "bar",
				Use:   "sig",
				Key:   &gen.MustRSAKey().PublicKey,
			},
		},
	}

	t.Cleanup(ts.Close)
	return ts
}

var errRoundTrip = errors.New("roundtrip error")

type failingTripper struct{}

func (r *failingTripper) RoundTrip(*http.Request) (*http.Response, error) {
	return nil, errRoundTrip
}

func TestDefaultJWKSFetcherStrategy(t *testing.T) {
	ctx := context.Background()
	var h http.HandlerFunc

	s := NewDefaultJWKSFetcherStrategy()
	t.Run("case=fetching", func(t *testing.T) {
		var set *jose.JSONWebKeySet
		h = func(w http.ResponseWriter, r *http.Request) {
			require.NoError(t, json.NewEncoder(w).Encode(set))
		}
		ts := httptest.NewServer(h)
		defer ts.Close()

		set = &jose.JSONWebKeySet{
			Keys: []jose.JSONWebKey{
				{
					KeyID: "foo",
					Use:   "sig",
					Key:   &gen.MustRSAKey().PublicKey,
				},
			},
		}

		keys, err := s.Resolve(ctx, ts.URL, false)
		require.NoError(t, err)
		assert.True(t, len(keys.Key("foo")) == 1)

		set = &jose.JSONWebKeySet{
			Keys: []jose.JSONWebKey{
				{
					KeyID: "bar",
					Use:   "sig",
					Key:   &gen.MustRSAKey().PublicKey,
				},
			},
		}

		keys, err = s.Resolve(ctx, ts.URL, false)
		require.NoError(t, err)
		assert.Len(t, keys.Keys, 1, "%+v", keys)
		assert.True(t, len(keys.Key("foo")) == 1)
		assert.True(t, len(keys.Key("bar")) == 0)

		keys, err = s.Resolve(ctx, ts.URL, true)
		require.NoError(t, err)
		assert.True(t, len(keys.Key("foo")) == 0)
		assert.True(t, len(keys.Key("bar")) == 1)
	})

	t.Run("JWKSFetcherWithCache", func(t *testing.T) {
		ts := initServerWithKey(t)

		cache, _ := ristretto.NewCache(&ristretto.Config{NumCounters: 10 * 1000, MaxCost: 1000, BufferItems: 64})
		location := ts.URL
		expected := &jose.JSONWebKeySet{}
		require.True(t, cache.Set(defaultJWKSFetcherStrategyCachePrefix+location, expected, 1))
		cache.Wait()

		s := NewDefaultJWKSFetcherStrategy(JWKSFetcherWithCache(cache))
		actual, err := s.Resolve(ctx, location, false)
		require.NoError(t, err)
		assert.Equal(t, expected, actual)
	})

	t.Run("JWKSFetcherWithTTL", func(t *testing.T) {
		ts := initServerWithKey(t)

		s := NewDefaultJWKSFetcherStrategy(JKWKSFetcherWithDefaultTTL(time.Nanosecond))
		_, err := s.Resolve(ctx, ts.URL, false)
		require.NoError(t, err)
		s.(*DefaultJWKSFetcherStrategy).cache.Wait()

		_, ok := s.(*DefaultJWKSFetcherStrategy).cache.Get(defaultJWKSFetcherStrategyCachePrefix + ts.URL)
		assert.Falsef(t, ok, "expected cache to be empty")
	})

	t.Run("JWKSFetcherWithHTTPClient", func(t *testing.T) {
		rt := retryablehttp.NewClient()
		rt.RetryMax = 0
		rt.HTTPClient = &http.Client{Transport: new(failingTripper)}
		s := NewDefaultJWKSFetcherStrategy(JWKSFetcherWithHTTPClient(rt))
		_, err := s.Resolve(ctx, "https://google.com", false)
		require.ErrorIs(t, err, errRoundTrip)
	})

	t.Run("JWKSFetcherWithHTTPClientSource", func(t *testing.T) {
		rt := retryablehttp.NewClient()
		rt.RetryMax = 0
		rt.HTTPClient = &http.Client{Transport: new(failingTripper)}
		s := NewDefaultJWKSFetcherStrategy(
			JWKSFetcherWithHTTPClient(retryablehttp.NewClient()),
			JWKSFetcherWithHTTPClientSource(func(ctx context.Context) *retryablehttp.Client {
				return rt
			}))
		_, err := s.Resolve(ctx, "https://www.google.com", false)
		require.ErrorIs(t, err, errRoundTrip)
	})

	t.Run("case=error_network", func(t *testing.T) {
		s := NewDefaultJWKSFetcherStrategy()
		h = func(w http.ResponseWriter, r *http.Request) {
			w.WriteHeader(400)
		}
		ts := httptest.NewServer(h)
		defer ts.Close()

		_, err := s.Resolve(context.Background(), ts.URL, true)
		require.Error(t, err)

		_, err = s.Resolve(context.Background(), "$%/19", true)
		require.Error(t, err)
	})

	t.Run("case=error_encoding", func(t *testing.T) {
		s := NewDefaultJWKSFetcherStrategy()
		h = func(w http.ResponseWriter, r *http.Request) {
			w.Write([]byte("[]"))
		}
		ts := httptest.NewServer(h)
		defer ts.Close()

		_, err := s.Resolve(context.Background(), ts.URL, true)
		require.Error(t, err)
	})
}


text:
import os
import sys
# http://docs.readthedocs.io/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
from unittest.mock import MagicMock

class Mock(MagicMock):
    @classmethod
    def __getattr__(cls, name):
        return MagicMock()

on_RTD = os.environ.get('READTHEDOCS', None) == 'True'
if on_RTD:
    MOCK_MODULES = [
        'pygtk', 'gtk', 'gobject', 'argparse', 'numpy', 'pandas', 'scipy', 'unqlite', 'dask',
        'distributed', 'distributed.client', 'graphviz', 'matplotlib', 'sobol_seq', 'GPy',
        'dask.delayed', 'scipy.optimize', 'scipy.stats', 'scipy.spatial', 'scipy.sparse',
        'matplotlib.pyplot', 'numpy.random', 'networkx', 'ipyparallel', 'numpy.lib',
        'numpy.lib.format', 'sklearn.linear_model'
    ]
    sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

    html_theme = 'default'

else:
    html_theme = 'sphinx_rtd_theme'

# https://github.com/rtfd/readthedocs.org/issues/1139
"""
def run_apidoc(_):
    from sphinx.apidoc import main
    import os
    import sys
    sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
    cur_dir = os.path.abspath(os.path.dirname(__file__))
    module = '../elfi'
    output_path = os.path.join(cur_dir, 'source')
    main(['-eE', '-o', output_path, module, '--force'])

def setup(app):
    app.connect('builder-inited', run_apidoc)
"""

# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))

# Get the project root dir, which is the parent dir of this
cwd = os.getcwd()
project_root = os.path.dirname(cwd)

# Insert the project root dir as the first element in the PYTHONPATH.
# This lets us ensure that the source package is imported, and that its
# version is used.
sys.path.insert(0, project_root)

import elfi

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.coverage',
    'sphinx.ext.mathjax',
    'sphinx.ext.viewcode',
    'sphinx.ext.autosummary',
    'sphinx.ext.napoleon',
    # Inheritance diagrams
    # 'sphinx.ext.graphviz',
    # 'sphinx.ext.inheritance_diagram',
]

autoclass_content = 'both'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The encoding of source files.
#
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'ELFI'
copyright = '2017, ELFI Developers and their Assignees'
author = 'ELFI authors'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = elfi.__version__
# The full version, including alpha/beta/rc tags.
release = elfi.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#
# today = ''
#
# Else, today_fmt is used as the format for a strftime call.
#
# today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The reST default role (used for this markup: `text`) to use for all
# documents.
#
# default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#
# add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#
add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = ['elfi']

# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
    'collapse_navigation': True,
    'navigation_depth': 2,
}

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []

# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = 'ELFI v0,1,0'

# A shorter title for the navigation bar.  Default is the same as html_title.
#
# html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#
# html_logo = None

# The name of an image file (relative to this directory) to use as a favicon of
# the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#
# html_favicon = None

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#
# html_extra_path = []

# If not None, a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
# The empty string is equivalent to '%b %d, %Y'.
#
# html_last_updated_fmt = None

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#
# html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#
# html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#
# html_additional_pages = {}

# If false, no module index is generated.
#
# html_domain_indices = True

# If false, no index is generated.
#
# html_use_index = True

# If true, the index is split into individual pages for each letter.
#
# html_split_index = False

# If true, links to the reST sources are added to the pages.
#
# html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#
# html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#
# html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
#
# html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None

# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
#   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
#   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
#
# html_search_language = 'en'

# A dictionary with options for the search language support, empty by default.
# 'ja' uses this config value.
# 'zh' user can custom change `jieba` dictionary path.
#
# html_search_options = {'type': 'default'}

# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#
# html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = 'ELFIdoc'


text:
<?xml version="1.0" encoding="utf-8"?>
<!--

-->

<RelativeLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:app="http://schemas.android.com/apk/res-auto"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:orientation="vertical"
	>

	<!-- paddingBottom is calculated with FloatingActionButton's height (56dp) and
	     margins (16dp): 56dp + (2 x 16dp) = 88dp. -->
	<android.support.v7.widget.RecyclerView
		android:id="@+id/list"
		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		android:paddingBottom="88dp"
		android:clipToPadding="false"
		/>

	<TextView
		android:id="@+id/empty"
		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		android:gravity="center"
		android:text="@string/list_host_empty"
		android:textAppearance="?android:attr/textAppearanceMedium"
		/>

	<android.support.design.widget.FloatingActionButton
		android:id="@+id/add_host_button"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_alignParentBottom="true"
		android:layout_alignParentEnd="true"
		android:layout_alignParentRight="true"
		android:layout_margin="16dp"
		android:src="@drawable/ic_add"
		android:tint="@android:color/white"
		app:backgroundTint="@color/accent"
		app:rippleColor="@color/dark_accent" />

</RelativeLayout>


text:
'use strict';

var mdeps = require('module-deps'),
  fs = require('fs'),
  path = require('path'),
  babelify = require('babelify'),
  concat = require('concat-stream'),
  moduleFilters = require('../../lib/module_filters');

/**
 * Returns a readable stream of dependencies, given an array of entry
 * points and an object of options to provide to module-deps.
 *
 * This stream requires filesystem access, and thus isn't suitable
 * for a browser environment.
 *
 * @param {Array<string>} indexes paths to entry files as strings
 * @param {Object} options optional options passed
 * @param {Function} callback called with (err, inputs)
 * @returns {undefined} calls callback
 */
function dependencyStream(indexes, options, callback) {
  var md = mdeps({
    filter: function (id) {
      return !!options.external || moduleFilters.internalOnly(id);
    },
    transform: [babelify.configure({
      sourceMap: false,
      stage: 0
    })],
    postFilter: moduleFilters.externals(indexes, options)
  });
  indexes.forEach(function (index) {
    md.write(path.resolve(index));
  });
  md.end();
  md.once('error', function (error) {
    return callback(error);
  });
  md.pipe(concat(function (inputs) {
    callback(null, inputs.map(function (input) {
      // un-transform babelify transformed source
      input.source = fs.readFileSync(input.file, 'utf8');
      return input
    }));
  }));
}

module.exports = dependencyStream;


text:
RSpec::Matchers.define :filter_granules_from do |expected|
  match do |selector|
    wait_for_xhr
    synchronize do
      number_granules = expect(selector.text).to match_regex /\d+ Granule/
      after_granule_count = number_granules.to_s.split(" ")[0].to_i

      expect(expected).to be > after_granule_count
    end
  end
end

RSpec::Matchers.define :reset_granules_to do |expected|
  match do |selector|
    wait_for_xhr
    synchronize do
      raise "Granules not displayed" unless selector.text =~ /(\d+) Granules/
      expect($1.to_i).to be >= expected.to_i
    end
  end
end


text:
.class public Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;
.super Landroid/view/View;
.source "BasePanelPenSizeView.java"

# static fields
.field private static final LOG_TAG:Ljava/lang/String; = "BasePanelPenSizeView"

# instance fields
.field private mBasePanel:Lcom/htc/painting/penmenu/base/BasePanel;

.field private mColor:I

.field private mNewSize:F

.field private mPenSize:F

.field private mScaleAnimListener:Landroid/view/animation/Animation$AnimationListener;

.field private mSize:I

.field private mSizeIconPosition:F

# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 2
    .parameter "context"

    .prologue
    .line 62
    const/4 v0, 0x0

    const/4 v1, 0x0

    invoke-direct {p0, p1, v0, v1}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 63
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 66
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 67
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    .line 70
    invoke-direct {p0, p1, p2, p3}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 47
    new-instance v0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView$1;

    invoke-direct {v0, p0}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView$1;-><init>(Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;)V

    iput-object v0, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mScaleAnimListener:Landroid/view/animation/Animation$AnimationListener;

    .line 71
    invoke-direct {p0}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->initView()V

    .line 72
    return-void
.end method

.method static synthetic access$002(Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;F)F
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 23
    iput p1, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mPenSize:F

    return p1
.end method

.method static synthetic access$100(Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;)F
    .locals 1
    .parameter "x0"

    .prologue
    .line 23
    iget v0, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mNewSize:F

    return v0
.end method

.method private initView()V
    .locals 2

    .prologue
    .line 75
    const/high16 v0, -0x100

    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->setPenSize(IF)V

    .line 76
    return-void
.end method

# virtual methods
.method changeColor(I)V
    .locals 0
    .parameter "color"

    .prologue
    .line 159
    iput p1, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mColor:I

    .line 160
    invoke-virtual {p0}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->invalidate()V

    .line 161
    return-void
.end method

.method changeSize(F)V
    .locals 8
    .parameter "size"

    .prologue
    const/high16 v2, 0x3f80

    .line 134
    iget v3, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mPenSize:F

    cmpl-float v3, p1, v3

    if-nez v3, :cond_0

    .line 151
    :goto_0
    return-void

    .line 138
    :cond_0
    iget v3, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mPenSize:F

    div-float v1, v3, p1

    .line 139
    .local v1, from:F
    iput p1, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mNewSize:F

    .line 141
    invoke-virtual {p0}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->getWidth()I

    move-result v3

    int-to-float v3, v3

    iget v4, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mSizeIconPosition:F

    sub-float v5, v3, v4

    .line 142
    .local v5, centerX:F
    invoke-virtual {p0}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->getHeight()I

    move-result v3

    int-to-float v3, v3

    iget v4, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mSizeIconPosition:F

    sub-float v6, v3, v4

    .line 144
    .local v6, centerY:F
    invoke-virtual {p0}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x20e00cb

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getInteger(I)I

    move-result v7

    .line 147
    .local v7, animDuration:I
    new-instance v0, Landroid/view/animation/ScaleAnimation;

    move v3, v1

    move v4, v2

    invoke-direct/range {v0 .. v6}, Landroid/view/animation/ScaleAnimation;-><init>(FFFFFF)V

    .line 148
    .local v0, anim:Landroid/view/animation/ScaleAnimation;
    iget-object v2, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mScaleAnimListener:Landroid/view/animation/Animation$AnimationListener;

    invoke-virtual {v0, v2}, Landroid/view/animation/ScaleAnimation;->setAnimationListener(Landroid/view/animation/Animation$AnimationListener;)V

    .line 149
    int-to-long v2, v7

    invoke-virtual {v0, v2, v3}, Landroid/view/animation/ScaleAnimation;->setDuration(J)V

    .line 150
    invoke-virtual {p0, v0}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->startAnimation(Landroid/view/animation/Animation;)V

    goto :goto_0
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 5
    .parameter "canvas"

    .prologue
    .line 111
    invoke-super {p0, p1}, Landroid/view/View;->onDraw(Landroid/graphics/Canvas;)V

    .line 113
    invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I

    .line 115
    new-instance v2, Landroid/graphics/Paint;

    invoke-direct {v2}, Landroid/graphics/Paint;-><init>()V

    .line 116
    .local v2, paint:Landroid/graphics/Paint;
    sget-object v3, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 117
    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    .line 118
    iget v3, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mColor:I

    invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setColor(I)V

    .line 119
    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    .line 121
    invoke-virtual {p0}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->getWidth()I

    move-result v3

    int-to-float v3, v3

    iget v4, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mSizeIconPosition:F

    sub-float v0, v3, v4

    .line 122
    .local v0, centerX:F
    invoke-virtual {p0}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->getHeight()I

    move-result v3

    int-to-float v3, v3

    iget v4, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mSizeIconPosition:F

    sub-float v1, v3, v4

    .line 123
    .local v1, centerY:F
    iget v3, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mPenSize:F

    const/high16 v4, 0x4000

    div-float/2addr v3, v4

    invoke-virtual {p1, v0, v1, v3, v2}, Landroid/graphics/Canvas;->drawCircle(FFFLandroid/graphics/Paint;)V

    .line 125
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    .line 126
    return-void
.end method

.method protected onMeasure(II)V
    .locals 2
    .parameter "widthMeasureSpec"
    .parameter "heightMeasureSpec"

    .prologue
    .line 97
    iget-object v0, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mBasePanel:Lcom/htc/painting/penmenu/base/BasePanel;

    invoke-virtual {v0}, Lcom/htc/painting/penmenu/base/BasePanel;->getPenMenuSize()I

    move-result v0

    iget-object v1, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mBasePanel:Lcom/htc/painting/penmenu/base/BasePanel;

    invoke-virtual {v1}, Lcom/htc/painting/penmenu/base/BasePanel;->getPenMenuSize()I

    move-result v1

    invoke-virtual {p0, v0, v1}, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->setMeasuredDimension(II)V

    .line 98
    return-void
.end method

.method setBasePanel(Lcom/htc/painting/penmenu/base/BasePanel;)V
    .locals 0
    .parameter "basePanel"

    .prologue
    .line 44
    iput-object p1, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mBasePanel:Lcom/htc/painting/penmenu/base/BasePanel;

    .line 45
    return-void
.end method

.method setIconPosition(F)V
    .locals 0
    .parameter "position"

    .prologue
    .line 88
    iput p1, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mSizeIconPosition:F

    .line 89
    return-void
.end method

.method setPenSize(IF)V
    .locals 0
    .parameter "color"
    .parameter "size"

    .prologue
    .line 170
    iput p1, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mColor:I

    .line 171
    iput p2, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mPenSize:F

    .line 172
    return-void
.end method

.method setSize(I)V
    .locals 0
    .parameter "size"

    .prologue
    .line 84
    iput p1, p0, Lcom/htc/painting/penmenu/base/BasePanelPenSizeView;->mSize:I

    .line 85
    return-void
.end method


text:
package com.microsoft.azure.management.resources.v2016_06_01;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Defines values for SubscriptionState.
 */
public enum SubscriptionState {
    /** Enum value Enabled. */
    ENABLED("Enabled"),

    /** Enum value Warned. */
    WARNED("Warned"),

    /** Enum value PastDue. */
    PAST_DUE("PastDue"),

    /** Enum value Disabled. */
    DISABLED("Disabled"),

    /** Enum value Deleted. */
    DELETED("Deleted");

    /** The actual serialized value for a SubscriptionState instance. */
    private String value;

    SubscriptionState(String value) {
        this.value = value;
    }

    /**
     * Parses a serialized value to a SubscriptionState instance.
     *
     * @param value the serialized value to parse.
     * @return the parsed SubscriptionState object, or null if unable to parse.
     */
    @JsonCreator
    public static SubscriptionState fromString(String value) {
        SubscriptionState[] items = SubscriptionState.values();
        for (SubscriptionState item : items) {
            if (item.toString().equalsIgnoreCase(value)) {
                return item;
            }
        }
        return null;
    }

    @JsonValue
    @Override
    public String toString() {
        return this.value;
    }
}


text:
.class public Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/a;
.super Ljava/lang/Object;

# instance fields
.field private a:Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;

# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;

    invoke-direct {v0, p1}, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/a;->a:Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;

    const-wide/16 v0, 0x5

    invoke-virtual {p0, v0, v1}, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/a;->a(J)V

    return-void
.end method

# virtual methods
.method public a()Ljava/util/Queue;
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Queue",
            "<",
            "Lcom/samsung/context/sdk/samsunganalytics/a/f/d;",
            ">;"
        }
    .end annotation

    iget-object v4, p0, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/a;->a:Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;

    invoke-virtual {v4}, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    const-string/jumbo v4, "select * from logs"

    const/4 v5, 0x0

    invoke-virtual {v0, v4, v5}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    new-instance v2, Ljava/util/concurrent/LinkedBlockingQueue;

    invoke-direct {v2}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V

    :goto_0
    invoke-interface {v1}, Landroid/database/Cursor;->moveToNext()Z

    move-result v4

    if-nez v4, :cond_0

    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    return-object v2

    :cond_0
    new-instance v3, Lcom/samsung/context/sdk/samsunganalytics/a/f/d;

    invoke-direct {v3}, Lcom/samsung/context/sdk/samsunganalytics/a/f/d;-><init>()V

    const-string/jumbo v4, "_id"

    invoke-interface {v1, v4}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v4

    invoke-interface {v1, v4}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Lcom/samsung/context/sdk/samsunganalytics/a/f/d;->a(Ljava/lang/String;)V

    const-string/jumbo v4, "data"

    invoke-interface {v1, v4}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v4

    invoke-interface {v1, v4}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Lcom/samsung/context/sdk/samsunganalytics/a/f/d;->b(Ljava/lang/String;)V

    const-string/jumbo v4, "timestamp"

    invoke-interface {v1, v4}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v4

    invoke-interface {v1, v4}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v4

    invoke-virtual {v3, v4, v5}, Lcom/samsung/context/sdk/samsunganalytics/a/f/d;->a(J)V

    invoke-interface {v2, v3}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z

    goto :goto_0
.end method

.method public a(J)V
    .locals 5

    iget-object v2, p0, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/a;->a:Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;

    invoke-virtual {v2}, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "timestamp <= "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const-string/jumbo v2, "logs"

    const/4 v3, 0x0

    invoke-virtual {v0, v2, v1, v3}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I

    return-void
.end method

.method public a(Lcom/samsung/context/sdk/samsunganalytics/a/f/d;)V
    .locals 4

    iget-object v2, p0, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/a;->a:Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;

    invoke-virtual {v2}, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    new-instance v1, Landroid/content/ContentValues;

    invoke-direct {v1}, Landroid/content/ContentValues;-><init>()V

    invoke-virtual {p1}, Lcom/samsung/context/sdk/samsunganalytics/a/f/d;->b()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v2

    const-string/jumbo v3, "timestamp"

    invoke-virtual {v1, v3, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    invoke-virtual {p1}, Lcom/samsung/context/sdk/samsunganalytics/a/f/d;->c()Ljava/lang/String;

    move-result-object v2

    const-string/jumbo v3, "data"

    invoke-virtual {v1, v3, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string/jumbo v2, "logs"

    const/4 v3, 0x0

    invoke-virtual {v0, v2, v3, v1}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    return-void
.end method

.method public a(Ljava/lang/String;)V
    .locals 4

    iget-object v2, p0, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/a;->a:Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;

    invoke-virtual {v2}, Lcom/samsung/context/sdk/samsunganalytics/a/f/c/a/b;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "_id = "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const-string/jumbo v2, "logs"

    const/4 v3, 0x0

    invoke-virtual {v0, v2, v1, v3}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I

    return-void
.end method


text:
@interface DBCameraView : UIView
@property (nonatomic, weak) id <DBCameraViewDelegate> delegate;
@property (nonatomic, strong) UIButton *photoLibraryButton, *triggerButton, *closeButton;
@property (nonatomic, strong) UIButton *gridButton, *cameraButton, *flashButton;
@property (nonatomic, strong, readonly) AVCaptureVideoPreviewLayer *previewLayer;
@property (nonatomic, strong, readonly) UITapGestureRecognizer *singleTap, *doubleTap;
@property (nonatomic, strong, readonly) UIPanGestureRecognizer *panGestureRecognizer;
@property (nonatomic, strong) UIPinchGestureRecognizer *pinch;

+ (id) initWithFrame:(CGRect)frame;
+ (DBCameraView *) initWithCaptureSession:(AVCaptureSession *)captureSession;

- (void) defaultInterface;
- (void) drawFocusBoxAtPointOfInterest:(CGPoint)point andRemove:(BOOL)remove;
- (void) drawExposeBoxAtPointOfInterest:(CGPoint)point andRemove:(BOOL)remove;
- (void) draw:(CALayer *)layer atPointOfInterest:(CGPoint)point andRemove:(BOOL)remove;
- (void) pinchCameraViewWithScalNum:(CGFloat)scale;
@end


text:
<?php
require 'vendor/autoload.php';
session_start();
$client = new Google_Client();
$client->setAuthConfigFile("http://localhost/configuration/name/google-credentials.json");
$client->addScope("https://www.googleapis.com/auth/userinfo.profile");
$client->addScope("https://www.googleapis.com/auth/userinfo.email");
$client->setAccessType('offline');
$client->setApprovalPrompt('auto');
$client->setRedirectUri('postmessage');

if (function_exists('setProxy')) {
    $client->getIo()->setOptions(array(
        CURLOPT_PROXY => 'localhost',
        CURLOPT_PROXYPORT => 8888
    ));
}

if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
    include_once 'php/name.php';
    $client->setAccessToken($_SESSION['access_token']);
    try {

        if (!isset($_SESSION['token_data'])) {
            $token_data = $client->verifyIdToken()->getAttributes();
            if ($token_data["payload"]["email_verified"]) {
                $_SESSION['token_data'] = $token_data;
            }
        }
        $_SESSION['canVote'] = checkVotingRights($_SESSION["token_data"]["payload"]["email"]);

        $oAuth2 = new \Google_Service_Oauth2($client);
        $oAttr = $oAuth2->userinfo->get();

    } catch (Exception $e) {
        unset($_SESSION['access_token']);
        $redirect_uri = $_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER['HTTP_HOST'];
        header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));
    }
}

if (isset($_GET['logout'])) {
    // Need to proxy if needed.
    if (function_exists('setProxy')) {
        setProxy();
        $client->getIo()->setOptions(array(
            CURLOPT_PROXY => 'localhost',
            CURLOPT_PROXYPORT => 8888
        ));

    }
    $client->revokeToken($_SESSION['access_token']);
    unset($_SESSION['access_token']);
    $_SESSION = array();
    $redirect_uri = $_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER['HTTP_HOST'];
    header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));
    die;
}

/** Send the user for authentication with Google
 * will call us again with ?code set.*/
if (isset($_GET['login'])) {
    $client->setRedirectUri($_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER['HTTP_HOST']);
    $client->addScope("https://www.googleapis.com/auth/userinfo.profile");
    $client->addScope("https://www.googleapis.com/auth/userinfo.email");

    // Need to proxy if needed.
    if (function_exists('setProxy')) {
        $client->getIo()->setOptions(array(
            CURLOPT_PROXY => 'localhost',
            CURLOPT_PROXYPORT => 8888
        ));
        setProxy();
    }
    $auth_url = $client->createAuthUrl();
    header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
}

/** Called when authenticated with google. Will take the user to the
 * normal page */
if (isset($_GET['code'])) {
    $client->setRedirectUri($_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER['HTTP_HOST']);
    error_log($_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER['HTTP_HOST']);
    try {
        $client->authenticate($_GET['code']);
    } catch (Exception  $e) {
        var_dump($e);
        die;
    }

    $_SESSION['access_token'] = $client->getAccessToken();
    $token_data = $client->verifyIdToken()->getAttributes();

    $redirect_uri = $_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER['HTTP_HOST'];
    header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));

}
?>

<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

    <link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon">
    <link rel="icon" href="/images/favicon.png" type="image/x-icon">

    <link href="./css/3pp/bootstrap.min.css" rel="stylesheet"/>
    <link href="./css/3pp/bootstrap-theme.min.css" rel="stylesheet"/>
    <link href="./css/3pp/font-awesome.min.css" rel="stylesheet"/>
    <link href="./css/3pp/bootstrap-social.css" rel="stylesheet"/>
    <link rel="stylesheet" href="./css/3pp/angular-material.min.css">
    <link rel="stylesheet" href="./css/fonts/roboto.css">

    <link rel="stylesheet" href="/css/name.css">

    <title>Name competition (β)</title>

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>
            DITS Name competition (β)

                        Log out

                        Log in

                            Sign in with Google

                <alert close='closeAlert()' type="{{alert.type}}">{{alert.message}}</alert>

DITS name competition (β)

This is a competition to select a name for DITS. Anyone can suggest but only board members (with
                    spouses) can
                    vote.

Please read instructions carefully!

Instructions

Select a pass phrase, about 10 or twenty characters, what ever you like but please
                            remember
                            it. It will be used to verify that it is you who made the suggestion. Keep it a secret.

Enter a suggestion, this will be stored together with the encrypted (AES-256) version,
                            encrypted
                            with you pass phrase, a pass phrase that only you should know.

Check back in later and vote, you can vote for as many as you want, but you can only
                            cast
                            one vote per suggestion

You will currently need to reload the page to see changes from other users.

To be able to vote you have to login using your Google account. Do so in the menu.

                    <form class="" name="passForm">

                            Pass phrase

                            <input id="passphrase"
                                   class="form-control"
                                   type="{{showPass}}"
                                   name="passphrase"
                                   data-ng-model="passphrase"
                                   placeholder="Enter you pass phrase here">

                            <button type="button" class="btn btn-default"
                                    data-ng-class="{'disabled' : ! passForm.$valid || !passForm.$dirty }"
                                    data-ng-click="savePassPhrase()">
                                Save
                            </button>

                    </form>

Suggest

                <form class="" name="suggestionForm">

                        Name suggestion
                        <input id="suggestion"
                               class="form-control"
                               type="text"
                               name="suggestion"
                               data-ng-model="suggestion"
                               placeholder="Your name suggestion..."
                               required>

                        Motivation
                    <textarea id="motivation"
                              class="form-control"
                              type="text"
                              name="motivation"
                              data-ng-model="motivation"
                              rows="3"
                              placeholder="Write a snappy motivation for this name"></textarea>

                        <button type="button" class="btn btn-default"
                                data-ng-class="{'disabled' : ! suggestionForm.$valid || !suggestionForm.$dirty }"
                                data-ng-click="submitSuggestion()">
                            Submit
                        </button>

                </form>

Suggestions

Log in to vote!

User {{email}} cannot vote!

                                Name Suggestion

Motivation

#

                                {{suggestion.suggestion}}

{{suggestion.motivation}}

Motivation not provided

{{suggestion.voteCount}}


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Sprites</title>
    <style type="text/css">
        html, body {
          margin:0;
          padding:0;
          background-color:#000;
          pointer-events: none;
        }

        canvas {
          display: block;
        }
    </style>
</head>
<body>
    <canvas id="canvas"></canvas>
    <script type="text/javascript" src="../lib/RequestAnimationFramePolyfill.js"></script>
    <script type="text/javascript" src="../lib/promise.js"></script>
    <script type="text/javascript" src="../lib/require.js"></script>
    <script type="text/javascript">
      require.config({
        baseUrl: '../'
      });
    </script>
    <script type="text/javascript" src="tilemap.js"></script>
</body>
</html>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Index of deprecated symbols</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="index.html" title="GIO Reference Manual">
<link rel="prev" href="api-index-full.html" title="Index">
<link rel="next" href="api-index-2-18.html" title="Index of new symbols in 2.18">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">

GIO Reference Manual

A
                      |
                   D
                      |
                   F
                      |
                   I
                      |
                   M
                      |
                   S
                      |
                   T
                      |
                   U
                      |
                   V

Index of deprecated symbols

A

g_application_set_action_group, function in GApplication

D

g_drive_eject, function in GDrive

g_drive_eject_finish, function in GDrive

F

g_file_eject_mountable, function in GFile

g_file_eject_mountable_finish, function in GFile

g_file_unmount_mountable, function in GFile

g_file_unmount_mountable_finish, function in GFile

I

g_io_scheduler_cancel_all_jobs, function in GIOScheduler

g_io_scheduler_job_send_to_mainloop, function in GIOScheduler

g_io_scheduler_job_send_to_mainloop_async, function in GIOScheduler

g_io_scheduler_push_job, function in GIOScheduler

M

g_mount_eject, function in GMount

g_mount_eject_finish, function in GMount

g_mount_unmount, function in GMount

g_mount_unmount_finish, function in GMount

S

GSettings:schema, object property in GSettings

g_simple_action_group_add_entries, function in GSimpleActionGroup

g_simple_action_group_insert, function in GSimpleActionGroup

g_simple_action_group_lookup, function in GSimpleActionGroup

g_simple_action_group_remove, function in GSimpleActionGroup

T

GTlsConnection:use-system-certdb, object property in GTlsConnection

g_tls_connection_get_use_system_certdb, function in GTlsConnection

g_tls_connection_set_use_system_certdb, function in GTlsConnection

U

GUnixSocketAddress:abstract, object property in GUnixSocketAddress

g_unix_socket_address_get_is_abstract, function in GUnixSocketAddress

g_unix_socket_address_new_abstract, function in GUnixSocketAddress

V

g_volume_eject, function in GVolume

g_volume_eject_finish, function in GVolume

g_volume_monitor_adopt_orphan_mount, function in GVolumeMonitor

          Generated by GTK-Doc V1.19


text:
use crate::Wallet;
use godcoin::net::*;
use native_tls::TlsConnector;
use std::{
    io::Cursor,
    net::{SocketAddr, TcpStream, ToSocketAddrs},
    time::Duration,
};
use tungstenite::{client, protocol::Message, stream::Stream};

macro_rules! check_unlocked {
    ($self:expr) => {
        if $self.db.state() != DbState::Unlocked {
            return Err("wallet not unlocked".to_owned());
        }
    };
}

macro_rules! hex_to_bytes {
    ($string:expr) => {{
        let len = $string.len() / 2;
        let mut dst = vec![0; len];
        let res = faster_hex::hex_decode($string.as_bytes(), &mut dst);
        match res {
            Ok(_) => Ok(dst),
            Err(_) => Err("invalid hex string"),
        }
    }};
}

pub fn send_print_rpc_req(wallet: &mut Wallet, body: rpc::Request) {
    let res = send_rpc_req(wallet, body);
    match res {
        Ok(res) => println!("{:#?}", res),
        Err(e) => println!("{}", e),
    }
}

pub fn send_rpc_req(wallet: &mut Wallet, body: rpc::Request) -> Result<Msg, String> {
    let buf = {
        let req_id = {
            let id = wallet.req_id;
            wallet.req_id += 1;
            if wallet.req_id == u32::max_value() {
                wallet.req_id = 0;
            }
            id
        };

        let mut buf = Vec::with_capacity(8192);
        let req = Msg {
            id: req_id,
            body: Body::Request(body),
        };
        req.serialize(&mut buf);
        buf
    };

    let mut ws = {
        let mut addr = (wallet.url.host_str().unwrap(), wallet.url.port().unwrap())
            .to_socket_addrs()
            .unwrap();

        let addr = loop {
            match addr.next() {
                Some(addr) => match addr {
                    SocketAddr::V4(_) => break addr,
                    _ => continue,
                },
                None => return Err("No resolved IPv4 addresses found from host".to_owned()),
            }
        };

        let stream = TcpStream::connect_timeout(&addr, Duration::from_secs(3))
            .map_err(|e| format!("Failed to connect to host: {:?}", e))?;
        let stream = match wallet.url.scheme() {
            "ws" => Stream::Plain(stream),
            "wss" => {
                let connector = TlsConnector::new().unwrap();
                Stream::Tls(
                    connector
                        .connect(wallet.url.host_str().unwrap(), stream)
                        .unwrap(),
                )
            }
            _ => panic!("Expected node url scheme to be ws or wss"),
        };

        let (ws, _) = client(wallet.url.clone(), stream)
            .map_err(|e| format!("Failed to init ws socket: {:?}", e))?;
        ws
    };
    ws.write_message(Message::Binary(buf)).unwrap();
    ws.write_pending().unwrap();

    let msg = loop {
        let msg = ws.read_message().unwrap();
        match msg {
            Message::Binary(res) => {
                let mut cursor = Cursor::<&[u8]>::new(&res);
                let msg = Msg::deserialize(&mut cursor)
                    .map_err(|e| format!("Failed to deserialize response: {}", e))?;
                match msg.body {
                    Body::Error(_) | Body::Response(_) => break msg,
                    Body::Ping(nonce) => {
                        let msg = Msg {
                            id: msg.id,
                            body: Body::Pong(nonce),
                        };
                        let mut buf = Vec::with_capacity(16);
                        msg.serialize(&mut buf);
                        ws.write_message(Message::Binary(buf)).unwrap();
                        ws.write_pending().unwrap();
                    }
                    _ => continue,
                }
            }
            _ => continue,
        }
    };
    let _ = ws.close(None);

    Ok(msg)
}


text:
template<typename T, typename Association>
Arbre<T,Association>::Arbre(T etiquette,Association assoc){
		etq = etiquette;
		nbFils = 0;
		associe = assoc;
		cout<<"assoc occu :"<<assoc.occurrence<<endl;
}

template<typename T, typename Association>
void Arbre<T,Association>::modifierAssocie(Association assoc){
	cout<<"DEBUT MODIF ASSOCIE"<<endl;
	cout<<"occu :"<<this->associe.occurrence<<" contre "<<assoc.occurrence<<endl;
		this->associe = assoc;
}

template<typename T, typename Association>
bool Arbre<T, Association>::estFeuille(){
	return (this->nbFils==0);
}

template<typename T, typename Association>
T Arbre<T, Association>::renvoiEtq(){
	return etq;
}

template<typename T, typename Association>
Arbre<T,Association> * Arbre<T, Association>::renvoiFils(T etiquette){
	Arbre<T,Association> * fils = NULL;
	bool trouve = false;
	int ii;
	cout<<"DEBUT BOUCLE RENVOIFILS"<<endl;
	cout<<"nbFils"<<this->nbFils<<endl;
	for(int i=0; i<this->nbFils && trouve == false ; i++){
		cout<<"boucle nb"<<i<<" || "<<this->lesFils[i]->renvoiEtq()<<endl;
		if(this->lesFils[i]->renvoiEtq() == etiquette){
			 fils = this->lesFils[i];
			 cout<<"i :"<<i<<endl;
			 ii = i;
			 trouve = true;
			 cout<<"renvoi voulu :"<<etiquette<<" || renvoi fait :"<<this->lesFils[ii]->etq<<endl;
			}
	}

	return fils;
}

/*template<typename T, typename Association>
void Arbre<T, Association>::trousseauEtq(vector<K> * clfs, int &N){
    int i,j,taille;
        for(i = 0; i < nbFils; i++) { //on parcours tous les arbres fils
			clfs->push_back(lesFils[i].etq);
        }
}*/

template<typename T, typename Association>
void Arbre<T, Association>::ajouterFils(T etiquette,Association assoc){
	this->lesFils.push_back(new Arbre<T,Association>(etiquette,assoc));
	this->nbFils = this->nbFils+1;
}

template<typename T, typename Association>
Association Arbre<T,Association>::renvoiAssocie(){
	cout<<"DEBUT RENVOI ASSOCIE"<<endl;
	return (this->associe);
}

template<typename T, typename Association>
vector<Arbre<T,Association>*> Arbre<T,Association>::renvoiTousLesFils(){
	return (this->lesFils);
}


text:
package org.apache.apex.malhar.contrib.misc.math;

import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.datatorrent.lib.testbench.CollectorTestSink;

/**
 *
 * Functional tests for {@link Change}.
 * <p>
 * @deprecated
 */
@Deprecated
public class ChangeTest
{
  private static Logger log = LoggerFactory.getLogger(ChangeTest.class);

  /**
   * Test node logic emits correct results.
   */
  @Test
  public void testNodeProcessing() throws Exception
  {
    testNodeProcessingSchema(new Change<Integer>());
    testNodeProcessingSchema(new Change<Double>());
    testNodeProcessingSchema(new Change<Float>());
    testNodeProcessingSchema(new Change<Short>());
    testNodeProcessingSchema(new Change<Long>());
  }

  /**
   *
   * @param oper  Data value for comparison.
   */
  @SuppressWarnings({ "rawtypes", "unchecked" })
  public <V extends Number> void testNodeProcessingSchema(Change<V> oper)
  {
    CollectorTestSink changeSink = new CollectorTestSink();
    CollectorTestSink percentSink = new CollectorTestSink();

    oper.change.setSink(changeSink);
    oper.percent.setSink(percentSink);

    oper.beginWindow(0);
    oper.base.process(oper.getValue(10));
    oper.data.process(oper.getValue(5));
    oper.data.process(oper.getValue(15));
    oper.data.process(oper.getValue(20));
    oper.endWindow();

    Assert.assertEquals("number emitted tuples", 3,
        changeSink.collectedTuples.size());
    Assert.assertEquals("number emitted tuples", 3,
        percentSink.collectedTuples.size());

    log.debug("\nLogging tuples");
    for (Object o : changeSink.collectedTuples) {
      log.debug(String.format("change %s", o));
    }
    for (Object o : percentSink.collectedTuples) {
      log.debug(String.format("percent change %s", o));
    }
  }
}


text:
// --------- This code has been automatically generated !!! 2017-01-16T16:52:10.675Z
"use strict";
require("requirish")._(module);
/**
 * @module opcua.address_space.types
 */
var assert = require("better-assert");
var util = require("util");
var _  = require("underscore");
var makeNodeId = require("lib/datamodel/nodeid").makeNodeId;
var schema_helpers =  require("lib/misc/factories_schema_helpers");
var extract_all_fields                       = schema_helpers.extract_all_fields;
var resolve_schema_field_types               = schema_helpers.resolve_schema_field_types;
var initialize_field                         = schema_helpers.initialize_field;
var initialize_field_array                   = schema_helpers.initialize_field_array;
var check_options_correctness_against_schema = schema_helpers.check_options_correctness_against_schema;
var _defaultTypeMap = require("lib/misc/factories_builtin_types")._defaultTypeMap;
var ec = require("lib/misc/encode_decode");
var encodeArray = ec.encodeArray;
var decodeArray = ec.decodeArray;
var makeExpandedNodeId = ec.makeExpandedNodeId;
var generate_new_id = require("lib/misc/factories").generate_new_id;
var _enumerations = require("lib/misc/factories_enumerations")._private._enumerations;
var schema = require("../schemas/AttributeOperand_schema").AttributeOperand_Schema;
var RelativePath = require("./_auto_generated_RelativePath").RelativePath;
var BaseUAObject = require("lib/misc/factories_baseobject").BaseUAObject;
var FilterOperand = require("./_auto_generated_FilterOperand").FilterOperand;

/**
 *
 * @class AttributeOperand
 * @constructor
 * @extends FilterOperand
 * @param  options {Object}
 * @param  [options.nodeId] {NodeId} NodeId of a Node from the type system.
 * @param  [options.alias] {String} An optional parameter used to identify or refer to an alias. An alias is a symbolic name that can be used to alias this operand and use it in other locations in the filter structure.
 * @param  [options.browsePath] {RelativePath} Browse path relative to the Node identified by the nodeId parameter.
 * @param  [options.attributeId] {IntegerId}
 * @param  [options.indexRange] {NumericRange} This parameter is used to identify a single element of an array or a single range of indexes for an array. The first element is identified by index 0 (zero).
 */
function AttributeOperand(options)
{
    options = options || {};
    /* istanbul ignore next */
    if (schema_helpers.doDebug) { check_options_correctness_against_schema(this,schema,options); }
    var self = this;
    assert(this instanceof BaseUAObject); //  ' keyword "new" is required for constructor call')
    resolve_schema_field_types(schema);

    FilterOperand.call(this,options);

    /**
      * NodeId of a Node from the type system.
      * @property nodeId
      * @type {NodeId}
      */
    self.nodeId = initialize_field(schema.fields[0], options.nodeId);

    /**
      * An optional parameter used to identify or refer to an alias. An alias is a symbolic name that can be used to alias this operand and use it in other locations in the filter structure.
      * @property alias
      * @type {String}
      */
    self.alias = initialize_field(schema.fields[1], options.alias);

    /**
      * Browse path relative to the Node identified by the nodeId parameter.
      * @property browsePath
      * @type {RelativePath}
      */
    self.browsePath =  new RelativePath( options.browsePath);

    /**
      *
      * @property attributeId
      * @type {IntegerId}
      */
    self.attributeId = initialize_field(schema.fields[3], options.attributeId);

    /**
      * This parameter is used to identify a single element of an array or a single range of indexes for an array. The first element is identified by index 0 (zero).
      * @property indexRange
      * @type {NumericRange}
      */
    self.indexRange = initialize_field(schema.fields[4], options.indexRange);

   // Object.preventExtensions(self);
}
util.inherits(AttributeOperand,FilterOperand);
AttributeOperand.prototype.encodingDefaultBinary = makeExpandedNodeId(600,0);
AttributeOperand.prototype.encodingDefaultXml = makeExpandedNodeId(599,0);
AttributeOperand.prototype._schema = schema;

var encode_NodeId = _defaultTypeMap.NodeId.encode;
var decode_NodeId = _defaultTypeMap.NodeId.decode;
var encode_String = _defaultTypeMap.String.encode;
var decode_String = _defaultTypeMap.String.decode;
var encode_IntegerId = _defaultTypeMap.IntegerId.encode;
var decode_IntegerId = _defaultTypeMap.IntegerId.decode;
var encode_NumericRange = _defaultTypeMap.NumericRange.encode;
var decode_NumericRange = _defaultTypeMap.NumericRange.decode;
/**
 * encode the object into a binary stream
 * @method encode
 *
 * @param stream {BinaryStream}
 */
AttributeOperand.prototype.encode = function(stream,options) {
    // call base class implementation first
    FilterOperand.prototype.encode.call(this,stream,options);
    encode_NodeId(this.nodeId,stream);
    encode_String(this.alias,stream);
   this.browsePath.encode(stream,options);
    encode_IntegerId(this.attributeId,stream);
    encode_NumericRange(this.indexRange,stream);
};
/**
 * decode the object from a binary stream
 * @method decode
 *
 * @param stream {BinaryStream}
 * @param [option] {object}
 */
AttributeOperand.prototype.decode = function(stream,options) {
    // call base class implementation first
    FilterOperand.prototype.decode.call(this,stream,options);
    this.nodeId = decode_NodeId(stream,options);
    this.alias = decode_String(stream,options);
    this.browsePath.decode(stream,options);
    this.attributeId = decode_IntegerId(stream,options);
    this.indexRange = decode_NumericRange(stream,options);
};
AttributeOperand.possibleFields = [
  "nodeId",
         "alias",
         "browsePath",
         "attributeId",
         "indexRange"
];

exports.AttributeOperand = AttributeOperand;
var register_class_definition = require("lib/misc/factories_factories").register_class_definition;
register_class_definition("AttributeOperand",AttributeOperand);


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="SaveActionSettings">
    <option name="actions">
      <set>
        <option value="activate" />
        <option value="organizeImports" />
        <option value="reformat" />
        <option value="rearrange" />
      </set>
    </option>
    <option name="configurationPath" value="" />
  </component>
</project>


text:
package com.jacksen.java.test;

public class Test2 {

	public static void main(String[] args) {
		ListNode node1 = new ListNode(1);
		ListNode node2 = new ListNode(2);
		ListNode node3 = new ListNode(3);
		ListNode node4 = new ListNode(4);
		ListNode node5 = new ListNode(5);
		ListNode node6 = new ListNode(6);
		node1.next = node2;
		node2.next = node3;
		node3.next = node4;
		node4.next = node5;
		node5.next = node6;

		printList(node1);

		System.out.println();
		node3.next = null;
		printList(node1);

	}

	private static void printList(ListNode head) {
		while (head != null) {
			System.out.print(head.val + "-->");
			head = head.next;
		}
	}

}

class ListNode {
	int val;
	ListNode next;

	public ListNode(int x) {
		val = x;
	}
}


text:
package org.apache.pinot.broker.routing.segmentpreselector;

import java.util.Set;

/**
 * The segment pre-selector filters the unnecessary online segments for the query.
 *
Segment pre-selector examples:
 *

 *

 *     For table with segment merge/rollup enabled, select the merged segments over the original segments with the same
 *     data
 *

 *

 */
public interface SegmentPreSelector {

  /**
   * Pre-selects the online segments to filter out the unnecessary segments. This method might modify the online segment
   * set passed in.
   */
  Set<String> preSelect(Set<String> onlineSegments);
}


text:
import bluebottle.activities.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('activities', '0046_auto_20220317_0900'),
    ]

    operations = [
        migrations.AlterField(
            model_name='effortcontribution',
            name='contribution_type',
            field=models.CharField(choices=[('organizer', 'Activity Organizer'), ('deed', 'Deed particpant')], max_length=20, verbose_name='Contribution type'),
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(default=django.utils.timezone.now)),
                ('activity', models.ForeignKey(on_delete=bluebottle.activities.models.NON_POLYMORPHIC_CASCADE, related_name='teams', to='activities.Activity')),
                ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='teams', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Team',
                'ordering': ('-created',),
            },
        ),
    ]