text:
'use strict';
goog.provide('functional.gles3.es3fFloatStateQueryTests');
goog.require('framework.common.tcuTestCase');
goog.require('framework.delibs.debase.deMath');
goog.require('framework.delibs.debase.deRandom');
goog.require('functional.gles3.es3fApiCase');
goog.require('modules.shared.glsStateQuery');

goog.scope(function() {
	var es3fFloatStateQueryTests = functional.gles3.es3fFloatStateQueryTests;
    var tcuTestCase = framework.common.tcuTestCase;
	var deRandom = framework.delibs.debase.deRandom;
	var deMath = framework.delibs.debase.deMath;
	var es3fApiCase = functional.gles3.es3fApiCase;
	var glsStateQuery = modules.shared.glsStateQuery;

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.DepthRangeCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.DepthRangeCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.DepthRangeCase.prototype.constructor = es3fFloatStateQueryTests.DepthRangeCase;

	es3fFloatStateQueryTests.DepthRangeCase.prototype.test = function() {
		/** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);

		this.check(glsStateQuery.verify(gl.DEPTH_RANGE, new Float32Array([0.0, 1.0])));

		/** @type {Array<Float32Array>} */ var fixedTests = [
			new Float32Array([0.5, 1.0]),
			new Float32Array([0.0, 0.5]),
			new Float32Array([0.0, 0.0]),
			new Float32Array([1.0, 1.0])
		];

		for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
			gl.depthRange(fixedTests[ndx][0], fixedTests[ndx][1]);
			this.check(glsStateQuery.verify(gl.DEPTH_RANGE, fixedTests[ndx]));
		}

		/** @type {number} */ var numIterations = 120;
		for (var i = 0; i < numIterations; ++i) {
			// [dag] sorting to keep zNear < zFar
			/** @type {Array<number>} */ var values = [rnd.getFloat(0, 1), rnd.getFloat(0, 1)].sort();
			/** @type {Float32Array} */ var depth = new Float32Array(values);
			gl.depthRange(depth[0], depth[1]);
			this.check(glsStateQuery.verify(gl.DEPTH_RANGE, depth));
		}
	};

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.LineWidthCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.LineWidthCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.LineWidthCase.prototype.constructor = es3fFloatStateQueryTests.LineWidthCase;

	es3fFloatStateQueryTests.LineWidthCase.prototype.test = function() {
		/** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);

		this.check(glsStateQuery.verify(gl.LINE_WIDTH, 1.0));

		/** @type {Float32Array} */ var range = /** @type {Float32Array} */ (gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE));

		/** @type {number} */ var numIterations = 120;
		for (var i = 0; i < numIterations; ++i) {
			/** @type {number} */ var reference = rnd.getFloat(range[0], range[1]);

			gl.lineWidth(reference);
			this.check(glsStateQuery.verify(gl.LINE_WIDTH, reference));
		}
	};

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.PolygonOffsetFactorCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.PolygonOffsetFactorCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.PolygonOffsetFactorCase.prototype.constructor = es3fFloatStateQueryTests.PolygonOffsetFactorCase;

	es3fFloatStateQueryTests.PolygonOffsetFactorCase.prototype.test = function() {
		/** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);

		this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_FACTOR, 0.0));

		/** @type {Array<number>} */ var fixedTests = [0.0, 0.5, -0.5, 1.5];

		for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
			gl.polygonOffset(fixedTests[ndx], 0);
			this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_FACTOR, fixedTests[ndx]));
		}

		/** @type {number} */ var numIterations = 120;
		for (var i = 0; i < numIterations; ++i) {
			/** @type {number} */ var reference = rnd.getFloat(-64000, 64000);

			gl.polygonOffset(reference, 0);
			this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_FACTOR, reference));
		}
	};

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.PolygonOffsetUnitsCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.PolygonOffsetUnitsCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.PolygonOffsetUnitsCase.prototype.constructor = es3fFloatStateQueryTests.PolygonOffsetUnitsCase;

	es3fFloatStateQueryTests.PolygonOffsetUnitsCase.prototype.test = function() {
		/** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);

		this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_UNITS, 0.0));

		/** @type {Array<number>} */ var fixedTests = [0.0, 0.5, -0.5, 1.5];

		for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
			gl.polygonOffset(0, fixedTests[ndx]);
			this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_UNITS, fixedTests[ndx]));
		}

		/** @type {number} */ var numIterations = 120;
		for (var i = 0; i < numIterations; ++i) {
			/** @type {number} */ var reference = rnd.getFloat(-64000, 64000);

			gl.polygonOffset(0, reference);
			this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_UNITS, reference));
		}
	};

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.SampleCoverageCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.SampleCoverageCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.SampleCoverageCase.prototype.constructor = es3fFloatStateQueryTests.SampleCoverageCase;

	es3fFloatStateQueryTests.SampleCoverageCase.prototype.test = function() {
		/** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);

		this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, 1.0));

		/** @type {Array<number>} */ var fixedTests = [0.0, 0.5, 0.45, 0.55];

		for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
			gl.sampleCoverage(fixedTests[ndx], false);
			this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, fixedTests[ndx]));
		}

		/** @type {Array<number>} */ var clampTests = [-1.0, -1.5, 1.45, 3.55];

		for (var ndx = 0; ndx < clampTests.length; ++ndx) {
			gl.sampleCoverage(clampTests[ndx], false);
			this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, deMath.clamp(clampTests[ndx], 0.0, 1.0)));
		}

		/** @type {number} */ var numIterations = 120;
		for (var i = 0; i < numIterations; ++i) {
			/** @type {number} */ var reference	= rnd.getFloat(0, 1);
			/** @type {boolean} */ var invert = rnd.getBool() ? true : false;

			gl.sampleCoverage(reference, invert);
			this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, reference));
		}
	};

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.BlendColorCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.BlendColorCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.BlendColorCase.prototype.constructor = es3fFloatStateQueryTests.BlendColorCase;

	es3fFloatStateQueryTests.BlendColorCase.prototype.test = function() {
		/** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);

		this.check(glsStateQuery.verify(gl.BLEND_COLOR, new Float32Array([0, 0, 0, 0])));

		/** @type {Array<Float32Array>} */ var fixedTests = [
			new Float32Array([0.5, 1.0, 0.5, 1.0]),
			new Float32Array([0.0, 0.5, 0.0, 0.5]),
			new Float32Array([0.0, 0.0, 0.0, 0.0]),
			new Float32Array([1.0, 1.0, 1.0, 1.0])
		];
		for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
			gl.blendColor(fixedTests[ndx][0], fixedTests[ndx][1], fixedTests[ndx][2], fixedTests[ndx][3]);
			this.check(glsStateQuery.verify(gl.BLEND_COLOR, fixedTests[ndx]));
		}

		/** @type {number} */ var numIterations = 120;
		for (var i = 0; i < numIterations; ++i) {
			/** @type {number} */ var r = rnd.getFloat(0, 1);
			/** @type {number} */ var g = rnd.getFloat(0, 1);
			/** @type {number} */ var b = rnd.getFloat(0, 1);
			/** @type {number} */ var a = rnd.getFloat(0, 1);

			gl.blendColor(r, g, b, a);
			this.check(glsStateQuery.verify(gl.BLEND_COLOR, new Float32Array([r, g, b, a])));
		}
	};

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.ColorClearCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.ColorClearCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.ColorClearCase.prototype.constructor = es3fFloatStateQueryTests.ColorClearCase;

	es3fFloatStateQueryTests.ColorClearCase.prototype.test = function() {
		/** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);

		// [dag] In the C++ dEQP code, initial color clear value check is temorarily removed. (until the framework does not alter it)
		this.check(glsStateQuery.verify(gl.COLOR_CLEAR_VALUE, new Float32Array([0, 0, 0, 0])));

		/** @type {Array<Float32Array>} */ var fixedTests = [
			new Float32Array([0.5, 1.0, 0.5, 1.0]),
			new Float32Array([0.0, 0.5, 0.0, 0.5]),
			new Float32Array([0.0, 0.0, 0.0, 0.0]),
			new Float32Array([1.0, 1.0, 1.0, 1.0])
		];
		for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
			gl.clearColor(fixedTests[ndx][0], fixedTests[ndx][1], fixedTests[ndx][2], fixedTests[ndx][3]);
			this.check(glsStateQuery.verify(gl.COLOR_CLEAR_VALUE, fixedTests[ndx]));
		}

		/** @type {number} */ var numIterations = 120;
		for (var i = 0; i < numIterations; ++i) {
			/** @type {number} */ var r = rnd.getFloat(0, 1);
			/** @type {number} */ var g = rnd.getFloat(0, 1);
			/** @type {number} */ var b = rnd.getFloat(0, 1);
			/** @type {number} */ var a = rnd.getFloat(0, 1);

			gl.clearColor(r, g, b, a);
			this.check(glsStateQuery.verify(gl.COLOR_CLEAR_VALUE, new Float32Array([r, g, b, a])));
		}
	};

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.DepthClearCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.DepthClearCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.DepthClearCase.prototype.constructor = es3fFloatStateQueryTests.DepthClearCase;

	es3fFloatStateQueryTests.DepthClearCase.prototype.test = function() {
		/** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);

		this.check(glsStateQuery.verify(gl.DEPTH_CLEAR_VALUE, 1));

		/** @type {number} */ var numIterations = 120;
		for (var i = 0; i < numIterations; ++i) {
			/** @type {number} */ var ref = rnd.getFloat(0, 1);

			gl.clearDepth(ref);
			this.check(glsStateQuery.verify(gl.DEPTH_CLEAR_VALUE, ref));
		}
	};

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.MaxTextureLODBiasCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.MaxTextureLODBiasCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.MaxTextureLODBiasCase.prototype.constructor = es3fFloatStateQueryTests.MaxTextureLODBiasCase;

	es3fFloatStateQueryTests.MaxTextureLODBiasCase.prototype.test = function() {
		this.check(glsStateQuery.verifyGreaterOrEqual(gl.MAX_TEXTURE_LOD_BIAS, 2.0));
	};

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.AliasedPointSizeRangeCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.AliasedPointSizeRangeCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.AliasedPointSizeRangeCase.prototype.constructor = es3fFloatStateQueryTests.AliasedPointSizeRangeCase;

	es3fFloatStateQueryTests.AliasedPointSizeRangeCase.prototype.test = function() {
		var pointSizeRange = /** @type {Float32Array} */ (gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE));
		/** @type {Float32Array} */ var reference = new Float32Array([1, 1]);
		this.check(pointSizeRange[0] <= reference[0] && pointSizeRange[1] >= reference[1]);
	};

	/**
	 * @constructor
	 * @extends {es3fApiCase.ApiCase}
	 * @param {string} name
	 * @param {string} description
	 */
	es3fFloatStateQueryTests.AliasedLineWidthRangeCase = function(name, description) {
		es3fApiCase.ApiCase.call(this, name, description, gl);
	};

	es3fFloatStateQueryTests.AliasedLineWidthRangeCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
	es3fFloatStateQueryTests.AliasedLineWidthRangeCase.prototype.constructor = es3fFloatStateQueryTests.AliasedLineWidthRangeCase;

	es3fFloatStateQueryTests.AliasedLineWidthRangeCase.prototype.test = function() {
		var lineWidthRange = /** @type {Float32Array} */ (gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE));
		/** @type {Float32Array} */ var reference = new Float32Array([1, 1]);
		this.check(lineWidthRange[0] <= reference[0] && lineWidthRange[1] >= reference[1]);
	};

    /**
    * @constructor
    * @extends {tcuTestCase.DeqpTest}
    */
    es3fFloatStateQueryTests.FloatStateQueryTests = function() {
        tcuTestCase.DeqpTest.call(this, 'floats', 'Float Values');
    };

    es3fFloatStateQueryTests.FloatStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
    es3fFloatStateQueryTests.FloatStateQueryTests.prototype.constructor = es3fFloatStateQueryTests.FloatStateQueryTests;

    es3fFloatStateQueryTests.FloatStateQueryTests.prototype.init = function() {
		this.addChild(new es3fFloatStateQueryTests.DepthRangeCase('depth_range', 'DEPTH_RANGE'));
		this.addChild(new es3fFloatStateQueryTests.LineWidthCase('line_width', 'LINE_WIDTH'));
		this.addChild(new es3fFloatStateQueryTests.PolygonOffsetFactorCase('polygon_offset_factor', 'POLYGON_OFFSET_FACTOR'));
		this.addChild(new es3fFloatStateQueryTests.PolygonOffsetUnitsCase('polygon_offset_units', 'POLYGON_OFFSET_UNITS'));
		this.addChild(new es3fFloatStateQueryTests.SampleCoverageCase('sample_coverage_value', 'SAMPLE_COVERAGE_VALUE'));
		this.addChild(new es3fFloatStateQueryTests.BlendColorCase('blend_color', 'BLEND_COLOR'));
		this.addChild(new es3fFloatStateQueryTests.ColorClearCase('color_clear_value', 'COLOR_CLEAR_VALUE'));
		this.addChild(new es3fFloatStateQueryTests.DepthClearCase('depth_clear_value', 'DEPTH_CLEAR_VALUE'));
		this.addChild(new es3fFloatStateQueryTests.MaxTextureLODBiasCase('max_texture_lod_bias', 'MAX_TEXTURE_LOD_BIAS'));
		this.addChild(new es3fFloatStateQueryTests.AliasedPointSizeRangeCase('aliased_point_size_range', 'ALIASED_POINT_SIZE_RANGE'));
		this.addChild(new es3fFloatStateQueryTests.AliasedLineWidthRangeCase('aliased_line_width_range', 'ALIASED_LINE_WIDTH_RANGE'));

    };

    /**
    * Run test
    * @param {WebGL2RenderingContext} context
    */
    es3fFloatStateQueryTests.run = function(context) {
    	gl = context;
    	//Set up Test Root parameters
    	var state = tcuTestCase.runner;
    	state.setRoot(new es3fFloatStateQueryTests.FloatStateQueryTests());

    	//Set up name and description of this test series.
    	setCurrentTestName(state.testCases.fullName());
    	description(state.testCases.getDescription());

    	try {
    		//Run test cases
    		tcuTestCase.runTestCases();
    	}
    	catch (err) {
    		testFailedOptions('Failed to es3fFloatStateQueryTests.run tests', false);
    		tcuTestCase.runner.terminate();
    	}
    };

});


