text:
<script>
// sets nav
var setNav = (function () {
  var my = {};
  my.init = function () {
    //set active class on current page and page's parents
    //console.log(location.pathname.split("/")[1] + '/' + location.pathname.split("/")[2]);
    $('#nav-mobile a[href="/' + location.pathname.split("/")[1] + '/' + location.pathname.split("/")[2] + '"]').closest('li').addClass('active').parent('ul').parent('div').parent('li').addClass('active').children('a').addClass('active');
    // reinitiates accordion, now that active classes are set
    $('.collapsible').collapsible({});
  };
  return my;
}());//setNav

var showHideCode = (function(){
  var my = {};
  my.init = function(){

    //on load, check for session var
    var showCodeVar = localStorage.getItem('showCodeObj');

    if (showCodeVar === "false") {
      hideCode();
    } else if (showCodeVar === "true") {
      showCode();
    } else {
      hideCode();
    }

    //hide on click
    $('.js-hide-code').click(function(){
      hideCode();
    });
    //show on click
    $('.js-show-code').click(function(){
      showCode();
    });
  };

  showCode = function(){
    $(  "pre[class*='language-']").show();
    showCodeVar = "true";
    populateStorage(showCodeVar);
  };

  hideCode = function(){
    $(  "pre[class*='language-']").hide();
    showCodeVar = "false";
    populateStorage(showCodeVar);
  };

  populateStorage = function(showCodeVar){
    localStorage.setItem('showCodeObj', showCodeVar);
  };

  return my;
}());//showHideCode

  setNav.init();
  showHideCode.init();

  $('.scrollspy').scrollSpy();
  //TODO: investigate why sometimes the pushpin dependency loads so slowly
  //eg. on styleguide/slider page
  setTimeout(function(){
    $('.toc-wrapper').pushpin({ top: $('.toc-wrapper').offset().top });
  }, 1000);

</script>


text:
(function(scope) {
  'use strict';

  var HTMLElement = scope.wrappers.HTMLElement;
  var assert = scope.assert;
  var mixin = scope.mixin;
  var registerWrapper = scope.registerWrapper;
  var unwrap = scope.unwrap;
  var wrap = scope.wrap;

  var elementsWithFormProperty = [
    'HTMLButtonElement',
    'HTMLFieldSetElement',
    'HTMLInputElement',
    'HTMLKeygenElement',
    'HTMLLabelElement',
    'HTMLLegendElement',
    'HTMLObjectElement',
    // HTMLOptionElement is handled in HTMLOptionElement.js
    'HTMLOutputElement',
    // HTMLSelectElement is handled in HTMLSelectElement.js
    'HTMLTextAreaElement',
  ];

  function createWrapperConstructor(name) {
    if (!window[name])
      return;

    // Ensure we are not overriding an already existing constructor.
    assert(!scope.wrappers[name]);

    var GeneratedWrapper = function(node) {
      // At this point all of them extend HTMLElement.
      HTMLElement.call(this, node);
    }
    GeneratedWrapper.prototype = Object.create(HTMLElement.prototype);
    mixin(GeneratedWrapper.prototype, {
      get form() {
        return wrap(unwrap(this).form);
      },
    });

    registerWrapper(window[name], GeneratedWrapper,
        document.createElement(name.slice(4, -7)));
    scope.wrappers[name] = GeneratedWrapper;
  }

  elementsWithFormProperty.forEach(createWrapperConstructor);

})(window.ShadowDOMPolyfill);

redpajama_set_name: RedPajamaGithub


text:
package com.jvmhub.springboot.form;

import javax.validation.constraints.Size;

public class Post {

	@Size(min=4, max=35)
	private String title;

	@Size(min=30, max= 1000)
	private String content;

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
}


text:
/*! Bootstrap integration for DataTables' Editor
 * ©2015 SpryMedia Ltd - datatables.net/license
 */

(function( factory ){
	if ( typeof define === 'function' && define.amd ) {
		// AMD
		define( ['jquery', 'datatables.net-bs4', 'datatables.net-editor'], function ( $ ) {
			return factory( $, window, document );
		} );
	}
	else if ( typeof exports === 'object' ) {
		// CommonJS
		module.exports = function (root, $) {
			if ( ! root ) {
				root = window;
			}

			if ( ! $ || ! $.fn.dataTable ) {
				$ = require('datatables.net-bs4')(root, $).$;
			}

			if ( ! $.fn.dataTable.Editor ) {
				require('datatables.net-editor')(root, $);
			}

			return factory( $, root, root.document );
		};
	}
	else {
		// Browser
		factory( jQuery, window, document );
	}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;

/*
 * Set the default display controller to be our bootstrap control
 */
DataTable.Editor.defaults.display = "bootstrap";

/*
 * Alter the buttons that Editor adds to TableTools so they are suitable for bootstrap
 */
var i18nDefaults = DataTable.Editor.defaults.i18n;
i18nDefaults.create.title = '
'+i18nDefaults.create.title+'
';
i18nDefaults.edit.title = '
'+i18nDefaults.edit.title+'
';
i18nDefaults.remove.title = '
'+i18nDefaults.remove.title+'
';

var tt = DataTable.TableTools;
if ( tt ) {
	tt.BUTTONS.editor_create.formButtons[0].className = "btn btn-primary";
	tt.BUTTONS.editor_edit.formButtons[0].className = "btn btn-primary";
	tt.BUTTONS.editor_remove.formButtons[0].className = "btn btn-danger";
}

/*
 * Change the default classes from Editor to be classes for Bootstrap
 */
$.extend( true, $.fn.dataTable.Editor.classes, {
	"header": {
		"wrapper": "DTE_Header modal-header"
	},
	"body": {
		"wrapper": "DTE_Body modal-body"
	},
	"footer": {
		"wrapper": "DTE_Footer modal-footer"
	},
	"form": {
		"tag": "form-horizontal",
		"button": "btn btn-default"
	},
	"field": {
		"wrapper": "DTE_Field form-group",
		"label":   "col-lg-4 control-label",
		"input":   "col-lg-8 controls",
		"error":   "error has-error",
		"msg-labelInfo": "help-block",
		"msg-info":      "help-block",
		"msg-message":   "help-block",
		"msg-error":     "help-block",
		"multiValue":    "well well-sm multi-value",
		"multiInfo":     "small",
		"multiRestore":  "well well-sm multi-restore"
	}
} );

$.extend( true, DataTable.ext.buttons, {
	create: {
		formButtons: {
			className: 'btn-primary'
		}
	},
	edit: {
		formButtons: {
			className: 'btn-primary'
		}
	},
	remove: {
		formButtons: {
			className: 'btn-danger'
		}
	}
} );

/*
 * Bootstrap display controller - this is effectively a proxy to the Bootstrap
 * modal control.
 */

var self;

DataTable.Editor.display.bootstrap = $.extend( true, {}, DataTable.Editor.models.displayController, {
	/*
	 * API methods
	 */
	"init": function ( dte ) {
		// init can be called multiple times (one for each Editor instance), but
		// we only support a single construct here (shared between all Editor
		// instances)
		if ( ! self._dom.content ) {
			self._dom.content = $(
				'
'+
					'
'+
						'
'+
					'
'+
				'
'
			);

			self._dom.close = $('<button class="close">×
');

			self._dom.close.click( function () {
				self._dte.close('icon');
			} );

			$(document).on('click', 'div.modal', function (e) {
				if ( $(e.target).hasClass('modal') && self._shown ) {
					self._dte.background();
				}
			} );
		}

		// For each instance we need to know when it is opened
		dte.on( 'open.dtebs', function ( e, type ) {
			if ( type === 'inline' || type === 'bubble' ) {
				$('div.DTE input[type=text], div.DTE select, div.DTE textarea').addClass( 'form-control' );
			}
		} );

		return self;
	},

	"open": function ( dte, append, callback ) {
		if ( self._shown ) {
			if ( callback ) {
				callback();
			}
			return;
		}

		self._dte = dte;
		self._shown = true;

		var content = self._dom.content.find('div.modal-content');
		content.children().detach();
		content.append( append );

		$('div.modal-header', append).prepend( self._dom.close );

		$(self._dom.content)
			.one('shown.bs.modal', function () {
				// Can only give elements focus when shown
				if ( self._dte.s.setFocus ) {
					self._dte.s.setFocus.focus();
				}

				if ( callback ) {
					callback();
				}
			})
			.one('hidden', function () {
				self._shown = false;
			})
			.appendTo( 'body' )
			.modal( {
				backdrop: "static",
				keyboard: false
			} );

		$('input:not([type=checkbox]):not([type=radio]), select, textarea', self._dom.content)
			.addClass( 'form-control' );
	},

	"close": function ( dte, callback ) {
		if ( !self._shown ) {
			if ( callback ) {
				callback();
			}
			return;
		}

		$(self._dom.content)
			.one( 'hidden.bs.modal', function () {
				$(this).detach();
			} )
			.modal('hide');

		self._dte = dte;
		self._shown = false;

		if ( callback ) {
			callback();
		}
	},

	node: function ( dte ) {
		return self._dom.content[0];
	},

	/*
	 * Private properties
	 */
	 "_shown": false,
	"_dte": null,
	"_dom": {}
} );

self = DataTable.Editor.display.bootstrap;

return DataTable.Editor;
}));