text:
package com.movieFlex.Service.MovieCon;

import java.util.List;

import com.movieFlex.Model.Pojos.Movie;

public interface IMovieService {

	public List<Movie> findAllMoviesByYear();

	public List<Movie> findAllMoviesByRatings();

	public List<Movie> findAllMoviesByVotes();

	public List<Movie> topRatedMovies();

	public List<Movie> topRatedSeries();

}

redpajama_set_name: RedPajamaGithub


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

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="ESTestSuite" parallel="false">
    <parameter name="useDefaultListeners" value="false"/>

    <listeners>
        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestExecutionListener"/>
        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestSuiteListener"/>
        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestManagerListener"/>
        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestReportListener"/>
        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestTransformerListener"/>
        <listener class-name="org.wso2.carbon.integration.common.extensions.selenium.uimgt.UIManagementListener"/>
    </listeners>

    <test name="ES-UI-tests" parallel="false" verbose="2" preserve-order="true">
        <!--<packages>
            <package name="org.wso2.es.ui.integration.test.*"/>
        </packages>-->
        <classes>
            <class name="org.wso2.es.ui.integration.test.config.TestConfig"/>

            <class name="org.wso2.es.ui.integration.test.publisher.ESPublisherTenantAddEditAssetTestCase"/>
            <class name="org.wso2.es.ui.integration.test.publisher.ESPublisherAddEditAssetTestCase"/>
            <class name="org.wso2.es.ui.integration.test.publisher.ESPublisherListPageSortTestCase"/>
            <class name="org.wso2.es.ui.integration.test.publisher.ESPublisherLoginLogoutTestCase"/>
            <class name="org.wso2.es.ui.integration.test.publisher.ESPublisherLCTransitionTestCase"/>
<!---->
            <!--<class name="org.wso2.es.ui.integration.test.notifications.ESPublisherNotificationTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.notifications.ESPublisherTenantNotificationTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.notifications.ESPublisherSubscriptionTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.notifications.ESPublisherTenantSubscriptionTestCase"/>-->
<!---->
            <class name="org.wso2.es.ui.integration.test.store.ESStoreAnonCategorySortingTestCase"/>
            <class name="org.wso2.es.ui.integration.test.store.ESStoreAnonHomePageTestCase"/>
            <class name="org.wso2.es.ui.integration.test.store.ESStoreAnonSuperTenantHomePageTestCase"/>
            <class name="org.wso2.es.ui.integration.test.store.ESStoreAnonTenantHomePageTestCase"/>
            <class name="org.wso2.es.ui.integration.test.store.ESStoreBookmarkTestCase"/>
            <class name="org.wso2.es.ui.integration.test.store.ESStoreLoginLogoutTestCase"/>
            <class name="org.wso2.es.ui.integration.test.store.ESStoreCarbonSuperUserTUHomePageTestCase"/>
            <!--<class name="org.wso2.es.ui.integration.test.store.ESStoreGadgetPageTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.store.ESStoreRatingsTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.store.ESStoreSearchGadgetListTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.store.ESStoreSearchTopAssetsTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.store.ESStoreSocialSharingTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.store.ESStoreTenantUserTUHomePageTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.store.ESStoreTUAccessInvalidTenantTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.common.ESRegisterUserTestCase"/>-->
            <!--<class name="org.wso2.es.ui.integration.test.common.ESPublishToStore"/>-->
        </classes>

    </test>

</suite>


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

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>PRON</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

PRON: pronoun

Definition

Pronouns are words that substitute for nouns or noun phrases,
whose meaning is recoverable from the linguistic or extralinguistic
context.

Pronouns under this definition function like nouns.

The BulTreeBank annotation scheme adopted the idea that pro-nouns,
pro-adjectives and pro-adverbs are labeled as Pronouns.
However, for the mapping to the universal tagset, this group was split into
several parts-of-speech: determiners, adverbs, pronouns.

The tags that correspond to Pron are: Pp#, Pde#, Pre#, Pce#, Pie#, Pfe#, Pfy#, Pne#, Piy#.

Examples

personal pronouns (Pp#): аз, ти, той, тя, то, ние, те, него, го / az, ti, toy, tya, to, nie, te, nego, go "I, you, he, she, it, we, they, him.LONG.FORM, him.SHORT.FORM"

reflexive personal pronouns (Ppx#): себе си, се / sebe si, se "myself, yourself, himself, herself, itself, ourselves, yourselves, theirselves"

demonstrative pronouns (Pde#): този, това / tozi, tova "this" as in Видях това вчера. / Vidyah tova vchera "I saw this yesterday."

interrogative pronouns (Pie#, Piy#): кой, какво, колцина / _koy, kakvo, koltsina "who, what, how many" as in Какво мислиш? / _Kakvo mislish? "What do you think?"

relative pronouns (Pre#): който, каквото / _koyto, kakvoto "who, what" as in Човекът, който дойде, е баща ми. /Chovekat, koyto doyde, e bashta mi "The person who came is my father."

indefinite pronouns (Pfe#, Pfy#): някой, нещо, неколцина / nyakoy, neshto, nekoltsina "somebody, something, some, anybody, anything, any"

collective pronouns (Pce#): всеки, всичко / vseki, vsichko "everybody, everything"

negative pronouns (Pne#): никой, нищо / nikoy, nishto "nobody, nothing"

Note that the symbol `#', used in the Universal POS section indicates a holder for arbitrary number of features, suppressed in the respective tag as irrelevant in the BulTreeBank tagset, when mapped to the Universal one.

PRON in other languages:

[bej]

[bg]

[bm]

[cs]

[cy]

[da]

[el]

[en]

[ess]

[et]

[fi]

[fro]

[fr]

[ga]

[grc]

[hu]

[hy]

[it]

[ja]

[kk]

[kpv]

[myv]

[no]

[pcm]

[pt]

[qpm]

[ru]

[sla]

[sl]

[sv]

[tr]

[tt]

[uk]

[u]

[urj]

[yue]

[zh]

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
<head>
    <!--
    redirect users to the https version of the website.
    but: only check when on the production domain, as set in _config.yml.
   -->
    <script>var host = "samvandenberge.be";
        if ((host == window.location.host) && (window.location.protocol != "https:"))
        window.location.protocol = "https";
    </script>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
    <meta name="description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">

    <link rel="stylesheet" href="/assets/{{ site.github_username }}-{{ site.version }}.css">
    <link href='//fonts.googleapis.com/css?family=Roboto:400,400italic,500,700' rel='stylesheet' type='text/css'>
    <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.url }}">
</head>


text:
cask 'minishift' do
  version '1.31.0'
  sha256 'f1a752ebb225d85d813ad7c44e34545d56c53e01aad817f8223a51ee95004f9c'

  url "https://github.com/minishift/minishift/releases/download/v#{version}/minishift-#{version}-darwin-amd64.tgz"
  appcast 'https://github.com/minishift/minishift/releases.atom'
  name 'Minishift'
  homepage 'https://github.com/minishift/minishift'

  binary "minishift-#{version}-darwin-amd64/minishift"
end


text:
package mjson

import (
	"encoding/json"
)

// Marshal returns string of obj json format.
func Marshal(obj interface{}) string {
	//b, err := json.Marshal(obj)
	b, err := json.MarshalIndent(obj, "", "  ")
	// Marshal error
	if logger.CheckError(err) {

	}
	return string(b)
}


text:
namespace librealsense
{
    std::string hw_monitor::get_firmware_version_string(const std::vector<uint8_t>& buff, size_t index, size_t length)
    {
        std::stringstream formattedBuffer;
        std::string s = "";
        for (auto i = 1; i <= length; i++)
        {
            formattedBuffer << s << static_cast<int>(buff[index + (length - i)]);
            s = ".";
        }

        return formattedBuffer.str();
    }

    std::string hw_monitor::get_module_serial_string(const std::vector<uint8_t>& buff, size_t index, size_t length)
    {
        std::stringstream formattedBuffer;
        for (auto i = 0; i < length; i++)
            formattedBuffer << std::setfill('0') << std::setw(2) << std::hex << static_cast<int>(buff[index + i]);

        return formattedBuffer.str();
    }

    void hw_monitor::fill_usb_buffer(int opCodeNumber, int p1, int p2, int p3, int p4,
        uint8_t const * data, int dataLength, uint8_t* bufferToSend, int& length)
    {
        auto preHeaderData = IVCAM_MONITOR_MAGIC_NUMBER;

        uint8_t* writePtr = bufferToSend;
        auto header_size = 4;

        auto cur_index = 2;
        memcpy(writePtr + cur_index, &preHeaderData, sizeof(uint16_t));
        cur_index += sizeof(uint16_t);
        memcpy(writePtr + cur_index, &opCodeNumber, sizeof(uint32_t));
        cur_index += sizeof(uint32_t);
        memcpy(writePtr + cur_index, &p1, sizeof(uint32_t));
        cur_index += sizeof(uint32_t);
        memcpy(writePtr + cur_index, &p2, sizeof(uint32_t));
        cur_index += sizeof(uint32_t);
        memcpy(writePtr + cur_index, &p3, sizeof(uint32_t));
        cur_index += sizeof(uint32_t);
        memcpy(writePtr + cur_index, &p4, sizeof(uint32_t));
        cur_index += sizeof(uint32_t);

        if (dataLength)
        {
            librealsense::copy(writePtr + cur_index, data, dataLength);
            cur_index += dataLength;
        }

        length = cur_index;
        uint16_t tmp_size = length - header_size;
        memcpy(bufferToSend, &tmp_size, sizeof(uint16_t)); // Length doesn't include header
    }

    void hw_monitor::execute_usb_command(uint8_t *out, size_t outSize, uint32_t & op, uint8_t * in, size_t & inSize) const
    {
        std::vector<uint8_t> out_vec(out, out + outSize);
        auto res = _locked_transfer->send_receive(out_vec);

        // read
        if (in && inSize)
        {
            if (res.size() < static_cast<int>(sizeof(uint32_t)))
                throw invalid_value_exception("Incomplete bulk usb transfer!");

            if (res.size() > IVCAM_MONITOR_MAX_BUFFER_SIZE)
                throw invalid_value_exception("Out buffer is greater than max buffer size!");

            op = *reinterpret_cast<uint32_t *>(res.data());
            if (res.size() > static_cast<int>(inSize))
                throw invalid_value_exception("bulk transfer failed - user buffer too small");

            inSize = res.size();
            librealsense::copy(in, res.data(), inSize);
        }
    }

    void hw_monitor::update_cmd_details(hwmon_cmd_details& details, size_t receivedCmdLen, unsigned char* outputBuffer)
    {
        details.receivedCommandDataLength = receivedCmdLen;

        if (details.oneDirection) return;

        if (details.receivedCommandDataLength < 4)
            throw invalid_value_exception("received incomplete response to usb command");

        details.receivedCommandDataLength -= 4;
        librealsense::copy(details.receivedOpcode.data(), outputBuffer, 4);

        if (details.receivedCommandDataLength > 0)
            librealsense::copy(details.receivedCommandData.data(), outputBuffer + 4, details.receivedCommandDataLength);
    }

    void hw_monitor::send_hw_monitor_command(hwmon_cmd_details& details) const
    {
        unsigned char outputBuffer[HW_MONITOR_BUFFER_SIZE];

        uint32_t op{};
        size_t receivedCmdLen = HW_MONITOR_BUFFER_SIZE;

        execute_usb_command(details.sendCommandData.data(), details.sizeOfSendCommandData, op, outputBuffer, receivedCmdLen);
        update_cmd_details(details, receivedCmdLen, outputBuffer);
    }

    std::vector< uint8_t > hw_monitor::send( std::vector< uint8_t > const & data ) const
    {
        return _locked_transfer->send_receive(data);
    }

    std::vector< uint8_t >
    hw_monitor::send( command cmd, hwmon_response * p_response, bool locked_transfer ) const
    {
        hwmon_cmd newCommand(cmd);
        auto opCodeXmit = static_cast<uint32_t>(newCommand.cmd);

        hwmon_cmd_details details;
        details.oneDirection = newCommand.oneDirection;
        details.timeOut = newCommand.timeOut;

        fill_usb_buffer(opCodeXmit,
            newCommand.param1,
            newCommand.param2,
            newCommand.param3,
            newCommand.param4,
            newCommand.data,
            newCommand.sizeOfSendCommandData,
            details.sendCommandData.data(),
            details.sizeOfSendCommandData);

        if (locked_transfer)
        {
            return _locked_transfer->send_receive({ details.sendCommandData.begin(),details.sendCommandData.end()});
        }

        send_hw_monitor_command(details);

        // Error/exit conditions
        if( p_response )
            *p_response = hwm_Success;
        if( newCommand.oneDirection )
            return std::vector<uint8_t>();

        librealsense::copy(newCommand.receivedOpcode, details.receivedOpcode.data(), 4);
        librealsense::copy(newCommand.receivedCommandData, details.receivedCommandData.data(), details.receivedCommandDataLength);
        newCommand.receivedCommandDataLength = details.receivedCommandDataLength;

        // endian?
        auto opCodeAsUint32 = pack(details.receivedOpcode[3], details.receivedOpcode[2],
                                    details.receivedOpcode[1], details.receivedOpcode[0]);
        if (opCodeAsUint32 != opCodeXmit)
        {
            auto err_type = static_cast<hwmon_response>(opCodeAsUint32);
            std::string err = hwmon_error_string( cmd, err_type );
            LOG_DEBUG( err );
            if( p_response )
            {
                *p_response = err_type;
                return std::vector<uint8_t>();
            }
            throw invalid_value_exception( err );
        }

        return std::vector<uint8_t>(newCommand.receivedCommandData,
            newCommand.receivedCommandData + newCommand.receivedCommandDataLength);
    }

    std::vector<uint8_t> hw_monitor::build_command(uint32_t opcode,
        uint32_t param1,
        uint32_t param2,
        uint32_t param3,
        uint32_t param4,
        uint8_t const * data,
        size_t dataLength) const
    {
        int length;
        std::vector<uint8_t> result;
        result.resize(IVCAM_MONITOR_MAX_BUFFER_SIZE);
        fill_usb_buffer(opcode, param1, param2, param3, param4, data, static_cast<int>(dataLength), result.data(), length);
        result.resize(length);
        return result;
    }

    std::string hwmon_error_string( command const & cmd, hwmon_response e )
    {
        auto str = hwmon_error2str( e );
        to_string err;
        err << "hwmon command 0x" << std::hex << unsigned(cmd.cmd) << '(';
        err << ' ' << cmd.param1;
        err << ' ' << cmd.param2;
        err << ' ' << cmd.param3;
        err << ' ' << cmd.param4 << std::dec;
        err << " ) failed (response " << e << "= " << ( str.empty() ? "unknown" : str ) << ")";
        return err;
    }

    void hw_monitor::get_gvd(size_t sz, unsigned char* gvd, uint8_t gvd_cmd) const
    {
        command command(gvd_cmd);
        auto data = send(command);
        auto minSize = std::min(sz, data.size());
        librealsense::copy(gvd, data.data(), minSize);
    }

    bool hw_monitor::is_camera_locked(uint8_t gvd_cmd, uint32_t offset) const
    {
        std::vector<unsigned char> gvd(HW_MONITOR_BUFFER_SIZE);
        get_gvd(gvd.size(), gvd.data(), gvd_cmd);
        bool value;
        librealsense::copy(&value, gvd.data() + offset, 1);
        return value;
    }
}


text:
"""
Helpers for abstracting high-level network concepts. Different from 'models.py' which deals
with IO abstraction.
"""

import string

from typing import Dict, Union, Tuple
from collections import namedtuple, OrderedDict

# externals
# None. Should not have any external dependencies.

FILENAME_VALID_CHARS = "-~_.() {}{}".format(string.ascii_letters, string.digits)

"""NetworkResult(input: str, output_tensor: np.array, semantic_output: np.array, median_runtime: NetworkRuntime, models: [str])"""
NetworkResult = namedtuple(
    "NetworkResult",
    ["input", "output_tensor", "semantic_output", "median_runtime", "models"],
)

"""BenchmarkingResult(median_runtime: NetworkRuntime, models: [str])"""
BenchmarkingResult = namedtuple(
    "BenchmarkingResult",
    ["median_runtime", "models"],
)

"""CheckpointResult(network_results: List[NetworkResult], accuracy: float)"""
NetworkCheckpointResult = namedtuple(
    "NetworkCheckpointResult", ["network_results", "accuracy"]
)

# Tracks TRT Precision Config
"""Precision(fp16: Bool)"""
Precision = namedtuple("Precision", ["fp16"])

"""NetworkMetadata(variant: str, precision: Precision, other: Union[namedtuple, None])"""
NetworkMetadata = namedtuple("NetworkMetadata", ["variant", "precision", "other"])

"""TimingProfile(iterations: int, number: int, warmup: int, duration: int, percentile: int or [int])"""
TimingProfile = namedtuple("TimingProfile", ["iterations", "number", "warmup", "duration", "percentile"])

"""NetworkModel(name: str, fpath: str)"""
NetworkModel = namedtuple("NetworkModel", ["name", "fpath"])

"""
String encodings to genereted network models.
    NetworkModels(torch: Tuple[NetworkModel], onnx: Tuple[NetworkModel])
"""
NetworkModels = namedtuple("NetworkModels", ["torch", "onnx", "trt"])

"""
Args:
    name: Name of the network / parts of the network timed.
    runtime: Runtime of the time.

NetworkRuntime(name: str, runtime: float)
"""
NetworkRuntime = namedtuple("NetworkRuntime", ["name", "runtime"])

class Dims:
    """Helper class for interfacing dimension constructs with Polygraphy and PyTorch."""

    BATCH = "batch"
    SEQUENCE = "sequence"

    def __init__(self, encoding: OrderedDict):
        self.encoding = encoding

    def create_new_sequence_dim(dim_type: str) -> str:
        """
        Returns a new sequence dimension.

        Return:
            str: Returns a sequence dimension which Dims.SEQUENCE appended by dim_type.
        """
        return Dims.SEQUENCE + "_" + dim_type

    def get_dims(self):
        """
        Returns the encoding dimensions.

        Return:
            OrderedDict[str, Union[int, str]]: Returns dimensional encoding. Example: {'input_ids': (1, SEQUENCE_DIM)}
        """
        return self.encoding

    def get_names(self) -> Tuple[str]:
        return tuple(self.encoding.keys())

    def get_lengths(self) -> Tuple[Union[int, str]]:
        return tuple(self.encoding.values())

    def get_torch_dynamic_axis_encoding(self) -> dict:
        """
        Returns a Pytorch "dynamic_axes" encoding for onnx.export.

        Returns:
            dict: Returns a 'dynamic' index with corresponding names according to:
                https://pytorch.org/docs/stable/onnx.html
        """

        dynamic_axes = {}
        for k, v in self.encoding.items():
            encodings = []
            for idx, e in enumerate(v):
                if isinstance(e, str) and (e == self.BATCH or self.SEQUENCE in e):
                    encodings.append((idx, e))
            dynamic_axes[k] = {idx: e for idx, e in encodings}

        return dynamic_axes

# Config Class
class NNConfig:
    """Contains info for a given network that we support."""

    NETWORK_SEGMENTS = ["full"]

    def __init__(self, network_name, variants=None):
        assert self._is_valid_filename(
            network_name
        ), "Network name: {} is not filename friendly.".format(network_name)

        self.network_name = network_name
        self.variants = variants

        # Due to limitations of namedtuples and pickle function, namedtupled must be tracked as an instance
        # which refers to a global.
        if len(self.variants) > 0:
            self.MetadataClass = type(self.variants[0].other)
        else:
            self.MetadataClass = None

    def get_network_segments(self):
        """
        Returns exportable segments for the given network.
        Used in the case where a single network needs to
        be exported into multiple parts.
        """
        return self.NETWORK_SEGMENTS

    @staticmethod
    def get_output_dims(metadata) -> Dict:
        """
        Returns the output dimensions of the current network.
        Since some networks can have multiple parts, should be a dictionary encoding.

        Returns:
            (Dict): {"network_section": Dims}
        """
        raise NotImplementedError("Output dims not yet defined.")

    @staticmethod
    def get_input_dims(metadata) -> Dict:
        """
        Returns the input dimensions of the current network.
        Since some networks can have multiple parts, should be a dictionary encoding.

        Returns:
            (Dict): {"network_section": Dims} example:
                {"encoder": Dims(...), "decoder": Dims(...)}
        """
        raise NotImplementedError("Input dims not yet defined.")

    def _is_valid_filename(self, filename: str) -> bool:
        """
        Checks if a given filename is valid, helpful for cross platform dependencies.
        """
        return all(c in FILENAME_VALID_CHARS for c in filename)

    def get_python_requirements():
        return []

    def get_metadata_string(self, metadata: NetworkMetadata) -> str:
        """
        Serializes a Metadata object into string.
        String will be checked if friendly to filenames across Windows and Linux operating systems.

        returns:
            string: <network>-<variant-name>-<precision>-<others>
        """

        precision_str = "-".join(
            [k for k, v in metadata.precision._asdict().items() if v]
        )
        result = [self.network_name, metadata.variant]
        if precision_str:
            result.append(precision_str)

        other_result = [
            "{}~{}".format(k, str(v)) for k, v in metadata.other._asdict().items()
        ]
        # Remove all boolean values that are False and remove True if exists
        true_length = len("~True")
        other_result_filtered = [v[:-true_length] if v.endswith("~True") else v for v in other_result if "~False" not in v]

        if len(other_result_filtered) != 0:
            result.append("-".join(other_result_filtered))

        final_str = "-".join(result)
        assert self._is_valid_filename(
            final_str
        ), "Metadata for current network {} is not filename friendly: {}.".format(
            self.network_name, final_str
        )

        return final_str


text:
from django.contrib.auth import get_user_model
from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html

from useraudit import models as m

class LogAdmin(admin.ModelAdmin):
    model = m.Log

    search_fields = ['username']
    list_filter = ['timestamp']
    list_display = ('username', 'ip_address', 'forwarded_by', 'user_agent', 'timestamp')
    list_display_links = None

class LoginAttemptAdmin(admin.ModelAdmin):
    model = m.LoginAttempt

    list_display = ('username', 'count', 'timestamp', 'activate')
    list_display_links = None

    def activate(self, obj):
        UserModel = get_user_model()
        try:
            user = UserModel._default_manager.get_by_natural_key(obj.username)
            if user.is_active:
                return "Active"
            activation_url = reverse("useraudit:reactivate_user", args=[user.id])
            return format_html(u"Activate" % activation_url)
        except UserModel.DoesNotExist:
            return "N/A"

    activate.short_description = "Status"
    activate.allow_tags = True

admin.site.register(m.LoginLog, LogAdmin)
admin.site.register(m.FailedLoginLog, LogAdmin)
admin.site.register(m.LoginAttempt, LoginAttemptAdmin)


text:
package azure

import (
	"context"
	"fmt"
	"net"
	"strings"
	"time"

	"github.com/Azure/azure-sdk-for-go/arm/compute"
	"github.com/Azure/azure-sdk-for-go/arm/network"
	"github.com/Azure/go-autorest/autorest/azure"

	"github.com/go-kit/kit/log"
	"github.com/go-kit/kit/log/level"
	"github.com/prometheus/client_golang/prometheus"
	config_util "github.com/prometheus/common/config"
	"github.com/prometheus/common/model"

	"github.com/prometheus/prometheus/discovery/targetgroup"
	"github.com/prometheus/prometheus/util/strutil"
)

const (
	azureLabel                     = model.MetaLabelPrefix + "azure_"
	azureLabelMachineID            = azureLabel + "machine_id"
	azureLabelMachineResourceGroup = azureLabel + "machine_resource_group"
	azureLabelMachineName          = azureLabel + "machine_name"
	azureLabelMachineOSType        = azureLabel + "machine_os_type"
	azureLabelMachineLocation      = azureLabel + "machine_location"
	azureLabelMachinePrivateIP     = azureLabel + "machine_private_ip"
	azureLabelMachineTag           = azureLabel + "machine_tag_"
)

var (
	azureSDRefreshFailuresCount = prometheus.NewCounter(
		prometheus.CounterOpts{
			Name: "prometheus_sd_azure_refresh_failures_total",
			Help: "Number of Azure-SD refresh failures.",
		})
	azureSDRefreshDuration = prometheus.NewSummary(
		prometheus.SummaryOpts{
			Name: "prometheus_sd_azure_refresh_duration_seconds",
			Help: "The duration of a Azure-SD refresh in seconds.",
		})

	// DefaultSDConfig is the default Azure SD configuration.
	DefaultSDConfig = SDConfig{
		Port:            80,
		RefreshInterval: model.Duration(5 * time.Minute),
	}
)

// SDConfig is the configuration for Azure based service discovery.
type SDConfig struct {
	Port            int                `yaml:"port"`
	SubscriptionID  string             `yaml:"subscription_id"`
	TenantID        string             `yaml:"tenant_id,omitempty"`
	ClientID        string             `yaml:"client_id,omitempty"`
	ClientSecret    config_util.Secret `yaml:"client_secret,omitempty"`
	RefreshInterval model.Duration     `yaml:"refresh_interval,omitempty"`
}

// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
	*c = DefaultSDConfig
	type plain SDConfig
	err := unmarshal((*plain)(c))
	if err != nil {
		return err
	}
	if c.SubscriptionID == "" {
		return fmt.Errorf("Azure SD configuration requires a subscription_id")
	}
	return nil
}

func init() {
	prometheus.MustRegister(azureSDRefreshDuration)
	prometheus.MustRegister(azureSDRefreshFailuresCount)
}

// Discovery periodically performs Azure-SD requests. It implements
// the Discoverer interface.
type Discovery struct {
	cfg      *SDConfig
	interval time.Duration
	port     int
	logger   log.Logger
}

// NewDiscovery returns a new AzureDiscovery which periodically refreshes its targets.
func NewDiscovery(cfg *SDConfig, logger log.Logger) *Discovery {
	if logger == nil {
		logger = log.NewNopLogger()
	}
	return &Discovery{
		cfg:      cfg,
		interval: time.Duration(cfg.RefreshInterval),
		port:     cfg.Port,
		logger:   logger,
	}
}

// Run implements the Discoverer interface.
func (d *Discovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
	ticker := time.NewTicker(d.interval)
	defer ticker.Stop()

	for {
		select {
		case <-ctx.Done():
			return
		default:
		}

		tg, err := d.refresh()
		if err != nil {
			level.Error(d.logger).Log("msg", "Unable to refresh during Azure discovery", "err", err)
		} else {
			select {
			case <-ctx.Done():
			case ch <- []*targetgroup.Group{tg}:
			}
		}

		select {
		case <-ticker.C:
		case <-ctx.Done():
			return
		}
	}
}

// azureClient represents multiple Azure Resource Manager providers.
type azureClient struct {
	nic network.InterfacesClient
	vm  compute.VirtualMachinesClient
}

// createAzureClient is a helper function for creating an Azure compute client to ARM.
func createAzureClient(cfg SDConfig) (azureClient, error) {
	var c azureClient
	oauthConfig, err := azure.PublicCloud.OAuthConfigForTenant(cfg.TenantID)
	if err != nil {
		return azureClient{}, err
	}
	spt, err := azure.NewServicePrincipalToken(*oauthConfig, cfg.ClientID, string(cfg.ClientSecret), azure.PublicCloud.ResourceManagerEndpoint)
	if err != nil {
		return azureClient{}, err
	}

	c.vm = compute.NewVirtualMachinesClient(cfg.SubscriptionID)
	c.vm.Authorizer = spt

	c.nic = network.NewInterfacesClient(cfg.SubscriptionID)
	c.nic.Authorizer = spt

	return c, nil
}

// azureResource represents a resource identifier in Azure.
type azureResource struct {
	Name          string
	ResourceGroup string
}

// Create a new azureResource object from an ID string.
func newAzureResourceFromID(id string, logger log.Logger) (azureResource, error) {
	// Resource IDs have the following format.
	// /subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/PROVIDER/TYPE/NAME
	s := strings.Split(id, "/")
	if len(s) != 9 {
		err := fmt.Errorf("invalid ID '%s'. Refusing to create azureResource", id)
		level.Error(logger).Log("err", err)
		return azureResource{}, err
	}
	return azureResource{
		Name:          strings.ToLower(s[8]),
		ResourceGroup: strings.ToLower(s[4]),
	}, nil
}

func (d *Discovery) refresh() (tg *targetgroup.Group, err error) {
	defer level.Debug(d.logger).Log("msg", "Azure discovery completed")

	t0 := time.Now()
	defer func() {
		azureSDRefreshDuration.Observe(time.Since(t0).Seconds())
		if err != nil {
			azureSDRefreshFailuresCount.Inc()
		}
	}()
	tg = &targetgroup.Group{}
	client, err := createAzureClient(*d.cfg)
	if err != nil {
		return tg, fmt.Errorf("could not create Azure client: %s", err)
	}

	var machines []compute.VirtualMachine
	result, err := client.vm.ListAll()
	if err != nil {
		return tg, fmt.Errorf("could not list virtual machines: %s", err)
	}
	machines = append(machines, *result.Value...)

	// If we still have results, keep going until we have no more.
	for result.NextLink != nil {
		result, err = client.vm.ListAllNextResults(result)
		if err != nil {
			return tg, fmt.Errorf("could not list virtual machines: %s", err)
		}
		machines = append(machines, *result.Value...)
	}
	level.Debug(d.logger).Log("msg", "Found virtual machines during Azure discovery.", "count", len(machines))

	// We have the slice of machines. Now turn them into targets.
	// Doing them in go routines because the network interface calls are slow.
	type target struct {
		labelSet model.LabelSet
		err      error
	}

	ch := make(chan target, len(machines))
	for i, vm := range machines {
		go func(i int, vm compute.VirtualMachine) {
			r, err := newAzureResourceFromID(*vm.ID, d.logger)
			if err != nil {
				ch <- target{labelSet: nil, err: err}
				return
			}

			labels := model.LabelSet{
				azureLabelMachineID:            model.LabelValue(*vm.ID),
				azureLabelMachineName:          model.LabelValue(*vm.Name),
				azureLabelMachineOSType:        model.LabelValue(vm.Properties.StorageProfile.OsDisk.OsType),
				azureLabelMachineLocation:      model.LabelValue(*vm.Location),
				azureLabelMachineResourceGroup: model.LabelValue(r.ResourceGroup),
			}

			if vm.Tags != nil {
				for k, v := range *vm.Tags {
					name := strutil.SanitizeLabelName(k)
					labels[azureLabelMachineTag+model.LabelName(name)] = model.LabelValue(*v)
				}
			}

			// Get the IP address information via separate call to the network provider.
			for _, nic := range *vm.Properties.NetworkProfile.NetworkInterfaces {
				r, err := newAzureResourceFromID(*nic.ID, d.logger)
				if err != nil {
					ch <- target{labelSet: nil, err: err}
					return
				}
				networkInterface, err := client.nic.Get(r.ResourceGroup, r.Name, "")
				if err != nil {
					level.Error(d.logger).Log("msg", "Unable to get network interface", "name", r.Name, "err", err)
					ch <- target{labelSet: nil, err: err}
					// Get out of this routine because we cannot continue without a network interface.
					return
				}

				// Unfortunately Azure does not return information on whether a VM is deallocated.
				// This information is available via another API call however the Go SDK does not
				// yet support this. On deallocated machines, this value happens to be nil so it
				// is a cheap and easy way to determine if a machine is allocated or not.
				if networkInterface.Properties.Primary == nil {
					level.Debug(d.logger).Log("msg", "Skipping deallocated virtual machine", "machine", *vm.Name)
					ch <- target{}
					return
				}

				if *networkInterface.Properties.Primary {
					for _, ip := range *networkInterface.Properties.IPConfigurations {
						if ip.Properties.PrivateIPAddress != nil {
							labels[azureLabelMachinePrivateIP] = model.LabelValue(*ip.Properties.PrivateIPAddress)
							address := net.JoinHostPort(*ip.Properties.PrivateIPAddress, fmt.Sprintf("%d", d.port))
							labels[model.AddressLabel] = model.LabelValue(address)
							ch <- target{labelSet: labels, err: nil}
							return
						}
						// If we made it here, we don't have a private IP which should be impossible.
						// Return an empty target and error to ensure an all or nothing situation.
						err = fmt.Errorf("unable to find a private IP for VM %s", *vm.Name)
						ch <- target{labelSet: nil, err: err}
						return
					}
				}
			}
		}(i, vm)
	}

	for range machines {
		tgt := <-ch
		if tgt.err != nil {
			return nil, fmt.Errorf("unable to complete Azure service discovery: %s", err)
		}
		if tgt.labelSet != nil {
			tg.Targets = append(tg.Targets, tgt.labelSet)
		}
	}

	return tg, nil
}


text:
package org.apache.skywalking.apm.collector.storage.h2.define.amp;

import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable;

/**
 * @author peng-yongsheng
 */
public class ApplicationMinuteMetricH2TableDefine extends AbstractApplicationMetricH2TableDefine {

    public ApplicationMinuteMetricH2TableDefine() {
        super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName());
    }
}


text:
@protocol XMPPMessageProto;

@interface HJHistoryMessageParser : NSObject

+ (id<XMPPMessageProto>)unwrapHistoryMessage:(id<XMPPMessageProto>)element;

@end


text:
class TokensController < ApplicationController

  def request_token
    request_token = TWITTER.get_request_token(oauth_callback: ENV['OAUTH_CALLBACK'])
    Oauth.create(token: request_token.token, secret: request_token.secret)
    redirect_to request_token.authorize_url(oauth_callback: ENV['OAUTH_CALLBACK'])
  end

# notes: obtain a request token directly from Twitter via oauth-ruby's 'get_request_token' on the callback URL as encapsulated in the development.rb & twitter dev app
# store the token & secret from twitter in db.  Then redirect user via authorize_url() method on request token obj, which generates the URL of a Twitter login page.
# after Twitter login, Twitter sends user back with ENV['oauth_callback'] URL (/access_token)

  def access_token
    oauth = Oauth.find_by(token: params[:oauth_token])
    if oauth.present?
      request_token = OAuth::RequestToken.new(TWITTER, oauth.token, oauth.secret)
      access_token = request_token.get_access_token(oauth_verifier: params[:oauth_verifier])
      user = User.find_or_create_by(uid: access_token.params[:user_id]) { |u| u.handle = access_token.params[:screen_name] }
      jwt = JWT.encode({uid: user.uid, exp: 1.day.from_now.to_i}, Rails.application.secrets.secret_key_base)
      redirect_to ENV['ORIGIN'] + "?jwt=#{jwt}"
    else
      redirect_to ENV['ORIGIN']
    end
  end
end

# this is upgrading the request token to an access_token, if request token exists.  oauth_verifier param matches up new request token generated by oauth_token param from Twitter
# if successful, we can use access token to get user_id & handle (all we need from Twitter auth)
# Then authentication for cross origin requests begins with uid gleaned from Twitter oauth that's then encoded as a JWT payload (expire 1 day), uses Rails secret key base as a JWT encode secret
# JWT payloads are signed but not encrypted so dont assign key info to payload
# Finally, user is returned to React app with a URL parameter containing JWT (that will be extracted out in React's state via App.jsx)


text:
#ifndef __PROJECT_EULER_PROBLEM181_H__
#define __PROJECT_EULER_PROBLEM181_H__
/*
 * ProjectEuler/include/c/ProjectEuler/Problem181.h
 *
 * Investigating in how many ways objects of two different colours can be grouped.
 * ===============================================================================
 * Published on Saturday, 9th February 2008, 01:00 pm
 *
 * Having three black objects B and one white object W they can be grouped in 7
 * ways like this:  (BBBW)(B,BBW)(B,B,BW)(B,B,B,W) (B,BB,W)(BBB,W)(BB,BW)  In
 * how many ways can sixty black objects B and forty white objects W be  thus
 * grouped?
 */

#  ifdef __cplusplus
extern "C" {
#  endif

#  ifdef __cplusplus
}
#  endif

#endif  /* __PROJECT_EULER_PROBLEM181_H__ */


text:
This is the independent Study of NTUST. Our group have two members, Da-Xiang Li and Tian-You Zhang.

This project is a website using git and Python. We want to help people that have ideas but not has so much time to complete their arts like novel.Everyone interesed on your art can apply to write new version content or next chapter, according to your novel outline.

# Documents Introduction
The doc folder has Database Design(ER Model), function list, progress(include gantt chart), Architecture Design and other documents. ER model uses the **MySQL Workbench 6.3**(community version) software. Architecture Design uses **StartUML 2.8.0** software. Use Apache HTTP server benchmarking tool (**ab tool**) for Performance Tests.

### [Gantt Chart](http://htmlpreview.github.io/?https://github.com/0lidaxiang/WeArt/blob/master/doc/ganttChart.html)
### [Progress](./doc/progress.md)
### [Main Function List](./doc/main-function-list.md)
### [Ideas](./doc/ideas-and-design.md)
### [Pictures Designed for Front-End](./doc/front_end_design)

### Architecture Model
![Architecture Model](./doc/architecture/architecture.png)

### Use Case Diagram(From function view)
![Use Case Diagram](./doc/architecture/use-case-diagram.png)

### Class Diagram(From behavior view)
![Class Diagram](./doc/architecture/view-class-diagram.png)

### ER Model Design
![ER Model Design Picture](./doc/database/er-model.png)


text:
/**
 * @class Ext.BorderLayout
 * @extends Ext.LayoutManager
 * This class represents a common layout manager used in desktop applications.
 * Example:

 var layout = new Ext.BorderLayout(document.body, {
    north: {
        initialSize: 25,
        titlebar: false
    },
    west: {
        split:true,
        initialSize: 200,
        minSize: 175,
        maxSize: 400,
        titlebar: true,
        collapsible: true
    },
    east: {
        split:true,
        initialSize: 202,
        minSize: 175,
        maxSize: 400,
        titlebar: true,
        collapsible: true
    },
    south: {
        split:true,
        initialSize: 100,
        minSize: 100,
        maxSize: 200,
        titlebar: true,
        collapsible: true
    },
    center: {
        titlebar: true,
        autoScroll:true,
        resizeTabs: true,
        minTabWidth: 50,
        preferredTabWidth: 150
    }
});

// shorthand
var CP = Ext.ContentPanel;

layout.beginUpdate();
layout.add("north", new CP("north", "North"));
layout.add("south", new CP("south", {title: "South", closable: true}));
layout.add("west", new CP("west", {title: "West"}));
layout.add("east", new CP("autoTabs", {title: "Auto Tabs", closable: true}));
layout.add("center", new CP("center1", {title: "Close Me", closable: true}));
layout.add("center", new CP("center2", {title: "Center Panel", closable: false}));
layout.getRegion("center").showPanel("center1");
layout.endUpdate();

The container the layout is rendered into can be either the body element or any other element.
If it is not the body element, the container needs to either be an absolute positioned element,
or you will need to add "position:relative" to the css of the container.  You will also need to specify
the container size if it is not the body element.

* @constructor
* Create a new BorderLayout
* @param {Mixed} container The container this layout is bound to
* @param {Object} config Configuration options
 */
Ext.BorderLayout = function(container, config){
    config = config || {};
    Ext.BorderLayout.superclass.constructor.call(this, container, config);
    this.factory = config.factory || Ext.BorderLayout.RegionFactory;
    for(var i = 0, len = this.factory.validRegions.length; i < len; i++) {
    	var target = this.factory.validRegions[i];
    	if(config[target]){
    	    this.addRegion(target, config[target]);
    	}
    }
};

Ext.extend(Ext.BorderLayout, Ext.LayoutManager, {
    /**
     * Creates and adds a new region if it doesn't already exist.
     * @param {String} target The target region key (north, south, east, west or center).
     * @param {Object} config The regions config object
     * @return {BorderLayoutRegion} The new region
     */
    addRegion : function(target, config){
        if(!this.regions[target]){
            var r = this.factory.create(target, this, config);
    	    this.bindRegion(target, r);
        }
        return this.regions[target];
    },

    // private (kinda)
    bindRegion : function(name, r){
        this.regions[name] = r;
        r.on("visibilitychange", this.layout, this);
        r.on("paneladded", this.layout, this);
        r.on("panelremoved", this.layout, this);
        r.on("invalidated", this.layout, this);
        r.on("resized", this.onRegionResized, this);
        r.on("collapsed", this.onRegionCollapsed, this);
        r.on("expanded", this.onRegionExpanded, this);
    },

    /**
     * Performs a layout update.
     */
    layout : function(){
        if(this.updating) return;
        var size = this.getViewSize();
        var w = size.width, h = size.height;
        var centerW = w, centerH = h, centerY = 0, centerX = 0;
        //var x = 0, y = 0;

        var rs = this.regions;
        var n = rs["north"], s = rs["south"], west = rs["west"], e = rs["east"], c = rs["center"];
        //if(this.hideOnLayout){ // not supported anymore
            //c.el.setStyle("display", "none");
        //}
        if(n && n.isVisible()){
            var b = n.getBox();
            var m = n.getMargins();
            b.width = w - (m.left+m.right);
            b.x = m.left;
            b.y = m.top;
            centerY = b.height + b.y + m.bottom;
            centerH -= centerY;
            n.updateBox(this.safeBox(b));
        }
        if(s && s.isVisible()){
            var b = s.getBox();
            var m = s.getMargins();
            b.width = w - (m.left+m.right);
            b.x = m.left;
            var totalHeight = (b.height + m.top + m.bottom);
            b.y = h - totalHeight + m.top;
            centerH -= totalHeight;
            s.updateBox(this.safeBox(b));
        }
        if(west && west.isVisible()){
            var b = west.getBox();
            var m = west.getMargins();
            b.height = centerH - (m.top+m.bottom);
            b.x = m.left;
            b.y = centerY + m.top;
            var totalWidth = (b.width + m.left + m.right);
            centerX += totalWidth;
            centerW -= totalWidth;
            west.updateBox(this.safeBox(b));
        }
        if(e && e.isVisible()){
            var b = e.getBox();
            var m = e.getMargins();
            b.height = centerH - (m.top+m.bottom);
            var totalWidth = (b.width + m.left + m.right);
            b.x = w - totalWidth + m.left;
            b.y = centerY + m.top;
            centerW -= totalWidth;
            e.updateBox(this.safeBox(b));
        }
        if(c){
            var m = c.getMargins();
            var centerBox = {
                x: centerX + m.left,
                y: centerY + m.top,
                width: centerW - (m.left+m.right),
                height: centerH - (m.top+m.bottom)
            };
            //if(this.hideOnLayout){
                //c.el.setStyle("display", "block");
            //}
            c.updateBox(this.safeBox(centerBox));
        }
        this.el.repaint();
        this.fireEvent("layout", this);
    },

    safeBox : function(box){
        box.width = Math.max(0, box.width);
        box.height = Math.max(0, box.height);
        return box;
    },

    /**
     * Adds a ContentPanel (or subclass) to this layout.
     * @param {String} target The target region key (north, south, east, west or center).
     * @param {Ext.ContentPanel} panel The panel to add
     * @return {Ext.ContentPanel} The added panel
     */
    add : function(target, panel){
        target = target.toLowerCase();
        return this.regions[target].add(panel);
    },

    /**
     * Remove a ContentPanel (or subclass) to this layout.
     * @param {String} target The target region key (north, south, east, west or center).
     * @param {Number/String/Ext.ContentPanel} panel The index, id or panel to remove
     * @return {Ext.ContentPanel} The removed panel
     */
    remove : function(target, panel){
        target = target.toLowerCase();
        return this.regions[target].remove(panel);
    },

    /**
     * Searches all regions for a panel with the specified id
     * @param {String} panelId
     * @return {Ext.ContentPanel} The panel or null if it wasn't found
     */
    findPanel : function(panelId){
        var rs = this.regions;
        for(var target in rs){
            if(typeof rs[target] != "function"){
                var p = rs[target].getPanel(panelId);
                if(p){
                    return p;
                }
            }
        }
        return null;
    },

    /**
     * Searches all regions for a panel with the specified id and activates (shows) it.
     * @param {String/ContentPanel} panelId The panels id or the panel itself
     * @return {Ext.ContentPanel} The shown panel or null
     */
    showPanel : function(panelId) {
      var rs = this.regions;
      for(var target in rs){
         var r = rs[target];
         if(typeof r != "function"){
            if(r.hasPanel(panelId)){
               return r.showPanel(panelId);
            }
         }
      }
      return null;
   },

   /**
     * Restores this layouts state using Ext.state.Manager or the state provided by the passed provider.
     * @param {Ext.state.Provider} provider (optional) An alternate state provider
     */
    restoreState : function(provider){
        if(!provider){
            provider = Ext.state.Manager;
        }
        var sm = new Ext.LayoutStateManager();
        sm.init(this, provider);
    },

    batchAdd : function(regions){
        this.beginUpdate();
        for(var rname in regions){
            var lr = this.regions[rname];
            if(lr){
                this.addTypedPanels(lr, regions[rname]);
            }
        }
        this.endUpdate();
    },

    /* @private */
    addTypedPanels : function(lr, ps){
        if(typeof ps == 'string'){
            lr.add(new Ext.ContentPanel(ps));
        }
        else if(Ext.isArray(ps)){
            for(var i =0, len = ps.length; i < len; i++){
                this.addTypedPanels(lr, ps[i]);
            }
        }
        else if(!ps.events){ // raw config?
            var el = ps.el;
            delete ps.el; // prevent conflict
            lr.add(new Ext.ContentPanel(el || Ext.id(), ps));
        }
        else {  // panel object assumed!
            lr.add(ps);
        }
    }
});

Ext.BorderLayout.create = function(config, targetEl){
    var layout = new Ext.BorderLayout(targetEl || document.body, config);
    layout.beginUpdate();
    var regions = Ext.BorderLayout.RegionFactory.validRegions;
    for(var j = 0, jlen = regions.length; j < jlen; j++){
        var lr = regions[j];
        if(layout.regions[lr] && config[lr].panels){
            var r = layout.regions[lr];
            var ps = config[lr].panels;
            layout.addTypedPanels(r, ps);
        }
    }
    layout.endUpdate();
    return layout;
};

Ext.BorderLayout.RegionFactory = {
    validRegions : ["north","south","east","west","center"],

    create : function(target, mgr, config){
        target = target.toLowerCase();
        if(config.lightweight || config.basic){
            return new Ext.BasicLayoutRegion(mgr, config, target);
        }
        switch(target){
            case "north":
                return new Ext.NorthLayoutRegion(mgr, config);
            case "south":
                return new Ext.SouthLayoutRegion(mgr, config);
            case "east":
                return new Ext.EastLayoutRegion(mgr, config);
            case "west":
                return new Ext.WestLayoutRegion(mgr, config);
            case "center":
                return new Ext.CenterLayoutRegion(mgr, config);
        }
        throw 'Layout region "'+target+'" not supported.';
    }
};


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

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

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

    /**
     *

     * Name of the Amazon SageMaker endpoint configuration.
     *

     */
    private String endpointConfigName;
    /**
     *

     * The Amazon Resource Name (ARN) of the endpoint configuration.
     *

     */
    private String endpointConfigArn;
    /**
     *

     * An array of ProductionVariant objects, one for each model that you want to host at this endpoint.
     *

     */
    private java.util.List<ProductionVariant> productionVariants;
    /**
     *

     * AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to the
     * instance.
     *

     */
    private String kmsKeyId;
    /**
     *

     * A timestamp that shows when the endpoint configuration was created.
     *

     */
    private java.util.Date creationTime;

    /**
     *

     * Name of the Amazon SageMaker endpoint configuration.
     *

     *
     * @param endpointConfigName
     *        Name of the Amazon SageMaker endpoint configuration.
     */

    public void setEndpointConfigName(String endpointConfigName) {
        this.endpointConfigName = endpointConfigName;
    }

    /**
     *

     * Name of the Amazon SageMaker endpoint configuration.
     *

     *
     * @return Name of the Amazon SageMaker endpoint configuration.
     */

    public String getEndpointConfigName() {
        return this.endpointConfigName;
    }

    /**
     *

     * Name of the Amazon SageMaker endpoint configuration.
     *

     *
     * @param endpointConfigName
     *        Name of the Amazon SageMaker endpoint configuration.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeEndpointConfigResult withEndpointConfigName(String endpointConfigName) {
        setEndpointConfigName(endpointConfigName);
        return this;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the endpoint configuration.
     *

     *
     * @param endpointConfigArn
     *        The Amazon Resource Name (ARN) of the endpoint configuration.
     */

    public void setEndpointConfigArn(String endpointConfigArn) {
        this.endpointConfigArn = endpointConfigArn;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the endpoint configuration.
     *

     *
     * @return The Amazon Resource Name (ARN) of the endpoint configuration.
     */

    public String getEndpointConfigArn() {
        return this.endpointConfigArn;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the endpoint configuration.
     *

     *
     * @param endpointConfigArn
     *        The Amazon Resource Name (ARN) of the endpoint configuration.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeEndpointConfigResult withEndpointConfigArn(String endpointConfigArn) {
        setEndpointConfigArn(endpointConfigArn);
        return this;
    }

    /**
     *

     * An array of ProductionVariant objects, one for each model that you want to host at this endpoint.
     *

     *
     * @return An array of ProductionVariant objects, one for each model that you want to host at this
     *         endpoint.
     */

    public java.util.List<ProductionVariant> getProductionVariants() {
        return productionVariants;
    }

    /**
     *

     * An array of ProductionVariant objects, one for each model that you want to host at this endpoint.
     *

     *
     * @param productionVariants
     *        An array of ProductionVariant objects, one for each model that you want to host at this
     *        endpoint.
     */

    public void setProductionVariants(java.util.Collection<ProductionVariant> productionVariants) {
        if (productionVariants == null) {
            this.productionVariants = null;
            return;
        }

        this.productionVariants = new java.util.ArrayList<ProductionVariant>(productionVariants);
    }

    /**
     *

     * An array of ProductionVariant objects, one for each model that you want to host at this endpoint.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setProductionVariants(java.util.Collection)} or {@link #withProductionVariants(java.util.Collection)} if
     * you want to override the existing values.
     *

     *
     * @param productionVariants
     *        An array of ProductionVariant objects, one for each model that you want to host at this
     *        endpoint.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeEndpointConfigResult withProductionVariants(ProductionVariant... productionVariants) {
        if (this.productionVariants == null) {
            setProductionVariants(new java.util.ArrayList<ProductionVariant>(productionVariants.length));
        }
        for (ProductionVariant ele : productionVariants) {
            this.productionVariants.add(ele);
        }
        return this;
    }

    /**
     *

     * An array of ProductionVariant objects, one for each model that you want to host at this endpoint.
     *

     *
     * @param productionVariants
     *        An array of ProductionVariant objects, one for each model that you want to host at this
     *        endpoint.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeEndpointConfigResult withProductionVariants(java.util.Collection<ProductionVariant> productionVariants) {
        setProductionVariants(productionVariants);
        return this;
    }

    /**
     *

     * AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to the
     * instance.
     *

     *
     * @param kmsKeyId
     *        AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to
     *        the instance.
     */

    public void setKmsKeyId(String kmsKeyId) {
        this.kmsKeyId = kmsKeyId;
    }

    /**
     *

     * AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to the
     * instance.
     *

     *
     * @return AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to
     *         the instance.
     */

    public String getKmsKeyId() {
        return this.kmsKeyId;
    }

    /**
     *

     * AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to the
     * instance.
     *

     *
     * @param kmsKeyId
     *        AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to
     *        the instance.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeEndpointConfigResult withKmsKeyId(String kmsKeyId) {
        setKmsKeyId(kmsKeyId);
        return this;
    }

    /**
     *

     * A timestamp that shows when the endpoint configuration was created.
     *

     *
     * @param creationTime
     *        A timestamp that shows when the endpoint configuration was created.
     */

    public void setCreationTime(java.util.Date creationTime) {
        this.creationTime = creationTime;
    }

    /**
     *

     * A timestamp that shows when the endpoint configuration was created.
     *

     *
     * @return A timestamp that shows when the endpoint configuration was created.
     */

    public java.util.Date getCreationTime() {
        return this.creationTime;
    }

    /**
     *

     * A timestamp that shows when the endpoint configuration was created.
     *

     *
     * @param creationTime
     *        A timestamp that shows when the endpoint configuration was created.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeEndpointConfigResult withCreationTime(java.util.Date creationTime) {
        setCreationTime(creationTime);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getEndpointConfigName() != null)
            sb.append("EndpointConfigName: ").append(getEndpointConfigName()).append(",");
        if (getEndpointConfigArn() != null)
            sb.append("EndpointConfigArn: ").append(getEndpointConfigArn()).append(",");
        if (getProductionVariants() != null)
            sb.append("ProductionVariants: ").append(getProductionVariants()).append(",");
        if (getKmsKeyId() != null)
            sb.append("KmsKeyId: ").append(getKmsKeyId()).append(",");
        if (getCreationTime() != null)
            sb.append("CreationTime: ").append(getCreationTime());
        sb.append("}");
        return sb.toString();
    }

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

        if (obj instanceof DescribeEndpointConfigResult == false)
            return false;
        DescribeEndpointConfigResult other = (DescribeEndpointConfigResult) obj;
        if (other.getEndpointConfigName() == null ^ this.getEndpointConfigName() == null)
            return false;
        if (other.getEndpointConfigName() != null && other.getEndpointConfigName().equals(this.getEndpointConfigName()) == false)
            return false;
        if (other.getEndpointConfigArn() == null ^ this.getEndpointConfigArn() == null)
            return false;
        if (other.getEndpointConfigArn() != null && other.getEndpointConfigArn().equals(this.getEndpointConfigArn()) == false)
            return false;
        if (other.getProductionVariants() == null ^ this.getProductionVariants() == null)
            return false;
        if (other.getProductionVariants() != null && other.getProductionVariants().equals(this.getProductionVariants()) == false)
            return false;
        if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null)
            return false;
        if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false)
            return false;
        if (other.getCreationTime() == null ^ this.getCreationTime() == null)
            return false;
        if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false)
            return false;
        return true;
    }

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

        hashCode = prime * hashCode + ((getEndpointConfigName() == null) ? 0 : getEndpointConfigName().hashCode());
        hashCode = prime * hashCode + ((getEndpointConfigArn() == null) ? 0 : getEndpointConfigArn().hashCode());
        hashCode = prime * hashCode + ((getProductionVariants() == null) ? 0 : getProductionVariants().hashCode());
        hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode());
        hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
        return hashCode;
    }

    @Override
    public DescribeEndpointConfigResult clone() {
        try {
            return (DescribeEndpointConfigResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text: VKontakte music sample app build on top of Angular


text:
package ironlionchefs.modjam.items.essence.tools.med;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class MedEssencePickaxe extends ItemPickaxe
{

	public MedEssencePickaxe(int par1)
	{
		super(par1, EnumToolMaterial.IRON);
	}

	public boolean hasEffect(ItemStack s)
	{
		return true;
	}

	@Override
	public void onCreated(ItemStack is, World w, EntityPlayer ep)
	{
		is.addEnchantment(Enchantment.efficiency, 2);
		is.addEnchantment(Enchantment.fortune, 2);
	}

	@SideOnly(Side.CLIENT)
	public void registerIcons(IconRegister register)
	{
		this.itemIcon = register.registerIcon("ModJam:MedEssencePickaxe");
		this.setUnlocalizedName("Normal Essence Pickaxe");
	}
}


text:
require "cli/parser"

module Homebrew
  extend T::Sig

  module_function

  sig { returns(CLI::Parser) }
  def analytics_args
    Homebrew::CLI::Parser.new do
      usage_banner <<~EOS
        `analytics` [<subcommand>]

        Control Homebrew's anonymous aggregate user behaviour analytics.
        Read more at <https://docs.brew.sh/Analytics>.

        `brew analytics` [`state`]:
        Display the current state of Homebrew's analytics.

        `brew analytics` (`on`|`off`):
        Turn Homebrew's analytics on or off respectively.

        `brew analytics regenerate-uuid`:
        Regenerate the UUID used for Homebrew's analytics.
      EOS

      max_named 1
    end
  end

  def analytics
    args = analytics_args.parse

    case args.named.first
    when nil, "state"
      if Utils::Analytics.disabled?
        puts "Analytics are disabled."
      else
        puts "Analytics are enabled."
        puts "UUID: #{Utils::Analytics.uuid}" if Utils::Analytics.uuid.present?
      end
    when "on"
      Utils::Analytics.enable!
    when "off"
      Utils::Analytics.disable!
    when "regenerate-uuid"
      Utils::Analytics.regenerate_uuid!
    else
      raise UsageError, "unknown subcommand: #{args.named.first}"
    end
  end
end


text:
from __future__ import absolute_import, print_function, division

import contextlib
import sys
import warnings

import numpy as np

from numba import unittest_support as unittest
from numba import vectorize, guvectorize
from numba.numpy_support import version as np_version

from ..support import TestCase

def sqrt(val):
    if val < 0.0:
        raise ValueError('Value must be positive')
    return val ** 0.5

def gufunc_foo(inp, n, out):
    for i in range(inp.shape[0]):
        if inp[i] < 0:
            raise ValueError('Value must be positive')
        out[i] = inp[i] * n[0]

def truediv(a, b):
    return a / b

def floordiv(a, b):
    return a // b

def remainder(a, b):
    return a % b

def power(a, b):
    return a ** b

# See https://github.com/numpy/numpy/pull/3691
skipIfFPStatusBug = unittest.skipIf(
    sys.platform == 'win32' and np_version < (1, 8) and sys.maxsize < 2 ** 32,
    "test disabled because of FPU state handling issue on Numpy < 1.8")

class TestExceptions(TestCase):
    """
    Test raising exceptions inside ufuncs.
    """

    def check_ufunc_raise(self, **vectorize_args):
        f = vectorize(['float64(float64)'], **vectorize_args)(sqrt)
        arr = np.array([1, 4, -2, 9, -1, 16], dtype=np.float64)
        out = np.zeros_like(arr)
        with self.assertRaises(ValueError) as cm:
            f(arr, out)
        self.assertIn('Value must be positive', str(cm.exception))
        # All values were computed except for the ones giving an error
        self.assertEqual(list(out), [1, 2, 0, 3, 0, 4])

    def test_ufunc_raise(self):
        self.check_ufunc_raise(nopython=True)

    def test_ufunc_raise_objmode(self):
        self.check_ufunc_raise(forceobj=True)

    def check_gufunc_raise(self, **vectorize_args):
        f = guvectorize(['int32[:], int32[:], int32[:]'], '(n),()->(n)',
                        **vectorize_args)(gufunc_foo)
        arr = np.array([1, 2, -3, 4], dtype=np.int32)
        out = np.zeros_like(arr)
        with self.assertRaises(ValueError) as cm:
            f(arr, 2, out)
        # The gufunc bailed out after the error
        self.assertEqual(list(out), [2, 4, 0, 0])

    def test_gufunc_raise(self):
        self.check_gufunc_raise(nopython=True)

    def test_gufunc_raise_objmode(self):
        self.check_gufunc_raise(forceobj=True)

class TestFloatingPointExceptions(TestCase):
    """
    Test floating-point exceptions inside ufuncs.

    Note the warnings emitted by Numpy reflect IEEE-754 semantics.
    """

    @contextlib.contextmanager
    def check_warnings(self, messages, category=RuntimeWarning):
        with warnings.catch_warnings(record=True) as catch:
            warnings.simplefilter("always")
            yield
        # Check warnings for 1/0 and 0/0
        found = 0
        for w in catch:
            for m in messages:
                if m in str(w.message):
                    self.assertEqual(w.category, category)
                    found += 1
        self.assertEqual(found, len(messages))

    @skipIfFPStatusBug
    def check_truediv_real(self, dtype):
        """
        Test 1 / 0 and 0 / 0.
        """
        f = vectorize(nopython=True)(truediv)
        a = np.array([5., 6., 0., 8.], dtype=dtype)
        b = np.array([1., 0., 0., 4.], dtype=dtype)
        expected = np.array([5., float('inf'), float('nan'), 2.])
        with self.check_warnings(["divide by zero encountered",
                                  "invalid value encountered"]):
            res = f(a, b)
            self.assertPreciseEqual(res, expected)

    def test_truediv_float(self):
        self.check_truediv_real(np.float64)

    def test_truediv_integer(self):
        self.check_truediv_real(np.int32)

    @skipIfFPStatusBug
    def check_divmod_float(self, pyfunc, values, messages):
        """
        Test 1 // 0 and 0 // 0.
        """
        f = vectorize(nopython=True)(pyfunc)
        a = np.array([5., 6., 0., 9.])
        b = np.array([1., 0., 0., 4.])
        expected = np.array(values)
        with self.check_warnings(messages):
            res = f(a, b)
            self.assertPreciseEqual(res, expected)

    def test_floordiv_float(self):
        self.check_divmod_float(floordiv,
                                [5.0, float('inf'), float('nan'), 2.0],
                                ["divide by zero encountered",
                                 "invalid value encountered"])

    def test_remainder_float(self):
        self.check_divmod_float(remainder,
                                [0.0, float('nan'), float('nan'), 1.0],
                                ["invalid value encountered"])

    def check_divmod_int(self, pyfunc, values):
        """
        Test 1 % 0 and 0 % 0.
        """
        f = vectorize(nopython=True)(pyfunc)
        a = np.array([5, 6, 0, 9])
        b = np.array([1, 0, 0, 4])
        expected = np.array(values)
        # No warnings raised because LLVM makes it difficult
        with self.check_warnings([]):
            res = f(a, b)
            self.assertPreciseEqual(res, expected)

    def test_floordiv_int(self):
        self.check_divmod_int(floordiv, [5, 0, 0, 2])

    def test_remainder_int(self):
        self.check_divmod_int(remainder, [0, 0, 0, 1])

    @skipIfFPStatusBug
    def test_power_float(self):
        """
        Test 0 ** -1 and 2 ** <big number>.
        """
        f = vectorize(nopython=True)(power)
        a = np.array([5., 0., 2., 8.])
        b = np.array([1., -1., 1e20, 4.])
        expected = np.array([5., float('inf'), float('inf'), 4096.])
        with self.check_warnings(["divide by zero encountered",
                                  "overflow encountered"]):
            res = f(a, b)
            self.assertPreciseEqual(res, expected)

    def test_power_integer(self):
        """
        Test 0 ** -1.
        Note 2 ** <big number> returns an undefined value (depending
        on the algorithm).
        """
        dtype = np.int64
        f = vectorize(["int64(int64, int64)"], nopython=True)(power)
        a = np.array([5, 0, 6], dtype=dtype)
        b = np.array([1, -1, 2], dtype=dtype)
        expected = np.array([5, -2**63, 36], dtype=dtype)
        with self.check_warnings([]):
            res = f(a, b)
            self.assertPreciseEqual(res, expected)

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


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Lacarrera extends CI_Controller {
	function __construct(){
		parent::__construct();
		$this->load->helper('url');
		$this->load->model('participantes_model');

	}

	function index(){
		$data['title'] = 'San Silvestre';
		$data['main_content'] = 'inicio';
		$this->load->view('template',$data);

	}

	public function inicio(){
		$data['title'] = 'Inicio';
		$data['main_content'] = 'inicio';
		$this->load->view('template',$data);

	}

	public function nosotros(){
		$data['title'] = 'Nosotros';
		$data['main_content'] = 'nosotros';
		$this->load->view('template',$data);

	}

	public function recorridos(){
		$data['title'] = 'Recorridos';
		$data['main_content'] = 'recorrido_2';
		$this->load->view('template',$data);

	}

	public function premios(){
		echo 'Premios';

	}

	public function contacto(){
		$data['title'] = 'Contacto';
		$data['main_content'] = 'contacto';
		$this->load->view('template',$data);

	}

	public function historia(){
		$data['title'] = 'Historia';
		$data['main_content'] = 'historia';
		$this->load->view('template',$data);

	}

	public function croquis(){
		$data['title'] = 'Croquis';
		$data['main_content'] = 'croquis';
		$this->load->view('template',$data);

	}

}
?>


text:
import React from 'react'
import { VictoryChart, VictoryLine } from 'victory/dist/victory'
import Resizable from 'react-resizable-box'
import ContainerDimensions from 'react-container-dimensions'
export default <Resizable width={800} height={400} customClass="border">
    <ContainerDimensions>
      { ({ width, height }) => (
        <VictoryChart width={width} height={height}>
          <VictoryLine y={(data) => Math.sin(1.5 * Math.PI * data.x)}/>
        </VictoryChart>
      )}
    </ContainerDimensions>
  </Resizable>


text:
<?php
namespace GamerFind\Services\GamerList;

use GuzzleHttp\Client as Guzzle;
use Predis;

class Client
{
    /**
     * @var Predis\Client
     */
    protected $redisClient;

    public function getGames($name = null, $platform = null, $genre = null)
    {
        $key = "getGames-" . md5(json_encode(func_get_args()));
        $xml = $this->getCache($key);
        if(!$xml) {
            $http = new Guzzle();
            $resp = $http->get(Settings::gamerList($name, $platform, $genre));
            $xml = $resp->getBody();
            $result = $this->xmlToArray($xml);
            $this->cache($key, json_encode($result));
        } else {
            $result = json_decode($xml);
        }

        foreach($result as $myArray) {
            foreach($myArray as $game) {
                $this->addGame($platform, $game);
            }
        }
    }

    public function xmlToArray($xml)
    {
        $xml = simplexml_load_string($xml);
        $json = json_encode($xml);
        return json_decode($json,TRUE);
    }

    public function cache($key, $response)
    {
        $client = $this->getRedisClient();
        $client->set($key, $response);
    }

    public function getCache($key)
    {
        $client = $this->getRedisClient();
        return $client->get($key);
    }

    public function recentlyProcessed($caller)
    {
        return (time() - $this->redisClient->get($caller) > 500);
    }

    public function setProcessed($caller)
    {
        $client = $this->getRedisClient();
        $client->set($caller, time());
    }

    public function getRedisClient()
    {
        if(! $this->redisClient instanceof Predis\Client) {
            $this->redisClient = new Predis\Client();
        }

        return $this->redisClient;
    }

    public function addGame($platform, $game)
    {
        if(!$game->ReleaseDate) {
            $game->ReleaseDate = "unknown";
        }

        $gameName = $game->GameTitle . " (" . $game->ReleaseDate . ")";
        $client = $this->getRedisClient();
        $client->executeRaw(['ZADD', "games:{$platform}", 0, $gameName]);
    }
}


text:
# API documentation generator
----

This tool generates documentation for the LWM2M device management server REST API by using reflection to gather assemblies
from an Imagination.DeviceServer executable, reading metadata from any class that extends ControllerBase and serialising
a filtered subset of required metadata into requested output formats.

This tool currently supports RAML 0.8 serialisation.

##  Getting started

Run the following command for help on how to run the tool:

`Imagination.APIDocGenerator -h`

Refer to **appsettings.json** for tool configuration settings.

_Note: In order to use this tool, the Device Server must first be built._

## Development tasks

- Implement RAML 1.0 serialiser
- Implement Swagger YAML and JSON serialisers


text:
A program to solve sliding tile puzzles in as few moves as possible

This is a puzzle I've been working on recently to solve a sliding tile puzzle in as few moves as possible.  An example of this sort of puzzle is found here - http://mypuzzle.org/sliding.

If anyone has any feedback or good ideas on how I can improve it I'd really appreciate it.

My current ideas are
* I think my PossibleSolutions object could be an extension of the PuzzleState object.
  - I feel this would cut down on some of the code required to complete the problem and possibly make the objects easier     to manage.
* I have found a video of someone solving a puzzle like this on youtube - https://www.youtube.com/watch?v=yRyGidQwcOQ
  - I like the idea of using this method to solve the problem and think it would cut down on the time required to find a     solution.  However the solution found would probably not be the least number of moves, just a quicker way to find a      one.
  - I think I could do this by search for a complete first row.  Remove all the other possible solutions and restart         looking for a complete first column, then work my way in alternating rows and columns.
  - This would probably form another branch of the project.

Does anyone know of any ways to find the solution with the fewest number of moves without using brute force? Or any other way to improve?

If you intend to try out my code, please check the descriptions or JavaDocs for how to input data representing the state of the puzzle.


text:
<?php

/**
 * @file
 * Definition of Drupal\Component\Gettext\PoStreamInterface.
 */

/**
 * Common functions for file/stream based PO readers/writers.
 *
 * @see PoReaderInterface
 * @see PoWriterInterface
 */
interface PoStreamInterface {

  /**
   * Open the stream. Set the URI for the stream earlier with setURI().
   */
  public function open();

  /**
   * Close the stream.
   */
  public function close();

  /**
   * Get the URI of the PO stream that is being read or written.
   *
   * @return string
   *   URI string for this stream.
   */
  public function getURI();

  /**
   * Set the URI of the PO stream that is going to be read or written.
   *
   * @param string $uri
   *   URI string to set for this stream.
   */
  public function setURI($uri);

}


text:
package armcustomerinsights_test

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customerinsights/armcustomerinsights"
)

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/customer-insights/resource-manager/Microsoft.CustomerInsights/stable/2017-04-26/examples/RelationshipsCreateOrUpdate.json
func ExampleRelationshipsClient_BeginCreateOrUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcustomerinsights.NewRelationshipsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginCreateOrUpdate(ctx,
		"TestHubRG",
		"sdkTestHub",
		"SomeRelationship",
		armcustomerinsights.RelationshipResourceFormat{
			Properties: &armcustomerinsights.RelationshipDefinition{
				Description: map[string]*string{
					"en-us": to.Ptr("Relationship Description"),
				},
				Cardinality: to.Ptr(armcustomerinsights.CardinalityTypesOneToOne),
				DisplayName: map[string]*string{
					"en-us": to.Ptr("Relationship DisplayName"),
				},
				Fields:             []*armcustomerinsights.PropertyDefinition{},
				ProfileType:        to.Ptr("testProfile2326994"),
				RelatedProfileType: to.Ptr("testProfile2326994"),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// TODO: use response item
	_ = res
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/customer-insights/resource-manager/Microsoft.CustomerInsights/stable/2017-04-26/examples/RelationshipsGet.json
func ExampleRelationshipsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcustomerinsights.NewRelationshipsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"TestHubRG",
		"sdkTestHub",
		"SomeRelationship",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/customer-insights/resource-manager/Microsoft.CustomerInsights/stable/2017-04-26/examples/RelationshipsDelete.json
func ExampleRelationshipsClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcustomerinsights.NewRelationshipsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginDelete(ctx,
		"TestHubRG",
		"sdkTestHub",
		"SomeRelationship",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/customer-insights/resource-manager/Microsoft.CustomerInsights/stable/2017-04-26/examples/RelationshipsListByHub.json
func ExampleRelationshipsClient_NewListByHubPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcustomerinsights.NewRelationshipsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByHubPager("TestHubRG",
		"sdkTestHub",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}