text:
from vt_manager.communication.sfa.util.enumeration import Enum

# recognized top level rspec elements
RSpecElements = Enum(
    AVAILABLE='AVAILABLE',
    BWLIMIT='BWLIMIT',
    EXECUTE='EXECUTE',
    NETWORK='NETWORK',
    COMPONENT_MANAGER='COMPONENT_MANAGER',
    HARDWARE_TYPE='HARDWARE_TYPE',
    INSTALL='INSTALL',
    INTERFACE='INTERFACE',
    INTERFACE_REF='INTERFACE_REF',
    LOCATION='LOCATION',
    LOGIN='LOGIN',
    LINK='LINK',
    LINK_TYPE='LINK_TYPE',
    NODE='NODE',
    PROPERTY='PROPERTY',
    SERVICES='SERVICES',
    SLIVER='SLIVER',
    SLIVER_TYPE='SLIVER_TYPE',
    LEASE='LEASE',
    GRANULARITY='GRANULARITY',
    SPECTRUM='SPECTRUM',
    CHANNEL='CHANNEL',
    POSITION_3D ='POSITION_3D',
)

class RSpecElement:
    def __init__(self, element_type, path):
        if not element_type in RSpecElements:
            raise InvalidRSpecElement(element_type)
        self.type = element_type
        self.path = path


text:
var assert = require('assert');
var async = require('async');
var supertest = require('supertest');
var should = require('should');
var init = require('../../../config/init');
var mongoose = require('mongoose');

var request = supertest('http://localhost:3000');
var _ = require('lodash');

//Model
var Users = require('../../models/user');
var Messages = require('../../models/message');

//Controller
var userController = require('../../controllers/user');
var messageController = require('../../controllers/message');
var user1 = null;
var user2 = null;
var message1 = null;
var message2 = null;

beforeEach(function(done){
	async.parallel([
		function(cb) {
			Users.remove({}, function(err){
				cb(err);
			});
		}, function(cb){
			Messages.remove({}, function(err){
				cb(err);
			});
		}
	], function() {

		user1 = new Users({
			name: 'FirstName',
			surname: 'LastName',
			email: 'test1@test1.com',
			username: 'username1',
			password: 'password'
		});

		user2 = new Users({
			name: 'FirstName',
			surname: 'LastName',
			email: 'test2@test2.com',
			username: 'username2',
			password: 'password'
		});

		async.waterfall([
			function(cb) {
				user1.save(function(err){
					cb(err);
				});
			},
			function(cb){
				user2.save(function(err){
					cb(err);
				});
			},
			function(cb) {

				message1 = new Messages({
					message: 'This is a simple message',
					fromUser: user1,
					toUser: user2
				});

				message2 = new Messages({
					message: 'This is another simple messages',
					fromUser: user2,
					toUser: user1
				});

				cb();
			},
			function(cb){
				message1.save(function(err){
					cb(err);
				});
			},
			function(cb){
				message2.save(function(err){
					cb(err);
				});
			}
		],
		function(err) {
			done(err);
		});
	});
});

describe('Unit tests for all the RESTful operations', function(){
	describe('#listMessage()', function(){
		it('should be able to list all the messages', function(done){
			request
			.get('/messages')
			.expect('Content-Type', /json/)
			.expect(200)
			.end(function(err, res){
				if(err){
					done(err);
				}
				else{
					res.body[0].message.should.equal(message1.message);
					res.body[0].fromUser.should.equal(user1.id);
					res.body[0].toUser.should.equal(user2.id);
					done();
				}
			});
		});
	});

	describe('#deleteAllMessagese()', function(){
		it('should be able to delete all messages', function(done){
			request
			.delete('/messages')
			.expect(200)
			.end(function(err, res){
				if(err){
					done(err);
				}
				else{
					done();
				}
			});
		});
	});

	describe('#listSpecificMessage()', function(){
		it('should be able to get specific message', function(done){
			request
			.delete('/messages/'+message1.id)
			.expect(200)
			.end(function(err, res){
				if(err){
					done(err);
				}
				else{
					done();
				}
			});
		});
	});

	describe('#updateSpecificMessage()', function(){
		it('should be able to update a specific message', function(done){
			request
			.put('/messages/'+message1.id)
			.send({'message': 'An updated message'})
			.expect(200)
			.end(function(err, res){
				if(err){
					done(err);
				}
				else{
					done();
				}
			});
		});
	});

	describe('#deleteSpecificMessage()', function(){
		it('should be able to delete a specific message', function(done){
			request
			.delete('/messages/'+message1.id)
			.expect(200)
			.end(function(err, res){
				if(err){
					done(err);
				}
				else{
					done();
				}
			});
		});
	});
});


text:
# NOTE: this example requires PyAudio because it uses the Microphone class

import speech_recognition as sr

# obtain audio from the microphone
r = sr.Recognizer()

class ear:
    def __init__(self,recogSource):
        self.recogSource=recogSource;

    def listening(self):
        with sr.Microphone() as source:
            print("Say something! Analysis by "+self.recogSource)
            audio = r.listen(source)

        try:
            processedMsg=r.recognize_sphinx(audio)
            print(processedMsg)
            return(processedMsg)

        except sr.UnknownValueError:
            print("Can't understand what you said")
        except sr.RequestError as e:
            print ("Sphinx error; {0}".format(e))

if __name__=="__main__":
    earMsg=ear("phinx")
    earMsg.listening()


text:
"""Secure client-server interoperability as a unit test."""

import unittest

from grpc.beta import implementations

from tests.interop import _interop_test_case
from tests.interop import methods
from tests.interop import resources
from tests.interop import test_pb2

from tests.unit.beta import test_utilities

_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'

class SecureInteropTest(
    _interop_test_case.InteropTestCase,
    unittest.TestCase):

  def setUp(self):
    self.server = test_pb2.beta_create_TestService_server(methods.TestService())
    port = self.server.add_secure_port(
        '[::]:0', implementations.ssl_server_credentials(
            [(resources.private_key(), resources.certificate_chain())]))
    self.server.start()
    self.stub = test_pb2.beta_create_TestService_stub(
        test_utilities.not_really_secure_channel(
            '[::]', port, implementations.ssl_channel_credentials(
                resources.test_root_certificates()),
                _SERVER_HOST_OVERRIDE))

  def tearDown(self):
    self.server.stop(0)

if __name__ == '__main__':
  unittest.main(verbosity=2)


text:
class ProtocolListenerMgr
{
public:
    ~ProtocolListenerMgr();

    static void Init(const std::string& prefix, int port, bool retry_random);
    static ProtocolListenerMgr* GetProtocolListenerMgr();

    bool Start();
    void Stop();
    void Wait();

private:
    ProtocolListenerMgr(const std::string& prefix, int port, bool retry_random)
        : _prefix(prefix), _port(port), _retry_random(retry_random), _stop(true)
    {}

    static ProtocolListenerMgr* _mgr;

    std::string _prefix;
    int _port;
    bool _retry_random;
    std::mutex _lock;
    std::condition_variable _cond;
    bool _stop;
    std::unique_ptr<ProtocolListener> _bond_listener;
    std::unique_ptr<ProtocolListener> _djson_listener;
    std::unique_ptr<ProtocolListener> _json_listener;
    std::unique_ptr<ProtocolListener> _tcp_json_listener;
};

// vim: set ai sw=8:
#endif // _PROTOCOL_LISTENER_MGMT_HH_


text:
package org.apache.hadoop.hive.ql.exec.vector.filesink;

import java.io.Serializable;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.ql.CompilationOpContext;
import org.apache.hadoop.hive.ql.exec.FileSinkOperator;
import org.apache.hadoop.hive.ql.exec.TerminalOperator;
import org.apache.hadoop.hive.ql.exec.vector.VectorizationContext;
import org.apache.hadoop.hive.ql.exec.vector.VectorizationOperator;
import org.apache.hadoop.hive.ql.exec.vector.VectorizedBatchUtil;
import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.plan.FileSinkDesc;
import org.apache.hadoop.hive.ql.plan.OperatorDesc;
import org.apache.hadoop.hive.ql.plan.ReduceSinkDesc;
import org.apache.hadoop.hive.ql.plan.VectorDesc;
import org.apache.hadoop.hive.ql.plan.VectorFileSinkDesc;
import org.apache.hadoop.hive.ql.plan.api.OperatorType;
import org.apache.hadoop.hive.ql.io.arrow.ArrowWrapperWritable;
import org.apache.hadoop.mapred.RecordWriter;
import org.apache.hadoop.hive.llap.LlapOutputFormatService;
import org.apache.hadoop.hive.ql.exec.ColumnInfo;
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.StructField;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
import java.util.List;
import java.util.ArrayList;
import org.apache.hadoop.hive.ql.io.arrow.Serializer;
import static org.apache.hadoop.hive.llap.LlapOutputFormat.LLAP_OF_ID_KEY;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.annotations.VisibleForTesting;
import org.apache.logging.log4j.core.layout.AbstractStringLayout;

/**
 * Native Vectorized File Sink operator implementation for Arrow.
 * Assumes output to LlapOutputFormatService
 **/
public class VectorFileSinkArrowOperator extends TerminalOperator<FileSinkDesc>
    implements Serializable, VectorizationOperator {

  private static final long serialVersionUID = 1L;

  private VectorizationContext vContext;
  private VectorFileSinkDesc vectorDesc;
  public static final Logger LOG = LoggerFactory.getLogger(VectorFileSinkArrowOperator.class.getName());

  // The above members are initialized by the constructor and must not be
  // transient.
  //---------------------------------------------------------------------------

  private transient Serializer converter;
  private transient RecordWriter recordWriter;
  private transient boolean wroteData;
  private transient String attemptId;

  public VectorFileSinkArrowOperator(CompilationOpContext ctx, OperatorDesc conf,
      VectorizationContext vContext, VectorDesc vectorDesc) {
    this(ctx);
    this.conf = (FileSinkDesc) conf;
    this.vContext = vContext;
    this.vectorDesc = (VectorFileSinkDesc) vectorDesc;
  }

  /** Kryo ctor. */
  @VisibleForTesting
  public VectorFileSinkArrowOperator() {
    super();
  }

  public VectorFileSinkArrowOperator(CompilationOpContext ctx) {
    super(ctx);
  }

  @Override
  public VectorizationContext getInputVectorizationContext() {
    return vContext;
  }

  @Override
  protected void initializeOp(Configuration hconf) throws HiveException {
    super.initializeOp(hconf);
    //attemptId identifies a RecordWriter initialized by LlapOutputFormatService
    this.attemptId = hconf.get(LLAP_OF_ID_KEY);
    try {
      //Initialize column names and types
      List<TypeInfo> typeInfos = new ArrayList<>();
      List<String> fieldNames = new ArrayList<>();
      StructObjectInspector schema = (StructObjectInspector) inputObjInspectors[0];
      for(int i = 0; i < schema.getAllStructFieldRefs().size(); i++) {
        StructField structField = schema.getAllStructFieldRefs().get(i);
        fieldNames.add(structField.getFieldName());
        TypeInfo typeInfo = TypeInfoUtils.getTypeInfoFromObjectInspector(structField.getFieldObjectInspector());
        typeInfos.add(typeInfo);
      }
      //Initialize an Arrow serializer
      converter = new Serializer(hconf, attemptId, typeInfos, fieldNames);
    } catch (Exception e) {
      LOG.error("Unable to initialize VectorFileSinkArrowOperator");
      throw new RuntimeException(e);
    }
  }

  @Override
  public void process(Object data, int tag) throws HiveException {
    //ArrowStreamReader expects at least the schema metadata, if this op writes no data,
    //we need to send the schema to close the stream gracefully
    VectorizedRowBatch batch = (VectorizedRowBatch) data;
    try {
      if(recordWriter == null) {
        recordWriter = LlapOutputFormatService.get().getWriter(this.attemptId);
      }
      //Convert the VectorizedRowBatch to a handle for the Arrow batch
      ArrowWrapperWritable writable = converter.serializeBatch(batch, true);
      //Pass the handle to the LlapOutputFormatService recordWriter
      recordWriter.write(null, writable);
      this.wroteData = true;
    } catch(Exception e) {
      LOG.error("Failed to convert VectorizedRowBatch to Arrow batch");
      throw new RuntimeException(e);
    }
  }

  @Override
  protected void closeOp(boolean abort) throws HiveException {
    try {
      if(!wroteData) {
        //Send a schema only batch to signal EOS with no data written
        ArrowWrapperWritable writable = converter.emptyBatch();
        if(recordWriter == null) {
          recordWriter = LlapOutputFormatService.get().getWriter(this.attemptId);
        }
        recordWriter.write(null, writable);
      }
    } catch(Exception e) {
      LOG.error("Failed to write Arrow stream schema");
      throw new RuntimeException(e);
    } finally {
      try {
        //Close the recordWriter with null Reporter
        recordWriter.close(null);
      } catch(Exception e) {
        LOG.error("Failed to close Arrow stream");
        throw new RuntimeException(e);
      }
    }
  }

  @Override
  public VectorDesc getVectorDesc() {
    return vectorDesc;
  }

  @Override
  public OperatorType getType() {
    return OperatorType.FILESINK;
  }
}


text:
using AutoMapper;
using DNCP.ConsulClient;
using DNCP.Logger;
using DNCP.Middleware;
using DNCP.Util;
using DNCP.WebApiDemo.Attributes;
using DNCP.WebApiDemo.AutoMapperDemo;
using DNCP.WebApiDemo.Conventions;
using DNCP.WebApiDemo.Filters;
using DNCP.WebApiDemo.Models;
using DNCP.WebApiDemo.Swagger;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.PlatformAbstractions;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Swashbuckle.AspNetCore.Swagger;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace DNCP.WebApiDemo
{
    /// <summary>
    ///
    /// </summary>
    public class Startup
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name="env"></param>
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)//增加环境配置文件,新建项目默认有
                .AddEnvironmentVariables();
            Configuration = builder.Build();
        }

        /// <summary>
        ///
        /// </summary>
        public IConfiguration Configuration { get; }

        /// <summary>
        /// This method gets called by the runtime. Use this method to add services to the container.
        /// </summary>
        /// <param name="services"></param>
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddLogger();
            //添加redis
            services.AddDistributedRedisCache(options =>
            {
                options.Configuration = "104.223.65.91:6379,allowAdmin = true,password = hausthy@123,defaultdatabase = 5";
                options.InstanceName = "Redis_Session_";

            });
            services.AddSession(options => { options.IdleTimeout = TimeSpan.FromMinutes(30); });
            services.AddCors(c =>
            {
                c.AddPolicy("AllowAnyOrigin", policy =>
                {
                    policy.AllowAnyOrigin()//允许任何源
                    .AllowAnyMethod()//允许任何方式
                    .AllowAnyHeader()//允许任何头
                    .AllowCredentials();//允许cookie
                });
            });
            var mvcBuilder = services.AddMvc(options =>
              {
                  options.Conventions.Add(new ApiVersionRouteConvention()); //配置全局路由
                  options.Conventions.Add(new FromBodyConvention()); //配置数据绑定
                                                                     //options.Filters.Add<AuthorizationFilter>();
                  options.Filters.Add<TokenAuthorizeFilter>();
                  options.Filters.Add<ControllerActionAsyncFilter>();
                  options.Filters.Add<ExceptionFilter>();
              });
            mvcBuilder.AddJsonOptions(options =>
            {
                options.SerializerSettings.ContractResolver = new DefaultContractResolver();
                options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;

            });
            services.AddApiVersioning(option =>
            {
                option.ReportApiVersions = true;
                option.AssumeDefaultVersionWhenUnspecified = true;
                option.DefaultApiVersion = new ApiVersion(1, 0);
            });
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("WebApi", new Info { Title = "ApiDoc", Version = "v1" });
                c.SwaggerDoc("Products", new Info { Title = "Products", Version = "v1" });
                c.SwaggerDoc("Services", new Info { Title = "Services", Version = "v1" });
                var basePath = PlatformServices.Default.Application.ApplicationBasePath;
                var xmlPath = Path.Combine(basePath, "DNCP.WebApiDemo.xml");
                c.IncludeXmlComments(xmlPath);

                //这里是给Swagger添加验证的部分
                c.AddSecurityDefinition("Bearer", new ApiKeyScheme { In = "header", Description = "请输入带有Bearer的Token", Name = "Authorization", Type = "apiKey" });
                c.AddSecurityRequirement(new Dictionary<string, IEnumerable<string>> { { "Bearer", Enumerable.Empty<string>() } });

                //添加认证头
                c.OperationFilter<AddAuthTokenHeaderParameter>();
                c.DocumentFilter<AddSwaggerEnumDescriptions>();
            });

            //Consul
            services.AddConsul(options =>
            {
                options.ID = Guid.NewGuid().ToString("N");
                options.Name = "WebApiTest";
                options.Tags = new string[] { "WebApi" };
                options.Address = "http://104.223.65.91:51622";
                options.CheckUrl = "/api/v1/status/check";
                options.ConfigFileName = "";
                options.ConsulUrl = "http://104.223.65.91:8500";
                options.EnableTagOverride = false;
                options.Interval = 60;
            });

            services.Configure<RazorViewEngineOptions>(options =>
            {
                options.AreaViewLocationFormats.Clear();
                options.AreaViewLocationFormats.Add("/Areas/{2}/Views/{1}/{0}.cshtml");
                options.AreaViewLocationFormats.Add("/Areas/{2}/Views/Shared/{0}.cshtml");
                options.AreaViewLocationFormats.Add("/Views/Shared/{0}.cshtml");
            });
            services.Configure<ConsulModel>(Configuration.GetSection("Consul"));
            services.Configure<SwaggerModel>(Configuration.GetSection("Swagger"));
            AutoMapper.IConfigurationProvider config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile<MappingProfile>();
            });
            services.AddSingleton(config);
            services.AddScoped<IMapper, Mapper>();
            DependencyInjectionHelper.ServiceProvider = services.BuildServiceProvider();
        }

        /// <summary>
        /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        /// </summary>
        /// <param name="app"></param>
        /// <param name="env"></param>
        /// <param name="consulModel"></param>
        /// <param name="swaggerModel"></param>
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IOptions<ConsulModel> consulModel, IOptions<SwaggerModel> swaggerModel)
        {
            if (env.IsDevelopment())
            {
                //app.UseExceptionHandlerMiddleware();
                //app.UseDeveloperExceptionPage();
            }

            app.UseForwardedHeaders(new ForwardedHeadersOptions
            {
                ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
            });
            app.UseTokenAuth(option => { option.IgnoreAuthAttributeType = typeof(IgnoreAuthAttribute); });

            app.UseExceptionLogger();
            //app.UseRequestResponseLogger();
            //app.UseResponse();
            app.UseSession();
            app.UseCors("AllowAnyOrigin");

            //Consul服务注册
            var consulEnable = consulModel.Value.Enable;
            if (consulEnable)
            {
                app.UseConsul();
            }

            //swagger
            var swaggerEnable = swaggerModel.Value.Enable;
            if (swaggerEnable)
            {
                app.UseSwagger(c =>
                {
                    c.RouteTemplate = "apidoc/swagger/{documentName}/swagger.json";
                });
                app.UseSwaggerUI(c =>
                {
                    c.RoutePrefix = "apidoc";
                    c.SwaggerEndpoint($"/apidoc/swagger/WebApi/swagger.json", "WebApi");
                    c.SwaggerEndpoint($"/apidoc/swagger/Products/swagger.json", "Products");
                    c.SwaggerEndpoint($"/apidoc/swagger/Services/swagger.json", "Services");
                });
            }

            app.UseMvc(option =>
            {
                option.MapRoute(name: "areas", template: "{area:exists}/{controller}/{action=Index}/{id?}");
                option.MapRoute(name: "default", template: "{controller=MassSend}/{action=Content}/{id?}");
            });
        }
    }
}


text:
CBYTE	inifile[_MAX_PATH];
CBYTE	strbuf[_MAX_PATH];

#ifndef TARGET_DC

void ENV_load(CBYTE *fname)
{
	GetCurrentDirectory(_MAX_PATH, inifile);
	if (inifile[strlen(inifile) - 1] != '\\')	strcat(inifile, "\\");
	strcat(inifile, fname);

	TRACE("Full INI file pathname = %s\n", inifile);

	SLONG local = GetPrivateProfileInt("MuckyFoot", "local", 0, inifile);

	if (local)
	{
		strcpy(inifile, "c:\\fallen.ini");
		TRACE("Using local INI file %s\n", inifile);
	}
}

CBYTE* ENV_get_value_string(CBYTE* name, CBYTE* section)
{
	GetPrivateProfileString(section, name, "", strbuf, _MAX_PATH, inifile);
	TRACE("[%s] %s = \"%s\"\n", section, name, strbuf);
	return strbuf[0] ? strbuf : NULL;
}

SLONG ENV_get_value_number(CBYTE* name, SLONG def, CBYTE* section)
{
	SLONG val = GetPrivateProfileInt(section, name, def, inifile);
	TRACE("[%s] %s = %d\n", section, name, val);
	if (stricmp(section, "Secret"))	ENV_set_value_number(name, val, section);	// don't write out "psx" key
	return val;
}

void ENV_set_value_string(CBYTE* name, CBYTE* value, CBYTE* section)
{
	WritePrivateProfileString(section, name, value, inifile);
}

void ENV_set_value_number(CBYTE* name, SLONG value, CBYTE* section)
{
	sprintf(strbuf, "%d", value);
	WritePrivateProfileString(section, name, strbuf, inifile);
}

#else //#ifndef TARGET_DC

// OK, have a list of pre-made registry names, and enum them.
// Then store the values in memory, and we can save that chunk out.
// We ignore the "section" bit.

//#define NUM_ENV_NAMES 10

char *pchNameList[] =
{
	"joypad_mode",
	"joypad_kick",
	"joypad_punch",
	"joypad_jump",
	"joypad_action",
	"joypad_move",
	"joypad_start",
	"joypad_select",
	"joypad_camera",
	"joypad_cam_left",
	"joypad_cam_right",
	"joypad_1stperson",

	"scanner_follows",
	"draw_distance",

	"ambient_volume",
	"music_volume",
	"fx_volume",

	"detail_stars",
	"detail_shadows",
	"detail_moon_reflection",
	"detail_people_reflection",
	"detail_puddles",
	"detail_dirt",
	"detail_mist",
	"detail_rain",
	"detail_skyline",
	"detail_filter",
	"detail_perspective",
	"detail_crinkles",

	"cheat_driving_bronze",

	"analogue_pad_mode",

	"play_movie",

	"panel_x",
	"panel_y",

	//"Mode",
	//"BitDepth",

	"lang_num",

	// Is vibration on or off, and a sub-enable for engines.
	"vibration_mode",
	"vibration_engine",

// Only ever add to the end of this list - order is important.
// If you do add to this, also add to ENV_init below.

	"",
};

BYTE bEnvValue[ sizeof(pchNameList) / sizeof(pchNameList[0]) ];

// Feed it the start of the env save/load block, and
// it loads the block and returns a pointer to the end of the block.
char *ENV_load ( char *pcData )
{
	int iNumStrings = (int)*pcData++;

	for ( int iStringNum = 0; iStringNum < iNumStrings; iStringNum++ )
	{
		bEnvValue[iStringNum] = *pcData++;
	}

	return ( pcData );
}

// Call once with pcData = NULL, and it returns the number of
// bytes it needs to save the data. Call it again with a pointer
// to the start of this data, and it will actually fill in the data
// (and return the number of bytes again).
int ENV_save ( char *pcData )
{
	// First see how many env variables there are.
	int iNumStrings = 0;
	while ( TRUE )
	{
		if ( pchNameList[iNumStrings ][0] == '\0' )
		{
			break;
		}
		iNumStrings++;
	}

	if ( pcData != NULL )
	{
		// Now write it out.
		*pcData++ = (BYTE)iNumStrings;
		for ( int iStringNum = 0; iStringNum < iNumStrings; iStringNum++ )
		{
			*pcData++ = bEnvValue[iStringNum];
		}
	}

	// Remember the extra byte for the number of strings!
	return ( iNumStrings + 1 );
}

// Unique to DC.
void ENV_init ( void )
{
	// Set up standard environment stuff, i.e. before a game has been loaded.

	// Set up Standard dreamcast mapping.
	ENV_set_value_number("joypad_mode",			1, "Joypad");
	// And set up the default custom mode.
	ENV_set_value_number("joypad_kick",			DI_DC_BUTTON_LTRIGGER, "Joypad");
	ENV_set_value_number("joypad_punch",		DI_DC_BUTTON_RTRIGGER, "Joypad");
	ENV_set_value_number("joypad_jump",			DI_DC_BUTTON_Y, "Joypad");
	ENV_set_value_number("joypad_action",		DI_DC_BUTTON_A, "Joypad");
	ENV_set_value_number("joypad_move",			DI_DC_BUTTON_UP, "Joypad");
	ENV_set_value_number("joypad_start",		DI_DC_BUTTON_START, "Joypad");
	ENV_set_value_number("joypad_select",		DI_DC_BUTTON_B, "Joypad");
	ENV_set_value_number("joypad_camera",		DI_DC_BUTTON_DOWN, "Joypad");
	ENV_set_value_number("joypad_cam_left",		DI_DC_BUTTON_LEFT, "Joypad");
	ENV_set_value_number("joypad_cam_right",	DI_DC_BUTTON_RIGHT, "Joypad");
	ENV_set_value_number("joypad_1stperson",	DI_DC_BUTTON_X, "Joypad");

	// Other stuff.
	ENV_set_value_number ( "scanner_follows",			1, "" );
	ENV_set_value_number ( "draw_distance",				22, "" );

	ENV_set_value_number ( "ambient_volume",			127, "" );
	ENV_set_value_number ( "music_volume",				127, "" );
	ENV_set_value_number ( "fx_volume",					127, "" );

	ENV_set_value_number ( "detail_stars",				0, "" );
	ENV_set_value_number ( "detail_shadows",			1, "" );
	ENV_set_value_number ( "detail_moon_reflection",	0, "" );
	ENV_set_value_number ( "detail_people_reflection",	0, "" );
	ENV_set_value_number ( "detail_puddles",			0, "" );
	ENV_set_value_number ( "detail_dirt",				1, "" );
	ENV_set_value_number ( "detail_mist",				1, "" );
	ENV_set_value_number ( "detail_rain",				1, "" );
	ENV_set_value_number ( "detail_skyline",			1, "" );
	ENV_set_value_number ( "detail_filter",				1, "" );
	ENV_set_value_number ( "detail_perspective",		1, "" );
	ENV_set_value_number ( "detail_crinkles",			0, "" );

	// Is the Bronze Diriving cheat on?
	ENV_set_value_number ( "cheat_driving_bronze",		0, "" );

	// Analog mode. Actually not analogue/digital, but relative/absoloute mode.
	ENV_set_value_number ( "analogue_pad_mode",			0, "" );

	ENV_set_value_number ( "play_movie",				1, "" );

#ifdef DEBUG
	// Where the panel is on the screen. Numbers are divided by four to fit into a byte.
	// This is in the corner for debug, coz I keep forgetting to move it there when taking screenshots.
	ENV_set_value_number ( "panel_x",					0 / 4, "" );
	ENV_set_value_number ( "panel_y",					(480-0) / 4, "" );
#else
	// Where the panel is on the screen. Numbers are divided by four to fit into a byte.
	ENV_set_value_number ( "panel_x",					32 / 4, "" );
	ENV_set_value_number ( "panel_y",					(480-32) / 4, "" );
#endif

#ifdef VERSION_FRENCH
	// Set the default, just to test.
	// Language number. 0 = English. 1 = French.
	ENV_set_value_number ( "lang_num",					1, "" );
#else
	// Get it from the firmware (boot rom setting).
	BYTE bLang = FirmwareGetLanguageCode();
	if ( bLang == LANGUAGE_FRENCH )
	{
		// Use French.
		ENV_set_value_number ( "lang_num", 1, "" );
	}
	else
	{
		// Everyone else gets English by default.
		ENV_set_value_number ( "lang_num", 0, "" );
	}
#endif

	// Now is as good a time as any to check for English/American
	BYTE bCountry = FirmwareGetCountryCode();
	if ( bCountry == COUNTRY_AMERICA )
	{
		// Then Yanks have VMUs.
		bWriteVMInsteadOfVMU = FALSE;
	}
	else
	{
		// Everyone else has VMs.
		bWriteVMInsteadOfVMU = TRUE;
	}

	ENV_set_value_number ( "vibration_mode",				1, "" );
	ENV_set_value_number ( "vibration_engine",				1, "" );

	//ENV_set_value_number ( "Mode",						0, "" );
	//ENV_set_value_number ( "BitDepth",					0, "" );
}

// Fudged.
CBYTE* ENV_get_value_string(CBYTE* name, CBYTE* section)
{
	// Only one string, the language. This is kludged for the XLAT system,
	// most things should take language settings from "lang_num".

	ASSERT ( strcmp ( name, "language" ) == 0 );

	switch ( ENV_get_value_number ( "lang_num", 0, "" ) )
	{
	case 0:
		// English.
		return ( "text\\lang_english.txt" );
		break;
	case 1:
		// French.
		return ( "text\\lang_french.txt" );
		break;
	default:
		ASSERT ( FALSE );
		return ( "text\\lang_english.txt" );
		break;
	}
}

SLONG ENV_get_value_number(CBYTE* name, SLONG def, CBYTE* section)
{
	int iStringNum = 0;
	while ( TRUE )
	{
		if ( pchNameList[iStringNum][0] == '\0' )
		{
			// Reached the end of the list. Oops.
			ASSERT ( FALSE );
			return ( def );
			break;
		}
		if ( 0 == stricmp ( pchNameList[iStringNum], name ) )
		{
			return ( bEnvValue[iStringNum] );
		}
		iStringNum++;
	}
	ASSERT ( FALSE );
	return ( def );
}

// Unused.
void ENV_set_value_string(CBYTE* name, CBYTE* value, CBYTE* section)
{
	ASSERT ( FALSE );
}

void ENV_set_value_number(CBYTE* name, SLONG value, CBYTE* section)
{
	int iStringNum = 0;
	// MUST be a byte value.
	ASSERT ( ( value >= 0 ) && ( value <= 255 ) );
	while ( TRUE )
	{
		if ( pchNameList[iStringNum][0] == '\0' )
		{
			// Reached the end of the list. Oops.
			ASSERT ( FALSE );
			return;
		}
		if ( 0 == stricmp ( pchNameList[iStringNum], name ) )
		{
			bEnvValue[iStringNum] = value;
			return;
		}
		iStringNum++;
	}
	ASSERT ( FALSE );
}

#endif //#else //#ifndef TARGET_DC


text:
class CreateDocuments < ActiveRecord::Migration
  def self.up
    create_table :documents do |t|
      t.string :name
      t.text :description
      t.string :data_file_name
      t.string :data_content_type
      t.integer :data_file_size
      t.datetime :data_updated_at
      t.integer :user_id

      t.timestamps
    end
  end

  def self.down
    drop_table :documents
  end
end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <link rel="stylesheet" href="bootstrap.min.css">
        <link rel="stylesheet" href="base.css">

Fines as a % of budget


text:
<?php

declare(strict_types=1);

namespace Humbug\PhpScoper\PhpParser\Node;

use PhpParser\Node\Arg;
use PhpParser\Node\Expr\ConstFetch;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Scalar\String_;

final class ClassAliasFuncCall extends FuncCall
{
    public function __construct(FullyQualified $prefixedName, FullyQualified $originalName, array $attributes = [])
    {
        parent::__construct(
            new FullyQualified('class_alias'),
            [
                new Arg(
                    new String_((string) $prefixedName),
                ),
                new Arg(
                    new String_((string) $originalName),
                ),
                new Arg(
                    new ConstFetch(
                        new FullyQualified('false'),
                    ),
                ),
            ],
            $attributes,
        );
    }
}


text:
package consulo.ide.plugins;

import com.intellij.ide.BrowserUtil;
import com.intellij.ide.DataManager;
import com.intellij.ide.plugins.PluginHeaderPanel;
import com.intellij.ide.plugins.PluginManagerColumnInfo;
import com.intellij.ide.plugins.PluginManagerMain;
import com.intellij.ide.plugins.PluginNode;
import com.intellij.ide.ui.search.SearchUtil;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.options.ex.Settings;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.util.ui.JBHtmlEditorKit;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import com.intellij.xml.util.XmlStringUtil;
import consulo.container.plugin.*;
import consulo.desktop.util.awt.MorphColor;
import consulo.util.collection.ArrayUtil;
import consulo.util.collection.ContainerUtil;
import consulo.util.lang.StringUtil;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLFrameHyperlinkEvent;
import java.awt.*;
import java.net.URL;
import java.util.List;
import java.util.*;

import static consulo.util.lang.StringUtil.isEmptyOrSpaces;

/**
 * @author VISTALL
 * @since 08/11/2021
 */
public class PluginDescriptionPanel {
  // repository not support rating. disable stars for now
  public static final boolean ENABLED_STARS = false;

  private static class MyHyperlinkListener implements HyperlinkListener {
    @Override
    public void hyperlinkUpdate(HyperlinkEvent e) {
      if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        JEditorPane pane = (JEditorPane)e.getSource();
        if (e instanceof HTMLFrameHyperlinkEvent) {
          HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e;
          HTMLDocument doc = (HTMLDocument)pane.getDocument();
          doc.processHTMLFrameHyperlinkEvent(evt);
        }
        else {
          String description = e.getDescription();
          if (description.startsWith(PLUGIN_PREFIX)) {
            String pluginId = description.substring(PLUGIN_PREFIX.length(), description.length());
            select(pane, PluginId.getId(pluginId));
            return;
          }

          URL url = e.getURL();
          if (url != null) {
            BrowserUtil.browse(url);
          }
        }
      }
    }

    private void select(JEditorPane pane, PluginId pluginId) {
      DataContext dataContext = DataManager.getInstance().getDataContext(pane);

      Settings data = dataContext.getData(Settings.KEY);
      if (data == null) {
        return;
      }

      data.select(PluginsConfigurable.class).doWhenDone((pluginConfigurable) -> pluginConfigurable.select(pluginId));
    }
  }

  private static final String PLUGIN_PREFIX = "plugin://";
  private static final String TEXT_SUFFIX = "";
  private static final String HTML_PREFIX = "<a href=\"";
  private static final String HTML_SUFFIX = "";

  private final PluginHeaderPanel myPluginHeaderPanel;
  private final JEditorPane myDescriptionTextArea;

  private final JPanel myPanel;

  public PluginDescriptionPanel() {
    myPanel = new JPanel(new BorderLayout());
    myPanel.setBackground(MorphColor.of(UIUtil::getTextFieldBackground));

    myPluginHeaderPanel = new PluginHeaderPanel();
    myPluginHeaderPanel.getPanel().setOpaque(false);
    myPluginHeaderPanel.getPanel().setBorder(JBUI.Borders.empty(5, 5, 0, 5));

    myPanel.add(myPluginHeaderPanel.getPanel(), BorderLayout.NORTH);

    myDescriptionTextArea = new JEditorPane("text/html", "");
    myDescriptionTextArea.setEditorKit(JBHtmlEditorKit.create());
    myDescriptionTextArea.setEditable(false);
    myDescriptionTextArea.addHyperlinkListener(new MyHyperlinkListener());
    myDescriptionTextArea.setOpaque(false);

    myPanel.add(ScrollPaneFactory.createScrollPane(myDescriptionTextArea, true), BorderLayout.CENTER);
  }

  public void update(@Nullable PluginDescriptor plugin, @Nullable PluginManagerMain manager, @Nonnull List<PluginDescriptor> allPlugins, @Nullable String filter) {
    if (plugin == null) {
      setTextValue(null, filter, myDescriptionTextArea);
      myPluginHeaderPanel.getPanel().setVisible(false);
      return;
    }

    StringBuilder sb = new StringBuilder();
    myPluginHeaderPanel.update(plugin, manager);

    sb.append("
Version:
").append("  ").append(StringUtil.notNullize(plugin.getVersion(), "N/A"));

    if (PluginIds.isPlatformPlugin(plugin.getPluginId())) {
      setTextValue(sb, filter, myDescriptionTextArea);
      return;
    }

    sb.append("
Permissions:
");
    boolean noPermissions = true;
    for (PluginPermissionType type : PluginPermissionType.values()) {
      PluginPermissionDescriptor pluginPermissionDescriptor = plugin.getPermissionDescriptor(type);
      if (pluginPermissionDescriptor != null) {
        noPermissions = false;

        sb.append("  ").append(type.name()).append("
");
      }
    }

    if (noPermissions) {
      sb.append("  ").append(XmlStringUtil.escapeString("<no special permissions>")).append("
");
    }

    sb.append("
");

    String description = plugin.getDescription();
    if (!isEmptyOrSpaces(description)) {
      sb.append(description);
    }
    else {
      sb.append("").append(XmlStringUtil.escapeString("<description not provided>")).append("");
    }

    String changeNotes = plugin.getChangeNotes();
    if (!isEmptyOrSpaces(changeNotes)) {
      sb.append("
Change Notes
");
      sb.append(changeNotes);
    }

    String vendor = plugin.getVendor();
    String vendorEmail = plugin.getVendorEmail();
    String vendorUrl = plugin.getVendorUrl();
    if (!isEmptyOrSpaces(vendor) || !isEmptyOrSpaces(vendorEmail) || !isEmptyOrSpaces(vendorUrl)) {
      sb.append("
Vendor
");

      if (!isEmptyOrSpaces(vendor)) {
        sb.append("  ").append(vendor);
      }
      if (!isEmptyOrSpaces(vendorEmail)) {
        sb.append(" ").append(HTML_PREFIX).append("mailto:").append(vendorEmail).append("\">").append(vendorEmail).append(HTML_SUFFIX);
      }
      if (!isEmptyOrSpaces(vendorUrl)) {
        sb.append(" ").append(composeHref(vendorUrl));
      }
    }

    String pluginDescriptorUrl = plugin.getUrl();
    if (!isEmptyOrSpaces(pluginDescriptorUrl)) {
      sb.append("
Plugin homepage
").append(composeHref(pluginDescriptorUrl));
    }

    String size = plugin instanceof PluginNode ? ((PluginNode)plugin).getSize() : null;
    if (!isEmptyOrSpaces(size)) {
      sb.append("
Size
").append(PluginManagerColumnInfo.getFormattedSize(size));
    }

    Map<PluginDescriptor, Boolean> depends = new LinkedHashMap<>();
    for (PluginId pluginId : plugin.getDependentPluginIds()) {
      if (PluginIds.isPlatformPlugin(pluginId)) {
        continue;
      }

      PluginDescriptor temp = findPlugin(allPlugins, pluginId);
      if (temp != null) depends.put(temp, Boolean.FALSE);
    }

    for (PluginId pluginId : plugin.getOptionalDependentPluginIds()) {
      if (PluginIds.isPlatformPlugin(pluginId)) {
        continue;
      }
      PluginDescriptor temp = findPlugin(allPlugins, pluginId);
      if (temp != null) depends.put(temp, Boolean.TRUE);
    }

    if (!depends.isEmpty()) {
      sb.append("
Depends on plugins:
");

      for (Map.Entry<PluginDescriptor, Boolean> entry : depends.entrySet()) {
        PluginDescriptor key = entry.getKey();
        Boolean optional = entry.getValue();

        sb.append("  ");
        sb.append("").append(key.getName());
        if (optional) {
          sb.append(" (optional)");
        }
        sb.append("");

        sb.append("
");
      }
    }

    Map<PluginId, PluginDescriptor> dependentPlugins = new TreeMap<>();
    for (PluginDescriptor descriptor : allPlugins) {
      if (ArrayUtil.contains(plugin.getPluginId(), descriptor.getDependentPluginIds())) {
        dependentPlugins.put(descriptor.getPluginId(), descriptor);
      }

      if (ArrayUtil.contains(plugin.getPluginId(), descriptor.getOptionalDependentPluginIds())) {
        dependentPlugins.put(descriptor.getPluginId(), descriptor);
      }
    }

    if (!dependentPlugins.isEmpty()) {
      sb.append("
Dependent plugins:
");

      for (PluginDescriptor pluginDescriptor : dependentPlugins.values()) {
        sb.append("  ");
        sb.append("").append(pluginDescriptor.getName());
        sb.append("");
        sb.append("
");
      }
    }

    Set<String> tags = plugin.getTags();
    if (!tags.isEmpty()) {
      sb.append("
Tags:
");
      for (String tag : tags) {
        sb.append("  ").append(PluginManagerMain.getTagLocalizeValue(tag).get()).append("
");
      }
    }

    setTextValue(sb, filter, myDescriptionTextArea);
  }

  @Nullable
  private static PluginDescriptor findPlugin(@Nonnull List<PluginDescriptor> allPlugins, @Nonnull PluginId pluginId) {
    return ContainerUtil.find(allPlugins, it -> it.getPluginId() == pluginId);
  }

  private static void setTextValue(@Nullable StringBuilder text, @Nullable String filter, JEditorPane pane) {
    if (text != null) {
      text.insert(0, getTextPrefix());
      text.append(TEXT_SUFFIX);
      pane.setText(SearchUtil.markup(text.toString(), filter).trim());
      pane.setCaretPosition(0);
    }
    else {
      pane.setText(getTextPrefix() + TEXT_SUFFIX);
    }
  }

  private static String composeHref(String vendorUrl) {
    return HTML_PREFIX + vendorUrl + "\">" + vendorUrl + HTML_SUFFIX;
  }

  private static String getTextPrefix() {
    String string = "\n" +
                    "    \n" +
                    "";
    int font = JBUI.scale(12);
    int margin5 = JBUI.scale(5);
    int margin2 = JBUI.scale(2);
    return String.format(string, font, margin2, 0, font, 0, margin5);
  }

  @Nonnull
  public JPanel getPanel() {
    return myPanel;
  }
}


text:
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { EventsService } from './events.service'

@Component({
  selector: 'kypo-menu',
  templateUrl: './menu.component.html',
  styleUrls: ['./menu.component.css']
})

export class MenuComponent {

    games = [];
    gamesOfSelectedPlayer = [];
    @Output() selectDataset = new EventEmitter();
    @Input() selectedPlayer;

    constructor(private eventsService:EventsService) {}

    ngOnInit() {
        this.eventsService.getGames().subscribe(games => {
            // console.log(games);
            this.games = games;
        });
    }

    onClick(game) {
        // console.log(game);
        this.selectDataset.emit(game);
    }

    ngOnChanges() {
        this.eventsService.getGamesOfPlayer(this.selectedPlayer).subscribe(games => {
            console.log(games);
            this.gamesOfSelectedPlayer = games;
        });
    }
}


text:
"""
    Nordigen Account Information Services API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 2.0 (v2)

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import unittest

import nordigen
from nordigen.models.account_v2_status_enum import AccountV2StatusEnum  # noqa: E501
from nordigen.rest import ApiException

class TestAccountV2StatusEnum(unittest.TestCase):
    """AccountV2StatusEnum unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def testAccountV2StatusEnum(self):
        """Test AccountV2StatusEnum"""
        # FIXME: construct object with mandatory attributes with example values
        # model = nordigen.models.account_v2_status_enum.AccountV2StatusEnum()  # noqa: E501
        pass

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


text: Path All The Executables


text:
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e696a4f2fc9c47f98c7f4e19baddde7c)](https://www.codacy.com/app/shane.a.husson/sgc?utm_source=github.com&utm_medium=referral&utm_content=shusson/sgc&utm_campaign=badger)

## SYDNEY GENOMICS COLLABORATIVE

A web application for exploring population scale genomic studies.

More info: https://sgc.garvan.org.au

### Development
Built with latest [angular](https://github.com/angular/angular).

We use [angular-cli](https://github.com/angular/angular-cli) for
development. It handles scaffolding, configuration, development hosting
and more.

#### Prerequisites

 - Node 6.9.0 or higher
 - NPM 3 or higher.

#### Simple Setup

```bash
npm install -g @angular/cli
npm install
ng serve
```

#### Structure
The general structure is scaffolded by angular-cli.

The app src code structure:

```
  -- app
     -- components
        -- pages     // a component that can be directly navigated to by the router
        -- parts     // all the components that make up the pages
     -- mocks        // simple mocks for tests
     -- model        // classes that encapsulate the domain
     -- services     // injectable services that facilitate communication between components
     -- shared       // some shared code
     -- assets       // all the assets for the website (copied to dist on build)
     -- environments // the different environents for build targets
```

### Testing

#### unit tests

To run tests
```bash
ng test
```

#### e2e tests

There are a minimum set of functional tests that check that critical
features work

To run tests
```bash
ng e2e
```

### External services
The application connects to a number of external services,
all of which are defined in [src/environments](src/environments).

#### VSAL
A minimum [variantstore](https://github.com/shusson/variantstore) backed by MySQL

#### [Elastic Gene Search](https://github.com/shusson/genesearch)
A service for searching for gene information.

#### [Ensembl Rest API](http://rest.ensembl.org/)
Used for genomic reference information.

#### [BeaconNetwork](https://beacon-network.org/)
Used for querying variants across different datasets and organizations.

#### [Auth0](https://auth0.com/)
Our identity service. Provides identity and authentication.

#### [Sentry](https://sentry.io/)
Tracks any unhandled errors

#### [MapD-API](https://github.com/shusson/mapd-api)
A variant store backed by an in-memory GPU Database [MapD](https://github.com/mapd/mapd-core) that supports cross dimensional charts.

### Deployment

Travis handles our build, testing and deployment.

We have a CI pipeline set up that hosts on firebase.
See [.travis.yml](.travis.yml) and [deploy](deploy) for more info.

The final production build which is hosted at https://sgc.garvan.org.au
is still manually deployed.

### Acknowledgements
Special thanks to [Miguel Pignatelli](https://github.com/emepyc)
for his help with the [tnt genome browser](https://github.com/tntvis/tnt.genome).


text:
package net.bolbat.utils.reflect.proxy;

import static net.bolbat.utils.lang.Validations.checkArgument;

import java.lang.reflect.InvocationHandler;

/**
 * Abstract advised {@link InvocationHandler} implementation.
 *
 * @author Alexandr Bolbat
 */
public abstract class AdvisedHandler implements Advised, InvocationHandler {

	/**
	 * Proxied target.
	 */
	private final Object target;

	/**
	 * Proxied interfaces.
	 */
	private final Class<?>[] interfaces;

	/**
	 * Default constructor.
	 *
	 * @param aTarget
	 *            proxied target
	 * @param aInterfaces
	 *            proxied interfaces
	 */
	protected AdvisedHandler(final Object aTarget, final Class<?>[] aInterfaces) {
		checkArgument(aTarget != null, "aTarget argument is null");
		checkArgument(aInterfaces != null && aInterfaces.length > 0, "interfaces argument is empty");

		this.target = aTarget;
		this.interfaces = aInterfaces.clone();
	}

	@Override
	public Object getProxiedTarget() {
		return target;
	}

	@Override
	public Class<?>[] getProxiedInterfaces() {
		return interfaces.clone();
	}

}


text:
<?php

require_once("../src/snapchat.php");

//////////// CONFIG ////////////
$username = ""; // Your snapchat username
$password = ""; // Your snapchat password
$gEmail   = ""; // Gmail account
$gPasswd  = ""; // Gmail account password
$debug = false; // Set this to true if you want to see all outgoing requests and responses from server
////////////////////////////////

$imagePath = ""; // URL or local path to a media file (image or video)
$sendTo = array();

$snapchat = new Snapchat($username, $gEmail, $gPasswd, $debug);

//Login to Snapchat with your username and password
$snapchat->login($password);

// Get your friends in an array
$friends = $snapchat->getFriends();

echo "My friends: ";
print_r($friends);

// Send snap adding text to your image and 10 seconds
$snapchat->send($imagePath, $sendTo, "this is a test :D", 10);

// Set a story
// $snapchat->setStory($imagePath);

// Set a story adding text to the image and 5 seconds
$snapchat->setStory($imagePath, 5, "This is my story");

// Get snaps data (Without storing them)
//$snapchat->getSnaps();

// Automatically downloads Snaps and store it in 'Snaps' folder
$snapchat->getSnaps(true);

// Download stories for a specific username
$snapchat->getStoriesByUsername("homie", true);

// Send chat message to "username"
$snapchat->sendMessage("username", "hello from Snap-API!");

$snapchat->closeAppEvent();

?>


text:
package org.gradle.api.tasks.diagnostics.internal.graph.nodes;

import com.google.common.base.Joiner;
import com.google.common.collect.Sets;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.artifacts.DependencySet;
import org.gradle.api.artifacts.ProjectDependency;

import java.util.Collections;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class UnresolvableConfigurationResult extends AbstractRenderableDependency {

    public static UnresolvableConfigurationResult of(Configuration configuration) {
        return new UnresolvableConfigurationResult(
            configuration.getClass().getName() + configuration.hashCode(),
            configuration.getName(),
            unresolvableChildren(configuration)
        );
    }

    private static Set<? extends RenderableDependency> unresolvableChildren(Configuration configuration) {
        final DependencySet dependencies = configuration.getDependencies();
        if (dependencies.isEmpty()) {
            return Collections.emptySet();
        }
        Set<UnresolvableRenderableDependency> children = Sets.newLinkedHashSet();
        for (final Dependency dependency : dependencies) {
            children.add(new UnresolvableRenderableDependency(
                dependency.getClass().getName() + dependency.hashCode(),
                (dependency instanceof ProjectDependency)
                    ? projectDependencyLabel((ProjectDependency) dependency)
                    : moduleDependencyLabel(dependency)
            ));
        }
        return children;
    }

    private static String projectDependencyLabel(ProjectDependency dependency) {
        return "project " + dependency.getName();
    }

    private static String moduleDependencyLabel(Dependency dependency) {
        return Joiner.on(":").join(
            Stream.of(dependency.getGroup(), dependency.getName(), dependency.getVersion())
                .filter(Objects::nonNull)
                .collect(Collectors.toList())
        );
    }

    private final Object id;
    private final String name;
    private final Set<? extends RenderableDependency> children;

    private UnresolvableConfigurationResult(
        Object id,
        String name,
        Set<? extends RenderableDependency> children
    ) {
        this.id = id;
        this.name = name;
        this.children = children;
    }

    @Override
    public Object getId() {
        return id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public ResolutionState getResolutionState() {
        return ResolutionState.UNRESOLVED;
    }

    @Override
    public Set<? extends RenderableDependency> getChildren() {
        return children;
    }

    private static final class UnresolvableRenderableDependency extends AbstractRenderableDependency {

        private final Object id;
        private final String name;

        public UnresolvableRenderableDependency(Object id, String name) {
            this.id = id;
            this.name = name;
        }

        @Override
        public Object getId() {
            return id;
        }

        @Override
        public String getName() {
            return name;
        }
    }
}


text:
import QueryBuilder from "./builder";
import { JoinType, Operator, QueryBoolean } from "./types";

/**
 * Represents a QueryBuilder for a nested join clause.
 * We essentially abuse QueryBuilder's WHERE building since it works
 * exactly the same as the ON clause of a join.
 */
export default class JoinClause extends QueryBuilder<any> {
    public type: JoinType;
    public joiningOn: string;

    constructor(type: JoinType, joiningOn: string) {
        super();

        this.table = joiningOn;
        this.type = type;
        this.joiningOn = joiningOn;
    }

    /**
     * Creates a new nested ON clause. The specified callback receives a nested
     * query builder that can be used to build the nested queries.
     */
    public on(method: (builder: this) => any): this;

    /**
     * Adds a new ON clause for the specified column, operator and value. Optionally
     * you can provide a QueryBoolean of "OR" instead of "AND", but it is recommended that
     * you use `orOn` instead.
     */
    public on(first: string, operator: Operator, second: string, boolean?: QueryBoolean): this;

    public on(firstOrMethod: string | ((builder: this) => any), operator?: Operator, second?: string, boolean: QueryBoolean = "AND") {
        if (typeof firstOrMethod === "function") {
            return this.whereNested(firstOrMethod, boolean);
        }

        return this.whereColumn(firstOrMethod, operator!, second!, boolean);
    }

    /**
     * Creates a new nested OR ON clause. The specified callback receives a nested
     * query builder that can be used to build the nested queries.
     */
    public orOn(method: () => any): this;

    /**
     * Adds a new OR ON clause for the specified column, operator and value.
     */
    public orOn(first: string, operator: Operator, second: string): this;

    public orOn(firstOrMethod: string | (() => any), operator?: Operator, second?: string) {
        return (<any>this.on)(firstOrMethod, operator, second, "OR");
    }

    protected createNew(): this {
        return <this>new JoinClause(this.type, this.joiningOn);
    }
}


text:
<?php

defined('_JEXEC') or die;

// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_redirect')) {
	return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}

$controller	= JControllerLegacy::getInstance('Redirect');
$controller->execute(JRequest::getCmd('task'));
$controller->redirect();


text:
using System;

namespace Avalonia.Animation
{
    /// <summary>
    /// Returns a linear <see cref="IEasing"/> for the specified type.
    /// </summary>
    /// <remarks>
    /// Unfortunately this class is needed as there's no way to create a true generic easing
    /// function at compile time, as mathematical operators don't have an interface.
    /// </remarks>
    public static class LinearEasing
    {
        /// <summary>
        /// A linear easing function for the specified type.
        /// </summary>
        /// <typeparam name="T">The type.</typeparam>
        /// <returns>An easing function.</returns>
        public static IEasing<T> For<T>()
        {
            if (typeof(T) == typeof(double))
            {
                return (IEasing<T>)new LinearDoubleEasing();
            }
            else
            {
                throw new NotSupportedException(
                    $"Don't know how to create a LinearEasing for type '{typeof(T).FullName}'.");
            }
        }
    }
}


text:
NSString * const A0KeyUploaderErrorDomain = @"com.auth0.touchid.uploader";

@interface A0KeyUploader ()
@property (copy, nonatomic) NSString *authorization;
@property (strong, nonatomic) NSURL *domainURL;
@property (copy, nonatomic) NSString *token;
@property (copy, nonatomic) NSString *clientId;
@end

@implementation A0KeyUploader

- (instancetype)initWithDomainURL:(NSURL *)domainURL clientId:(NSString *)clientId authorization:(NSString *)authorization {
    self = [super init];
    if (self) {
        _authorization = [NSString stringWithFormat:@"Basic %@", authorization];
        _domainURL = domainURL;
        _clientId = clientId;
    }
    return self;
}

- (void)uploadKey:(NSData *)key forUser:(NSString *)user callback:(A0KeyUploaderCallback)callback {
    NSString *path = @"/api/v2/device-credentials";
    NSURL *domainURL = self.domainURL;
    NSURL *url = [NSURL URLWithString:path relativeToURL:domainURL];
    NSString *name = [self deviceName];
    NSString *deviceIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
    NSString *keyBase64 = [key base64EncodedStringWithOptions:0];

    void(^registerKey)() = ^{
        A0LogDebug(@"Uploading key %@ for user %@", keyBase64, user);
        [self performRequestWithMethod:@"POST"
                                   url:url
                               payload:@{
                                         @"value": keyBase64,
                                         @"device_name": name,
                                         @"device_id": deviceIdentifier,
                                         @"type": @"public_key",
                                         @"client_id": self.clientId,
                                         }
                              callback:^(NSError * _Nullable error, id payload) {
                                  NSDictionary *key = payload;
                                  callback(error, key[@"id"]);
                              }];
    };

    NSString *(^filterKey)(NSArray *) = ^(NSArray *keys) {
        NSString *keyIdentifier = nil;
        for (NSDictionary *key in keys) {
            if ([key[@"device_name"] isEqualToString:name]) {
                keyIdentifier = key[@"id"];
                break;
            }
            if ([key[@"device_id"] isEqualToString:deviceIdentifier]) {
                keyIdentifier = key[@"id"];
                break;
            }
        }
        return keyIdentifier;
    };

    void(^removeKey)(NSString *, void(^)(NSError *)) = ^(NSString *keyIdentifier, void(^callback)(NSError *)) {
        NSString *deletePath = [[path stringByAppendingPathComponent:keyIdentifier] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLPathAllowedCharacterSet]];
        NSURL *deleteURL = [NSURL URLWithString:deletePath relativeToURL:domainURL];
        A0LogDebug(@"Removing old key with identifier %@", keyIdentifier);
        [self performRequestWithMethod:@"DELETE"
                                   url:deleteURL
                               payload:nil
                              callback:^(NSError * _Nullable error, id none) {
                                  callback(error);
                              }];
    };

    [self performRequestWithMethod:@"GET"
                               url:url
                           payload:@{
                                     @"client_id": self.clientId,
                                     @"type": @"public_key",
                                     @"user_id": user,
                                     }
                          callback:^(NSError * _Nullable error, id payload) {
                              if (error) {
                                  callback([self errorFromCause:error], nil);
                                  return;
                              }
                              NSString *keyIdentifier = filterKey(payload);
                              if (!keyIdentifier) {
                                  registerKey();
                                  return;
                              }

                              removeKey(keyIdentifier, ^(NSError * _Nullable error) {
                                  registerKey();
                              });
                          }];
}

- (void)performRequestWithMethod:(NSString *)method url:(NSURL *)url payload:(NSDictionary *)payload callback:(nonnull void (^)(NSError * _Nullable, id _Nullable))callback {
    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
    AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
    NSError *error;
    NSURLRequest *request = [self requestWithMethod:method
                                                url:url
                                            payload:payload
                                              error:&error];

    if (error) {
        callback([self errorFromCause:error], nil);
        return;
    }

    NSURLSessionTask *task = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
        if (error) {
            callback([self errorFromCause:error], nil);
        } else {
            callback(nil, responseObject);
        }
    }];
    [task resume];
}

- (NSURLRequest *)requestWithMethod:(NSString *)method url:(NSURL *)url payload:(NSDictionary *)payload error:(NSError **)error {
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
    request.HTTPMethod = method;
    [request addValue:self.authorization forHTTPHeaderField:@"Authorization"];
    return [[AFJSONRequestSerializer serializer] requestBySerializingRequest:request
                                                              withParameters:payload
                                                                       error:error];
}

- (NSError *)errorFromCause:(NSError *)cause {
    if (!cause) {
        return nil;
    }

    NSHTTPURLResponse *response = cause.userInfo[@"com.alamofire.serialization.response.error.response"];
    return [NSError errorWithDomain:A0KeyUploaderErrorDomain
                               code:[response statusCode] == 401 ? A0KeyUploaderErrorCodeUnauthorized : A0KeyUploaderErrorCodeFailed
                           userInfo:@{
                                      @"com.auth0.touchid.uploader.cause": cause,
                                      NSLocalizedDescriptionKey: A0LocalizedString(@"Failed to register device for TouchID. Please try again later.")
                                      }];
}

- (NSString *)deviceName {
    NSString *deviceName = [[UIDevice currentDevice] name];
    NSCharacterSet *setToFilter = [[NSCharacterSet alphanumericCharacterSet] invertedSet];
    deviceName = [[deviceName componentsSeparatedByCharactersInSet:setToFilter] componentsJoinedByString:@""];
    return deviceName;
}

+ (NSString *)authorizationWithUsername:(NSString *)username password:(NSString *)password connectionName:(NSString *)connectionName {
    NSString *token = [NSString stringWithFormat:@"%@\\%@:%@", connectionName, username, password];
    NSString *base64 = [[token dataUsingEncoding:NSUTF8StringEncoding] base64EncodedStringWithOptions:0];
    base64 = [base64 stringByReplacingOccurrencesOfString:@"=" withString:@""];
    base64 = [base64 stringByReplacingOccurrencesOfString:@"/" withString:@"_"];
    base64 = [base64 stringByReplacingOccurrencesOfString:@"+" withString:@"-"];
    return base64;
}
@end


text:
package vspk

import "github.com/nuagenetworks/go-bambou/bambou"

// DUCGroupIdentity represents the Identity of the object
var DUCGroupIdentity = bambou.Identity{
	Name:     "ducgroup",
	Category: "ducgroups",
}

// DUCGroupsList represents a list of DUCGroups
type DUCGroupsList []*DUCGroup

// DUCGroupsAncestor is the interface that an ancestor of a DUCGroup must implement.
// An Ancestor is defined as an entity that has DUCGroup as a descendant.
// An Ancestor can get a list of its child DUCGroups, but not necessarily create one.
type DUCGroupsAncestor interface {
	DUCGroups(*bambou.FetchingInfo) (DUCGroupsList, *bambou.Error)
}

// DUCGroupsParent is the interface that a parent of a DUCGroup must implement.
// A Parent is defined as an entity that has DUCGroup as a child.
// A Parent is an Ancestor which can create a DUCGroup.
type DUCGroupsParent interface {
	DUCGroupsAncestor
	CreateDUCGroup(*DUCGroup) *bambou.Error
}

// DUCGroup represents the model of a ducgroup
type DUCGroup struct {
	ID                             string        `json:"ID,omitempty"`
	ParentID                       string        `json:"parentID,omitempty"`
	ParentType                     string        `json:"parentType,omitempty"`
	Owner                          string        `json:"owner,omitempty"`
	Name                           string        `json:"name,omitempty"`
	Description                    string        `json:"description,omitempty"`
	AssociatedDUCs                 []interface{} `json:"associatedDUCs,omitempty"`
	AssociatedPerformanceMonitorID string        `json:"associatedPerformanceMonitorID,omitempty"`
}

// NewDUCGroup returns a new *DUCGroup
func NewDUCGroup() *DUCGroup {

	return &DUCGroup{}
}

// Identity returns the Identity of the object.
func (o *DUCGroup) Identity() bambou.Identity {

	return DUCGroupIdentity
}

// Identifier returns the value of the object's unique identifier.
func (o *DUCGroup) Identifier() string {

	return o.ID
}

// SetIdentifier sets the value of the object's unique identifier.
func (o *DUCGroup) SetIdentifier(ID string) {

	o.ID = ID
}

// Fetch retrieves the DUCGroup from the server
func (o *DUCGroup) Fetch() *bambou.Error {

	return bambou.CurrentSession().FetchEntity(o)
}

// Save saves the DUCGroup into the server
func (o *DUCGroup) Save() *bambou.Error {

	return bambou.CurrentSession().SaveEntity(o)
}

// Delete deletes the DUCGroup from the server
func (o *DUCGroup) Delete() *bambou.Error {

	return bambou.CurrentSession().DeleteEntity(o)
}

// NSGateways retrieves the list of child NSGateways of the DUCGroup
func (o *DUCGroup) NSGateways(info *bambou.FetchingInfo) (NSGatewaysList, *bambou.Error) {

	var list NSGatewaysList
	err := bambou.CurrentSession().FetchChildren(o, NSGatewayIdentity, &list, info)
	return list, err
}

// AssignNSGateways assigns the list of NSGateways to the DUCGroup
func (o *DUCGroup) AssignNSGateways(children NSGatewaysList) *bambou.Error {

	list := []bambou.Identifiable{}
	for _, c := range children {
		list = append(list, c)
	}

	return bambou.CurrentSession().AssignChildren(o, list, NSGatewayIdentity)
}


text:
===========================
 kombu.transport.zookeeper
===========================

.. currentmodule:: kombu.transport.zookeeper

.. automodule:: kombu.transport.zookeeper

    .. contents::
        :local:

    Transport
    ---------

    .. autoclass:: Transport
        :members:
        :undoc-members:

    Channel
    -------

    .. autoclass:: Channel
        :members:
        :undoc-members: