text:
<?php

defined('_JEXEC') or die('Restricted access');// no direct access

// load tooltip behavior
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
?>

<form action="<?php echo JRoute::_('index.php?option=com_centralsms&view=recipient&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate">
	<fieldset class="adminform">
		<legend><?php echo JText::_( 'COM_CENTRALSMS_RECIPIENT_DETAILS' ); ?></legend>

			<?php foreach($this->form->getFieldset() as $field): ?>

<?php echo $field->label;echo $field->input;?>

			<?php endforeach; ?>

	</fieldset>

		<input type="hidden" name="task" value="centralsms.edit" />
		<?php echo JHtml::_('form.token'); ?>

</form>


text:
package com.easternedgerobotics.rov.io;

import com.easternedgerobotics.rov.value.SpeedValue;

import rx.Observable;

/**
 * See the Sabertooth 2x5 RC
 * User's Guide for more information.
 */
public final class Motor {
    /**
     * Max forward PWM signal value (in μs) for the connected to the Sabertooth 2x5 motor controller.
     */
    public static final float MAX_FWD = 2500;

    /**
     * Max reverse PWM signal value (in μs) for the connected to the Sabertooth 2x5 motor controller.
     */
    public static final float MAX_REV = 500;

    /**
     * The output PWM device to write speeds using.
     */
    private final PWM device;

    /**
     * The latest value from the speed observable.
     */
    private SpeedValue value;

    /**
     * Create a Motor device which uses a pololu channel for communication.
     *
     * @param values speed observable mapped to the pololu channel
     * @param device PWM output to write speeds
     */
    public Motor(final Observable<SpeedValue> values, final PWM device) {
        this.device = device;
        values.subscribe(v -> value = v);
    }

    /**
     * Write the latest {@code SpeedValue} for this motor to the device.
     */
    public final void write() {
        device.write(value.getSpeed());
    }

    /**
     * Write zero to the motor.
     */
    public final void writeZero() {
        device.writeZero();
    }
}

redpajama_set_name: RedPajamaGithub


text: export { default } from './src/component';


text:
import unittest
from StringIO import StringIO

import sdv
import sdv.errors as errors
from sdv.validators.stix.profile import InstanceMapping

STIX_NO_VERSION_XML = \
"""
<stix:STIX_Package
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:stix="http://stix.mitre.org/stix-1"
    >
    <stix:STIX_Header>
        <stix:Title>Unknown version of STIX</stix:Title>
    </stix:STIX_Header>
</stix:STIX_Package>
"""

class STIXProfileTests(unittest.TestCase):
    def test_invalid_profile(self):
        xml = StringIO(STIX_NO_VERSION_XML)
        func = sdv.validate_profile
        self.assertRaises(errors.ProfileParseError, func, xml, "INVALID Profile DOC")

class InstanceMappingTests(unittest.TestCase):
    _NSMAP = {
        'http://stix.mitre.org/stix-1': 'stix'
    }
    _NAMESPACE = "http://stix.mitre.org/stix-1"
    _SELECTORS = "stix:STIX_Package, //stix:Package"
    _LABEL = "STIXType"

    def test_missing_label(self):
        mapping = InstanceMapping(self._NSMAP)
        mapping.selectors = "stix:STIX_Package, //stix:Package"
        mapping.namespace = self._NAMESPACE
        self.assertRaises(errors.ProfileParseError, mapping.validate)

    def test_missing_namespace(self):
        mapping = InstanceMapping(self._NSMAP)
        mapping.selectors = "stix:STIX_Package, //stix:Package"
        mapping.label = "STIXType"
        self.assertRaises(errors.ProfileParseError, mapping.validate)

    def test_invalid_namespace(self):
        mapping = InstanceMapping(self._NSMAP)
        mapping.selectors = "stix:STIX_Package, //stix:Package"
        mapping.label = "STIXType"

        def set_namespace():
            mapping.namespace = "this will fail"

        self.assertRaises(errors.ProfileParseError, set_namespace)

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


text:
package com.facebook.hive.udf;

import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.exec.FunctionRegistry;
import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.AggregationBuffer;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFResolver;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
import org.apache.hadoop.io.Text;

import java.util.List;

/**
 * Aggregate the elements of the first argument (array) using the function
 * named in the second argument.  The function should be expressed as a string,
 * e.g., 'SUM' for the SUM function.  If the input array is NULL the NULL is
 * returned.  Otherwise, NULL behavior is as defined by the referenced
 * aggregation function.  The second argument should be constant and never
 * NULL.
 *
 * Because of limitations in Hive, the return type of the UDAF cannot be
 * determined in advance.  Therefore the return type will be the same as the
 * element type of the input array.  An attempt is made to coerce the output of
 * the UDAF to the element type.  Additionally, the referenced function must be
 * unary.
 */
@Description(name = "array_aggregate",
             value = "_FUNC_(array, function) - Aggregate elements of the array"+
                                              " using the function in the UDAF.")
public class UDFArrayAggregate extends GenericUDF {
  private ListObjectInspector listOI = null;
  private ObjectInspector stringOI = null;
  private ObjectInspector elementOI = null;
  private GenericUDAFEvaluator evaluator = null;
  private ObjectInspectorConverters.Converter converter = null;
  private AggregationBuffer buffer = null;
  private Object[] inputArray = new Object[1];

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments)
    throws UDFArgumentException {

    listOI = (ListObjectInspector)arguments[0];
    stringOI = arguments[1];
    elementOI = ObjectInspectorUtils.getStandardObjectInspector(
        listOI.getListElementObjectInspector());

    // Extra special magic.  Any function which performs reflection should call
    // may have happaned in a different thread than the one in which we are
    // currently executing.  Hence the static function registry may be
    // initialized to its default value.

    return elementOI;
  }

  @Override
  public Object evaluate(DeferredObject[] arguments) throws HiveException {
    List<?> inputs = (List<?>)
      ObjectInspectorUtils.copyToStandardObject(arguments[0].get(), listOI);

    if (inputs == null) {
      return null;
    }

    if (evaluator == null) {
      Text functionName =
        (Text)ObjectInspectorUtils.copyToStandardObject(arguments[1].get(), stringOI);

      if (functionName == null) {
        throw new HiveException("Function name cannot be null.");
      }

      GenericUDAFResolver resolver =
        FunctionRegistry.getGenericUDAFResolver(functionName.toString());
      if (resolver == null) {
        throw new HiveException("Could not find function with name " +
                                functionName.toString());
      }

      ObjectInspector[] objectInspectorArray = new ObjectInspector[1];
      objectInspectorArray[0] = elementOI;

      TypeInfo[] typeInfoArray = new TypeInfo[1];
      typeInfoArray[0] =
        TypeInfoUtils.getTypeInfoFromObjectInspector(elementOI);

      evaluator = resolver.getEvaluator(typeInfoArray);
      converter = ObjectInspectorConverters.getConverter(
        evaluator.init(GenericUDAFEvaluator.Mode.COMPLETE, objectInspectorArray),
        elementOI);
      buffer = evaluator.getNewAggregationBuffer();
    }

    evaluator.reset(buffer);

    for (Object input : inputs) {
      inputArray[0] = input;
      evaluator.iterate(buffer, inputArray);
    }

    return converter.convert(evaluator.terminate(buffer));
  }

  @Override
  public String getDisplayString(String[] input) {
	  return new String();
  }
}


text:
SET(MODULE_SRC
	#Public Sources (Include/)
	Include/App/Application.h
	Include/ECS/EntityManager.h
	Include/ECS/System.h
	Include/Event/EventManager.h
	Include/Math/AABB.h
	Include/Math/Vector.h
	Include/Math/Matrix4x4.h
	Include/Platform/Clock.h
	Include/Platform/DynLib.h
	Include/Platform/Endianness.h
	Include/Platform/Export.h
	Include/Platform/Log.h
	Include/Platform/Platform.h
	Include/Platform/Predef.h
	Include/Platform/Types.h
	Include/Resource/ResourceManager.h
	Include/Renderer/AnimationSystem.h
	Include/Renderer/Renderer.h
	Include/Renderer/RendererSettings.h
	Include/Renderer/VertexBuffer.h
	Include/Scene/TransformSystem.h
	Include/Util/PackedPool.h

	# Private Sources (Source/)
	Src/App/Application.cpp
	Src/ECS/EntityMAnager.cpp
	Src/Event/EventManager.cpp
	Src/Math/AABB.cpp
	Src/Math/Matrix4x4.cpp
	Src/Math/Vector.cpp
	Src/Platform/Clock.cpp
	Src/Platform/Log.cpp
	Src/Renderer/AnimationSystem.cpp
	Src/Resource/ResourceManager.cpp
	Src/Scene/TransformSystem.cpp
	)

#
# Platform dependent sources.
#
IF (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
	SET(MODULE_PLATFORM_SRC

		)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
	SET(MODULE_PLATFORM_SRC
		)
ENDIF()

#
# Merge sources.
#
SET(MODULE_SOURCES ${MODULE_SRC} ${MODULE_PLATFORM_SRC} Sources.cmake)

#
# Define source groups.
#
SOURCE_GROUP(App "App/*")
SOURCE_GROUP(Platform "Platform/*")
SOURCE_GROUP(Renderer "Renderer/*")
SOURCE_GROUP(Scene "Scene/*")
SOURCE_GROUP(Util "Util/*")
SOURCE_GROUP(ECS "ECS/*")
SOURCE_GROUP(Log "Log/*")
SOURCE_GROUP(Math "Math/*")
SOURCE_GROUP(Event "Event/*")
SOURCE_GROUP(Resource "Resource/*")


text:
import {HttpQuery} from './HttpUtils';

describe('Unit testing of http query builder', () => {
    it('Should build a simple query of one field', () => {
        let query = new HttpQuery();
        query.addField('field1', 'value1');
        let result = query.toString();
        expect(result).toEqual('field1=value1');
    });
     it('Should build a simple query of two fields', () => {
        let query = new HttpQuery();
        query.addField('field1', 'value1');
        query.addField('field2', 'value2');
        let result = query.toString();
        expect(result).toEqual('field1=value1&field2=value2');
    });
     it('Should build a simple query of two fields using the ', () => {
        let query = new HttpQuery();
        query.addField('field1', 'value1');
        query.addField('field2', 'value2');
        let result = query.toString();
        expect(result).toEqual('field1=value1&field2=value2');
    });
    it('Should build a simple query of two fields and then delete one', () => {
        let query = new HttpQuery();
        query.addField('field1', 'value1');
        query.addField('field2', 'value2');
        let result1 = query.toString();
        query.removeField('field1');
        let result2 = query.toString();
        expect(result1).toEqual('field1=value1&field2=value2')
        expect(result2).toEqual('field2=value2');
    });
});


text:
package sourcecoded.comms2.exception;

public class NotConnectedException extends Exception {
}


text:
require 'spec_helper'

SINGLE_ITEM_RESPONSE = <<-ITEM
{"name":"First Item Name","id":"first-itemg-name","template":"first-item-template","bucket":"first-items","attributes":{"published_on":{"type":"date","value":"2012-04-27"},"content":{"type":"text","value":"
This is some content
"}}}
ITEM
MULTIPLE_ITEMS_RESPONSE = <<-ITEMS
[#{SINGLE_ITEM_RESPONSE},{"name":"Second Item Name","id":"second-itemg-name","template":"second-item-template","bucket":"second-items","attributes":{"published_on":{"type":"date","value":"2012-05-27"},"content":{"type":"text","value":"
This is second items content
"}}}]
ITEMS

describe ConveyClient::Items do
  before do
    ConveyClient.setup do |config|
      config.subdomain = "test"
      config.auth_token = nil
    end
  end

  describe ".find" do
    describe "when found" do
      before do
        ConveyClient::Request.stub!(:execute).and_return(SINGLE_ITEM_RESPONSE)
      end

      it "should return the found item" do
        item = ConveyClient::Items.find("id")
        item.name.should == "First Item Name"
      end
    end

    describe "when nothing is found" do
      before do
        ConveyClient::Request.stub!(:execute).and_return("[]")
      end

      it "should return nil" do
        ConveyClient::Items.find("id").should be_nil
      end
    end
  end

  describe ".all" do
    describe "when there is one item" do
      before do
        ConveyClient::Request.stub!(:execute).and_return(SINGLE_ITEM_RESPONSE)
      end

      it "should return an array of one" do
        ConveyClient::Items.all.length.should == 1
      end
    end

    describe "when there are multiple items" do
      before do
        ConveyClient::Request.stub!(:execute).and_return(MULTIPLE_ITEMS_RESPONSE)
        @items = ConveyClient::Items.all
      end

      it "should return an array" do
        @items.length.should == 2
      end

      it "should return the results in order" do
        @items[0].name.should == "First Item Name"
        @items[1].name.should == "Second Item Name"
      end
    end
  end

  describe ".in_bucket" do
    it "should create the appropriate request path" do
      ConveyClient::Request.should_receive(:execute).with("buckets/bucket-id/items").and_return("[]")
      ConveyClient::Items.in_bucket("bucket-id").to_a
    end
  end

  describe ".using_template" do
    it "should create the appropriate request path" do
      ConveyClient::Request.should_receive(:execute).with("templates/template-id/items").and_return("[]")
      ConveyClient::Items.using_template("template-id").to_a
    end
  end

  describe ".in_bucket_and_using_template" do
    it "should create the appropriate request path" do
      ConveyClient::Request.should_receive(:execute).with("buckets/bucket-id/templates/template-id/items").and_return("[]")
      ConveyClient::Items.in_bucket_and_using_template("bucket-id", "template-id").to_a
    end
  end

  describe "sorting" do
    it "should add the appropriate params to the request path" do
      ConveyClient::Request.should_receive(:execute).with("items?sort[key]=age&sort[dir]=asc").and_return("[]")
      ConveyClient::Items.all.sorted("age", "asc").to_a
    end
  end

  describe "querying" do
    it "should add the appropriate params to the request path" do
      ConveyClient::Request.should_receive(:execute).with("items?search[age][operator]==&search[age][value]=20").and_return("[]")
      ConveyClient::Items.all.where("age", "=", 20).to_a
    end
  end
end


text:
import {
  Cartesian3,
  Cesium3DContentGroup,
  Cesium3DTileset,
  Color,
  HeadingPitchRange,
  Multiple3DTileContent,
  MetadataClass,
  GroupMetadata,
  RequestScheduler,
  Resource,
} from "../../Source/Cesium.js";
import Cesium3DTilesTester from "../Cesium3DTilesTester.js";
import createScene from "../createScene.js";
import generateJsonBuffer from "../generateJsonBuffer.js";

describe(
  "Scene/Multiple3DTileContent",
  function () {
    let scene;

    // This scene is the same as Composite/Composite, just rephrased using multiple contents
    const centerLongitude = -1.31968;
    const centerLatitude = 0.698874;
    const multipleContentsUrl =
      "./Data/Cesium3DTiles/MultipleContents/MultipleContents/tileset_1.1.json";
    const multipleContentsLegacyUrl =
      "./Data/Cesium3DTiles/MultipleContents/MultipleContents/tileset_1.0.json";

    // Test for older version of 3DTILES_multiple_contents that uses "content" instead of "contents"
    const multipleContentsLegacyWithContentUrl =
      "./Data/Cesium3DTiles/MultipleContents/MultipleContents/tileset_1.0_content.json";

    const tilesetResource = new Resource({ url: "http://example.com" });

    const contents = [
      {
        uri: "pointcloud.pnts",
      },
      {
        uri: "batched.b3dm",
      },
      {
        uri: "gltfModel.glb",
      },
    ];

    const contentsJson = {
      contents: contents,
    };

    // legacy
    const contentJson = {
      content: contents,
    };

    function makeGltfBuffer() {
      const gltf = {
        asset: {
          version: "1.0",
        },
      };
      return generateJsonBuffer(gltf).buffer;
    }

    let originalRequestsPerServer;

    function setZoom(distance) {
      const center = Cartesian3.fromRadians(centerLongitude, centerLatitude);
      scene.camera.lookAt(center, new HeadingPitchRange(0.0, -1.57, distance));
    }

    function viewAllTiles() {
      setZoom(26.0);
    }

    function viewNothing() {
      setZoom(200.0);
    }

    beforeAll(function () {
      scene = createScene();
      // One item in each data set is always located in the center, so point the camera there
      originalRequestsPerServer = RequestScheduler.maximumRequestsPerServer;
    });

    afterAll(function () {
      scene.destroyForSpecs();
    });

    beforeEach(function () {
      RequestScheduler.maximumRequestsPerServer = originalRequestsPerServer;
      viewAllTiles();
    });

    afterEach(function () {
      scene.primitives.removeAll();
    });

    function expectRenderMultipleContents(tileset) {
      expect(scene).toPickAndCall(function (result) {
        // Pick a building
        const pickedBuilding = result;
        expect(pickedBuilding).toBeDefined();

        // Change the color of the picked building to yellow
        pickedBuilding.color = Color.clone(Color.YELLOW, pickedBuilding.color);

        // Expect the pixel color to be some shade of yellow
        Cesium3DTilesTester.expectRender(scene, tileset, function (rgba) {
          expect(rgba[0]).toBeGreaterThan(0);
          expect(rgba[1]).toBeGreaterThan(0);
          expect(rgba[2]).toEqual(0);
          expect(rgba[3]).toEqual(255);
        });

        // Both a building and instance are located at the center, hide the building and pick the instance
        pickedBuilding.show = false;

        let pickedInstance;
        expect(scene).toPickAndCall(function (result) {
          pickedInstance = result;
          expect(pickedInstance).toBeDefined();
          expect(pickedInstance).not.toEqual(pickedBuilding);
        });

        // Change the color of the picked instance to green
        pickedInstance.color = Color.clone(Color.GREEN, pickedInstance.color);

        // Expect the pixel color to be some shade of green
        Cesium3DTilesTester.expectRender(scene, tileset, function (rgba) {
          expect(rgba[0]).toEqual(0);
          expect(rgba[1]).toBeGreaterThan(0);
          expect(rgba[2]).toEqual(0);
          expect(rgba[3]).toEqual(255);
        });

        // Hide the instance, and expect the render to be blank
        pickedInstance.show = false;
        Cesium3DTilesTester.expectRenderBlank(scene, tileset);
      });
    }

    it("innerContentUrls returns the urls from object containing contents array", function () {
      const tileset = {};
      const tile = {};
      const content = new Multiple3DTileContent(
        tileset,
        tile,
        tilesetResource,
        contentsJson
      );

      expect(content.innerContentUrls).toEqual([
        "pointcloud.pnts",
        "batched.b3dm",
        "gltfModel.glb",
      ]);
    });

    it("innerContentUrls returns the urls from object containing content (legacy)", function () {
      const tileset = {};
      const tile = {};
      const content = new Multiple3DTileContent(
        tileset,
        tile,
        tilesetResource,
        contentJson
      );

      expect(content.innerContentUrls).toEqual([
        "pointcloud.pnts",
        "batched.b3dm",
        "gltfModel.glb",
      ]);
    });

    it("contentsFetchedPromise is undefined until requestInnerContents is successful", function () {
      const mockTileset = {
        statistics: {
          numberOfPendingRequests: 0,
        },
      };
      const tile = {};
      const content = new Multiple3DTileContent(
        mockTileset,
        tile,
        tilesetResource,
        contentsJson
      );

      expect(content.contentsFetchedPromise).not.toBeDefined();

      spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(function () {
        return Promise.resolve(makeGltfBuffer());
      });
      content.requestInnerContents();
      expect(content.contentsFetchedPromise).toBeDefined();
    });

    it("contentsFetchedPromise is undefined if no requests are scheduled", function () {
      const mockTileset = {
        statistics: {
          numberOfPendingRequests: 0,
        },
      };
      const tile = {};
      const content = new Multiple3DTileContent(
        mockTileset,
        tile,
        tilesetResource,
        contentsJson
      );

      expect(content.contentsFetchedPromise).not.toBeDefined();

      RequestScheduler.maximumRequestsPerServer = 2;
      content.requestInnerContents();

      expect(content.contentsFetchedPromise).not.toBeDefined();
    });

    it("requestInnerContents returns 0 if successful", function () {
      const mockTileset = {
        statistics: {
          numberOfPendingRequests: 0,
        },
      };
      const tile = {};
      const content = new Multiple3DTileContent(
        mockTileset,
        tile,
        tilesetResource,
        contentsJson
      );

      const fetchArray = spyOn(
        Resource.prototype,
        "fetchArrayBuffer"
      ).and.callFake(function () {
        return Promise.resolve(makeGltfBuffer());
      });
      expect(content.requestInnerContents()).toBe(0);
      expect(fetchArray.calls.count()).toBe(3);
    });

    it("requestInnerContents schedules no requests if there are not enough open slots", function () {
      const mockTileset = {
        statistics: {
          numberOfPendingRequests: 0,
        },
      };
      const tile = {};
      const content = new Multiple3DTileContent(
        mockTileset,
        tile,
        tilesetResource,
        contentsJson
      );

      const fetchArray = spyOn(Resource.prototype, "fetchArrayBuffer");
      RequestScheduler.maximumRequestsPerServer = 2;
      expect(content.requestInnerContents()).toBe(3);
      expect(fetchArray).not.toHaveBeenCalled();
    });

    it("resolves readyPromise", function () {
      return Cesium3DTilesTester.resolvesReadyPromise(
        scene,
        multipleContentsUrl
      );
    });

    it("renders multiple contents", function () {
      return Cesium3DTilesTester.loadTileset(scene, multipleContentsUrl).then(
        expectRenderMultipleContents
      );
    });

    it("renders multiple contents (legacy)", function () {
      return Cesium3DTilesTester.loadTileset(
        scene,
        multipleContentsLegacyUrl
      ).then(expectRenderMultipleContents);
    });

    it("renders multiple contents (legacy with 'content')", function () {
      return Cesium3DTilesTester.loadTileset(
        scene,
        multipleContentsLegacyWithContentUrl
      ).then(expectRenderMultipleContents);
    });

    it("renders valid tiles after tile failure", function () {
      const originalLoadJson = Cesium3DTileset.loadJson;
      spyOn(Cesium3DTileset, "loadJson").and.callFake(function (tilesetUrl) {
        return originalLoadJson(tilesetUrl).then(function (tilesetJson) {
          const contents = tilesetJson.root.contents;
          const badTile = {
            uri: "nonexistent.b3dm",
          };
          contents.splice(1, 0, badTile);

          return tilesetJson;
        });
      });
      return Cesium3DTilesTester.loadTileset(scene, multipleContentsUrl).then(
        expectRenderMultipleContents
      );
    });

    it("renders valid tiles after tile failure (legacy)", function () {
      const originalLoadJson = Cesium3DTileset.loadJson;
      spyOn(Cesium3DTileset, "loadJson").and.callFake(function (tilesetUrl) {
        return originalLoadJson(tilesetUrl).then(function (tilesetJson) {
          const content =
            tilesetJson.root.extensions["3DTILES_multiple_contents"].contents;
          const badTile = {
            uri: "nonexistent.b3dm",
          };
          content.splice(1, 0, badTile);

          return tilesetJson;
        });
      });
      return Cesium3DTilesTester.loadTileset(
        scene,
        multipleContentsLegacyUrl
      ).then(expectRenderMultipleContents);
    });

    it("cancelRequests cancels in-flight requests", function () {
      viewNothing();
      return Cesium3DTilesTester.loadTileset(scene, multipleContentsUrl).then(
        function (tileset) {
          viewAllTiles();
          scene.renderForSpecs();

          const multipleContents = tileset.root.content;
          multipleContents.cancelRequests();

          return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then(
            function () {
              // the content should be canceled once in total
              expect(multipleContents._cancelCount).toBe(1);
            }
          );
        }
      );
    });

    it("destroys", function () {
      return Cesium3DTilesTester.tileDestroys(scene, multipleContentsUrl);
    });

    describe("metadata", function () {
      const withGroupMetadataUrl =
        "./Data/Cesium3DTiles/MultipleContents/GroupMetadata/tileset_1.1.json";
      const withGroupMetadataLegacyUrl =
        "./Data/Cesium3DTiles/MultipleContents/GroupMetadata/tileset_1.0.json";
      const withExplicitContentMetadataUrl =
        "./Data/Cesium3DTiles/Metadata/MultipleContentsWithMetadata/tileset_1.1.json";
      const withExplicitContentMetadataLegacyUrl =
        "./Data/Cesium3DTiles/Metadata/MultipleContentsWithMetadata/tileset_1.0.json";
      const withImplicitContentMetadataUrl =
        "./Data/Cesium3DTiles/Metadata/ImplicitMultipleContentsWithMetadata/tileset_1.1.json";
      const withImplicitContentMetadataLegacyUrl =
        "./Data/Cesium3DTiles/Metadata/ImplicitMultipleContentsWithMetadata/tileset_1.0.json";

      let metadataClass;
      let groupMetadata;

      beforeAll(function () {
        metadataClass = new MetadataClass({
          id: "test",
          class: {
            properties: {
              name: {
                type: "STRING",
              },
              height: {
                type: "SCALAR",
                componentType: "FLOAT32",
              },
            },
          },
        });

        groupMetadata = new GroupMetadata({
          id: "testGroup",
          group: {
            properties: {
              name: "Test Group",
              height: 35.6,
            },
          },
          class: metadataClass,
        });
      });

      it("group metadata returns undefined", function () {
        return Cesium3DTilesTester.loadTileset(scene, multipleContentsUrl).then(
          function (tileset) {
            const content = tileset.root.content;
            expect(content.group).not.toBeDefined();
          }
        );
      });

      it("assigning group metadata throws", function () {
        return Cesium3DTilesTester.loadTileset(scene, multipleContentsUrl).then(
          function (tileset) {
            expect(function () {
              const content = tileset.root.content;
              content.group = new Cesium3DContentGroup({
                metadata: groupMetadata,
              });
            }).toThrowDeveloperError();
          }
        );
      });

      it("initializes group metadata for inner contents", function () {
        return Cesium3DTilesTester.loadTileset(
          scene,
          withGroupMetadataUrl
        ).then(function (tileset) {
          const multipleContents = tileset.root.content;
          const innerContents = multipleContents.innerContents;

          const buildingsContent = innerContents[0];
          let groupMetadata = buildingsContent.group.metadata;
          expect(groupMetadata).toBeDefined();
          expect(groupMetadata.getProperty("color")).toEqual(
            new Cartesian3(255, 127, 0)
          );
          expect(groupMetadata.getProperty("priority")).toBe(10);
          expect(groupMetadata.getProperty("isInstanced")).toBe(false);

          const cubesContent = innerContents[1];
          groupMetadata = cubesContent.group.metadata;
          expect(groupMetadata).toBeDefined();
          expect(groupMetadata.getProperty("color")).toEqual(
            new Cartesian3(0, 255, 127)
          );
          expect(groupMetadata.getProperty("priority")).toBe(5);
          expect(groupMetadata.getProperty("isInstanced")).toBe(true);
        });
      });

      it("initializes group metadata for inner contents (legacy)", function () {
        return Cesium3DTilesTester.loadTileset(
          scene,
          withGroupMetadataLegacyUrl
        ).then(function (tileset) {
          const multipleContents = tileset.root.content;
          const innerContents = multipleContents.innerContents;

          const buildingsContent = innerContents[0];
          let groupMetadata = buildingsContent.group.metadata;
          expect(groupMetadata).toBeDefined();
          expect(groupMetadata.getProperty("color")).toEqual(
            new Cartesian3(255, 127, 0)
          );
          expect(groupMetadata.getProperty("priority")).toBe(10);
          expect(groupMetadata.getProperty("isInstanced")).toBe(false);

          const cubesContent = innerContents[1];
          groupMetadata = cubesContent.group.metadata;
          expect(groupMetadata).toBeDefined();
          expect(groupMetadata.getProperty("color")).toEqual(
            new Cartesian3(0, 255, 127)
          );
          expect(groupMetadata.getProperty("priority")).toBe(5);
          expect(groupMetadata.getProperty("isInstanced")).toBe(true);
        });
      });

      it("content metadata returns undefined", function () {
        return Cesium3DTilesTester.loadTileset(scene, multipleContentsUrl).then(
          function (tileset) {
            const content = tileset.root.content;
            expect(content.metadata).not.toBeDefined();
          }
        );
      });

      it("assigning content metadata throws", function () {
        return Cesium3DTilesTester.loadTileset(scene, multipleContentsUrl).then(
          function (tileset) {
            expect(function () {
              const content = tileset.root.content;
              content.metadata = {};
            }).toThrowDeveloperError();
          }
        );
      });

      it("initializes explicit content metadata for inner contents", function () {
        return Cesium3DTilesTester.loadTileset(
          scene,
          withExplicitContentMetadataUrl
        ).then(function (tileset) {
          const multipleContents = tileset.root.content;
          const innerContents = multipleContents.innerContents;

          const batchedContent = innerContents[0];
          const batchedMetadata = batchedContent.metadata;
          expect(batchedMetadata).toBeDefined();
          expect(batchedMetadata.getProperty("highlightColor")).toEqual(
            new Cartesian3(0, 0, 255)
          );
          expect(batchedMetadata.getProperty("author")).toEqual("Cesium");

          const instancedContent = innerContents[1];
          const instancedMetadata = instancedContent.metadata;
          expect(instancedMetadata).toBeDefined();
          expect(instancedMetadata.getProperty("numberOfInstances")).toEqual(
            50
          );
          expect(instancedMetadata.getProperty("author")).toEqual(
            "Sample Author"
          );
        });
      });

      it("initializes explicit content metadata for inner contents (legacy)", function () {
        return Cesium3DTilesTester.loadTileset(
          scene,
          withExplicitContentMetadataLegacyUrl
        ).then(function (tileset) {
          const multipleContents = tileset.root.content;
          const innerContents = multipleContents.innerContents;

          const batchedContent = innerContents[0];
          const batchedMetadata = batchedContent.metadata;
          expect(batchedMetadata).toBeDefined();
          expect(batchedMetadata.getProperty("highlightColor")).toEqual(
            new Cartesian3(0, 0, 255)
          );
          expect(batchedMetadata.getProperty("author")).toEqual("Cesium");

          const instancedContent = innerContents[1];
          const instancedMetadata = instancedContent.metadata;
          expect(instancedMetadata).toBeDefined();
          expect(instancedMetadata.getProperty("numberOfInstances")).toEqual(
            50
          );
          expect(instancedMetadata.getProperty("author")).toEqual(
            "Sample Author"
          );
        });
      });

      it("initializes implicit content metadata for inner contents", function () {
        return Cesium3DTilesTester.loadTileset(
          scene,
          withImplicitContentMetadataUrl
        ).then(function (tileset) {
          const placeholderTile = tileset.root;
          const subtreeRootTile = placeholderTile.children[0];

          // This retrieves the tile at (1, 1, 1)
          const subtreeChildTile = subtreeRootTile.children[0];

          const multipleContents = subtreeChildTile.content;
          const innerContents = multipleContents.innerContents;

          const buildingContent = innerContents[0];
          const buildingMetadata = buildingContent.metadata;
          expect(buildingMetadata).toBeDefined();
          expect(buildingMetadata.getProperty("height")).toEqual(50);
          expect(buildingMetadata.getProperty("color")).toEqual(
            new Cartesian3(0, 0, 255)
          );

          const treeContent = innerContents[1];
          const treeMetadata = treeContent.metadata;
          expect(treeMetadata).toBeDefined();
          expect(treeMetadata.getProperty("age")).toEqual(16);
        });
      });

      it("initializes implicit content metadata for inner contents (legacy)", function () {
        return Cesium3DTilesTester.loadTileset(
          scene,
          withImplicitContentMetadataLegacyUrl
        ).then(function (tileset) {
          const placeholderTile = tileset.root;
          const subtreeRootTile = placeholderTile.children[0];

          // This retrieves the tile at (1, 1, 1)
          const subtreeChildTile = subtreeRootTile.children[0];

          const multipleContents = subtreeChildTile.content;
          const innerContents = multipleContents.innerContents;

          const buildingContent = innerContents[0];
          const buildingMetadata = buildingContent.metadata;
          expect(buildingMetadata).toBeDefined();
          expect(buildingMetadata.getProperty("height")).toEqual(50);
          expect(buildingMetadata.getProperty("color")).toEqual(
            new Cartesian3(0, 0, 255)
          );

          const treeContent = innerContents[1];
          const treeMetadata = treeContent.metadata;
          expect(treeMetadata).toBeDefined();
          expect(treeMetadata.getProperty("age")).toEqual(16);
        });
      });
    });
  },
  "WebGL"
);


text:
<?php

namespace Axstrad\Component\Filesystem\Tests\Unit\Scanner;

use Axstrad\Component\Test\TraitTestCase;

/**
 * Axstrad\Component\Filesystem\Tests\Unit\Scanner\PathScannerTraitTest
 *
 * @author Dan Kempster <dev@dankempster.co.uk>
 * @group unit
 */
class PathScannerTraitTest extends TraitTestCase
{
    use \Axstrad\Component\Filesystem\Scanner\PathScannerTrait;

    public function setUp() { }

    /**
     * @covers Axstrad\Component\Filesystem\Scanner\PathScannerTrait::throwExceptionIfPathNotExist
     * @expectedException Axstrad\Component\Filesystem\Exception\InvalidPathException
     */
    public function testSetIteratorAcceptsDirectoryIterator()
    {
        $this->throwExceptionIfPathNotExist();
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <include
        android:id="@+id/umeng_socialize_title"
        layout="@layout/umeng_socialize_titile_bar" />

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@id/umeng_socialize_title"
        android:background="@color/umeng_socialize_ucenter_bg"
        android:fadingEdge="none" >

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >

            <FrameLayout
                android:id="@+id/umeng_socialize_load_error"
                android:layout_width="fill_parent"
                android:layout_height="158dp"
                android:visibility="gone" >

                <include layout="@layout/umeng_socialize_failed_load_page" />
            </FrameLayout>

            <RelativeLayout
                android:id="@+id/umeng_socialize_ucenter_info"
                android:layout_width="fill_parent"
                android:layout_height="200dp"
                android:layout_below="@id/umeng_socialize_load_error"
                android:background="@color/umeng_socialize_list_item_bgcolor"
                android:paddingTop="5dp" >

                <ImageView
                    android:id="@+id/umeng_socialize_ic"
                    android:layout_width="70dp"
                    android:layout_height="70dp"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="20dp"
                    android:scaleType="fitXY"
                    android:src="@drawable/umeng_socialize_default_avatar" />

                <TextView
                    android:id="@+id/umeng_socialize_title_tv"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:layout_marginTop="15dp"
                    android:gravity="center_vertical"
                    android:paddingLeft="8dp"
                    android:text="登录账号"
                    android:textColor="@color/umeng_socialize_list_item_textcolor"
                    android:textSize="16sp"
                    android:textStyle="bold" />

                <RelativeLayout
                    android:layout_width="fill_parent"
                    android:layout_height="85dp"
                    android:layout_below="@id/umeng_socialize_ic"
                    android:layout_centerVertical="true"
                    android:layout_marginBottom="13dp"
                    android:layout_marginTop="10dp" >

                    <TextView
                        android:id="@+id/umeng_socialize_loginNm"
                        android:layout_width="wrap_content"
                        android:layout_height="26dp"
                        android:layout_alignParentTop="true"
                        android:layout_centerHorizontal="true"
                        android:layout_marginTop="10dp"
                        android:ellipsize="end"
                        android:gravity="center_vertical"
                        android:singleLine="true"
                        android:text="匿名用户"
                        android:textColor="@color/umeng_socialize_list_item_textcolor"
                        android:textSize="16sp" />

                    <ViewFlipper
                        android:id="@+id/umeng_socialize_login_switch"
                        android:layout_width="fill_parent"
                        android:layout_height="25dp"
                        android:layout_below="@id/umeng_socialize_loginNm"
                        android:layout_centerHorizontal="true"
                        android:layout_marginTop="8dp"
                        android:autoStart="false"
                        android:paddingLeft="5dp" >

                        <Button
                            android:id="@+id/umeng_socialize_loginButton"
                            android:layout_width="80dp"
                            android:layout_height="fill_parent"
                            android:layout_gravity="center_horizontal"
                            android:background="@drawable/umeng_socialize_button_login"
                            android:text="点击登录"
                            android:textColor="#ffffff"
                            android:textSize="12sp" />

                        <TextView
                            android:id="@+id/umeng_socialize_loginAddr"
                            android:layout_width="fill_parent"
                            android:layout_height="fill_parent"
                            android:layout_gravity="center_horizontal"
                            android:layout_marginLeft="10dp"
                            android:layout_marginRight="10dp"
                            android:ellipsize="end"
                            android:gravity="center"
                            android:lines="2"
                            android:text="http://www.umeng.com/"
                            android:textColor="#333333"
                            android:textSize="14sp" />
                    </ViewFlipper>
                </RelativeLayout>
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/umeng_socialize_share_area"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_below="@id/umeng_socialize_ucenter_info"
                android:background="@color/umeng_socialize_ucenter_bg"
                android:paddingBottom="8dp" >

                <TextView
                    android:id="@+id/umeng_socialize_share_tv"
                    android:layout_width="fill_parent"
                    android:layout_height="40dp"
                    android:layout_alignParentTop="true"
                    android:layout_marginLeft="13dp"
                    android:gravity="center_vertical"
                    android:text="分享设置"
                    android:textColor="@color/umeng_socialize_list_item_textcolor"
                    android:textSize="18sp" />

                <ScrollView
                    android:id="@+id/umeng_xp_ScrollView"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginTop="5dp"
                    android:paddingLeft="8dp"
                    android:paddingRight="10dp"
                    android:scrollbars="none"
                    android:visibility="gone" >
                </ScrollView>

                <LinearLayout
                    android:id="@+id/umeng_socialize_share_config_area"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_below="@id/umeng_socialize_share_tv"
                    android:background="@color/umeng_socialize_ucenter_bg"
                    android:orientation="vertical" >
                </LinearLayout>
            </RelativeLayout>
        </RelativeLayout>
    </ScrollView>

</RelativeLayout>


text:
==================================================================
 Azure Service Bus Transport - ``kombu.transport.azureservicebus``
==================================================================

.. currentmodule:: kombu.transport.azureservicebus

.. automodule:: kombu.transport.azureservicebus

    .. contents::
        :local:

    Transport
    ---------

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

    Channel
    -------

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


text:
class PrefService;

namespace user_prefs {
class PrefRegistrySyncable;
}  // namespace user_prefs

namespace ntp_tiles {

// Non-test implementation of the CustomLinksManager interface.
class CustomLinksManagerImpl : public CustomLinksManager,
                               public history::HistoryServiceObserver {
 public:
  // Restores the previous state of |current_links_| from prefs.
  CustomLinksManagerImpl(PrefService* prefs,
                         // Can be nullptr in unittests.
                         history::HistoryService* history_service);

  CustomLinksManagerImpl(const CustomLinksManagerImpl&) = delete;
  CustomLinksManagerImpl& operator=(const CustomLinksManagerImpl&) = delete;

  ~CustomLinksManagerImpl() override;

  // CustomLinksManager implementation.
  bool Initialize(const NTPTilesVector& tiles) override;
  void Uninitialize() override;
  bool IsInitialized() const override;

  const std::vector<Link>& GetLinks() const override;

  bool AddLink(const GURL& url, const std::u16string& title) override;
  bool UpdateLink(const GURL& url,
                  const GURL& new_url,
                  const std::u16string& new_title) override;
  bool ReorderLink(const GURL& url, size_t new_pos) override;
  bool DeleteLink(const GURL& url) override;
  bool UndoAction() override;

  base::CallbackListSubscription RegisterCallbackForOnChanged(
      base::RepeatingClosure callback) override;

  // Register preferences used by this class.
  static void RegisterProfilePrefs(
      user_prefs::PrefRegistrySyncable* user_prefs);

 private:
  void ClearLinks();

  // Stores the current list to the profile's preferences. Does not notify
  // |OnPreferenceChanged|.
  void StoreLinks();

  // Checks during instantiation to remove custom shortcut links
  // created through preinstalled apps.
  void RemoveCustomLinksForPreinstalledApps();

  // Returns an iterator into |custom_links_|.
  std::vector<Link>::iterator FindLinkWithUrl(const GURL& url);

  // history::HistoryServiceObserver implementation.
  // Deletes any Most Visited links whose URL is in |deletion_info|. Clears
  // |previous_links_|. Does not delete entries expired by HistoryService.
  void OnURLsDeleted(history::HistoryService* history_service,
                     const history::DeletionInfo& deletion_info) override;
  void HistoryServiceBeingDeleted(
      history::HistoryService* history_service) override;

  // Called when the current list of links and/or initialization state in
  // PrefService is modified. Saves the new set of links in |current_links_|
  // and notifies |closure_list_|.
  void OnPreferenceChanged();

  const raw_ptr<PrefService> prefs_;
  CustomLinksStore store_;
  std::vector<Link> current_links_;
  // The state of the current list of links before the last action was
  // performed.
  absl::optional<std::vector<Link>> previous_links_;

  // List of closures to be invoked when custom links are updated by outside
  // sources.
  base::RepeatingClosureList closure_list_;

  // Observer for the HistoryService.
  base::ScopedObservation<history::HistoryService,
                          history::HistoryServiceObserver>
      history_service_observation_{this};

  // Observer for Chrome sync changes to |prefs::kCustomLinksList| and
  // |prefs::kCustomLinksInitialized|.
  PrefChangeRegistrar pref_change_registrar_;
  // Used to ignore notifications from |pref_change_registrar_| that we trigger
  // ourselves when updating the preferences.
  bool updating_preferences_ = false;

  base::WeakPtrFactory<CustomLinksManagerImpl> weak_ptr_factory_{this};
};

}  // namespace ntp_tiles

#endif  // COMPONENTS_NTP_TILES_CUSTOM_LINKS_MANAGER_IMPL_H_


text:
import * as assert from 'assert';
import * as platform from 'vs/base/common/platform';
import { FileChangeType, FileChangesEvent } from 'vs/platform/files/common/files';
import { URI as uri } from 'vs/base/common/uri';
import { IDiskFileChange, normalizeFileChanges, toFileChanges } from 'vs/platform/files/node/watcher/watcher';
import { Event, Emitter } from 'vs/base/common/event';

function toFileChangesEvent(changes: IDiskFileChange[]): FileChangesEvent {
	return new FileChangesEvent(toFileChanges(changes));
}

class TestFileWatcher {
	private readonly _onFileChanges: Emitter<FileChangesEvent>;

	constructor() {
		this._onFileChanges = new Emitter<FileChangesEvent>();
	}

	get onFileChanges(): Event<FileChangesEvent> {
		return this._onFileChanges.event;
	}

	report(changes: IDiskFileChange[]): void {
		this.onRawFileEvents(changes);
	}

	private onRawFileEvents(events: IDiskFileChange[]): void {

		// Normalize
		let normalizedEvents = normalizeFileChanges(events);

		// Emit through event emitter
		if (normalizedEvents.length > 0) {
			this._onFileChanges.fire(toFileChangesEvent(normalizedEvents));
		}
	}
}

enum Path {
	UNIX,
	WINDOWS,
	UNC
}

suite('Normalizer', () => {

	test('simple add/update/delete', function (done: () => void) {
		const watch = new TestFileWatcher();

		const added = uri.file('/users/data/src/added.txt');
		const updated = uri.file('/users/data/src/updated.txt');
		const deleted = uri.file('/users/data/src/deleted.txt');

		const raw: IDiskFileChange[] = [
			{ path: added.fsPath, type: FileChangeType.ADDED },
			{ path: updated.fsPath, type: FileChangeType.UPDATED },
			{ path: deleted.fsPath, type: FileChangeType.DELETED },
		];

		watch.onFileChanges(e => {
			assert.ok(e);
			assert.equal(e.changes.length, 3);
			assert.ok(e.contains(added, FileChangeType.ADDED));
			assert.ok(e.contains(updated, FileChangeType.UPDATED));
			assert.ok(e.contains(deleted, FileChangeType.DELETED));

			done();
		});

		watch.report(raw);
	});

	let pathSpecs = platform.isWindows ? [Path.WINDOWS, Path.UNC] : [Path.UNIX];
	pathSpecs.forEach((p) => {
		test('delete only reported for top level folder (' + p + ')', function (done: () => void) {
			const watch = new TestFileWatcher();

			const deletedFolderA = uri.file(p === Path.UNIX ? '/users/data/src/todelete1' : p === Path.WINDOWS ? 'C:\\users\\data\\src\\todelete1' : '\\\\localhost\\users\\data\\src\\todelete1');
			const deletedFolderB = uri.file(p === Path.UNIX ? '/users/data/src/todelete2' : p === Path.WINDOWS ? 'C:\\users\\data\\src\\todelete2' : '\\\\localhost\\users\\data\\src\\todelete2');
			const deletedFolderBF1 = uri.file(p === Path.UNIX ? '/users/data/src/todelete2/file.txt' : p === Path.WINDOWS ? 'C:\\users\\data\\src\\todelete2\\file.txt' : '\\\\localhost\\users\\data\\src\\todelete2\\file.txt');
			const deletedFolderBF2 = uri.file(p === Path.UNIX ? '/users/data/src/todelete2/more/test.txt' : p === Path.WINDOWS ? 'C:\\users\\data\\src\\todelete2\\more\\test.txt' : '\\\\localhost\\users\\data\\src\\todelete2\\more\\test.txt');
			const deletedFolderBF3 = uri.file(p === Path.UNIX ? '/users/data/src/todelete2/super/bar/foo.txt' : p === Path.WINDOWS ? 'C:\\users\\data\\src\\todelete2\\super\\bar\\foo.txt' : '\\\\localhost\\users\\data\\src\\todelete2\\super\\bar\\foo.txt');
			const deletedFileA = uri.file(p === Path.UNIX ? '/users/data/src/deleteme.txt' : p === Path.WINDOWS ? 'C:\\users\\data\\src\\deleteme.txt' : '\\\\localhost\\users\\data\\src\\deleteme.txt');

			const addedFile = uri.file(p === Path.UNIX ? '/users/data/src/added.txt' : p === Path.WINDOWS ? 'C:\\users\\data\\src\\added.txt' : '\\\\localhost\\users\\data\\src\\added.txt');
			const updatedFile = uri.file(p === Path.UNIX ? '/users/data/src/updated.txt' : p === Path.WINDOWS ? 'C:\\users\\data\\src\\updated.txt' : '\\\\localhost\\users\\data\\src\\updated.txt');

			const raw: IDiskFileChange[] = [
				{ path: deletedFolderA.fsPath, type: FileChangeType.DELETED },
				{ path: deletedFolderB.fsPath, type: FileChangeType.DELETED },
				{ path: deletedFolderBF1.fsPath, type: FileChangeType.DELETED },
				{ path: deletedFolderBF2.fsPath, type: FileChangeType.DELETED },
				{ path: deletedFolderBF3.fsPath, type: FileChangeType.DELETED },
				{ path: deletedFileA.fsPath, type: FileChangeType.DELETED },
				{ path: addedFile.fsPath, type: FileChangeType.ADDED },
				{ path: updatedFile.fsPath, type: FileChangeType.UPDATED }
			];

			watch.onFileChanges(e => {
				assert.ok(e);
				assert.equal(e.changes.length, 5);

				assert.ok(e.contains(deletedFolderA, FileChangeType.DELETED));
				assert.ok(e.contains(deletedFolderB, FileChangeType.DELETED));
				assert.ok(e.contains(deletedFileA, FileChangeType.DELETED));
				assert.ok(e.contains(addedFile, FileChangeType.ADDED));
				assert.ok(e.contains(updatedFile, FileChangeType.UPDATED));

				done();
			});

			watch.report(raw);
		});
	});

	test('event normalization: ignore CREATE followed by DELETE', function (done: () => void) {
		const watch = new TestFileWatcher();

		const created = uri.file('/users/data/src/related');
		const deleted = uri.file('/users/data/src/related');
		const unrelated = uri.file('/users/data/src/unrelated');

		const raw: IDiskFileChange[] = [
			{ path: created.fsPath, type: FileChangeType.ADDED },
			{ path: deleted.fsPath, type: FileChangeType.DELETED },
			{ path: unrelated.fsPath, type: FileChangeType.UPDATED },
		];

		watch.onFileChanges(e => {
			assert.ok(e);
			assert.equal(e.changes.length, 1);

			assert.ok(e.contains(unrelated, FileChangeType.UPDATED));

			done();
		});

		watch.report(raw);
	});

	test('event normalization: flatten DELETE followed by CREATE into CHANGE', function (done: () => void) {
		const watch = new TestFileWatcher();

		const deleted = uri.file('/users/data/src/related');
		const created = uri.file('/users/data/src/related');
		const unrelated = uri.file('/users/data/src/unrelated');

		const raw: IDiskFileChange[] = [
			{ path: deleted.fsPath, type: FileChangeType.DELETED },
			{ path: created.fsPath, type: FileChangeType.ADDED },
			{ path: unrelated.fsPath, type: FileChangeType.UPDATED },
		];

		watch.onFileChanges(e => {
			assert.ok(e);
			assert.equal(e.changes.length, 2);

			assert.ok(e.contains(deleted, FileChangeType.UPDATED));
			assert.ok(e.contains(unrelated, FileChangeType.UPDATED));

			done();
		});

		watch.report(raw);
	});

	test('event normalization: ignore UPDATE when CREATE received', function (done: () => void) {
		const watch = new TestFileWatcher();

		const created = uri.file('/users/data/src/related');
		const updated = uri.file('/users/data/src/related');
		const unrelated = uri.file('/users/data/src/unrelated');

		const raw: IDiskFileChange[] = [
			{ path: created.fsPath, type: FileChangeType.ADDED },
			{ path: updated.fsPath, type: FileChangeType.UPDATED },
			{ path: unrelated.fsPath, type: FileChangeType.UPDATED },
		];

		watch.onFileChanges(e => {
			assert.ok(e);
			assert.equal(e.changes.length, 2);

			assert.ok(e.contains(created, FileChangeType.ADDED));
			assert.ok(!e.contains(created, FileChangeType.UPDATED));
			assert.ok(e.contains(unrelated, FileChangeType.UPDATED));

			done();
		});

		watch.report(raw);
	});

	test('event normalization: apply DELETE', function (done: () => void) {
		const watch = new TestFileWatcher();

		const updated = uri.file('/users/data/src/related');
		const updated2 = uri.file('/users/data/src/related');
		const deleted = uri.file('/users/data/src/related');
		const unrelated = uri.file('/users/data/src/unrelated');

		const raw: IDiskFileChange[] = [
			{ path: updated.fsPath, type: FileChangeType.UPDATED },
			{ path: updated2.fsPath, type: FileChangeType.UPDATED },
			{ path: unrelated.fsPath, type: FileChangeType.UPDATED },
			{ path: updated.fsPath, type: FileChangeType.DELETED }
		];

		watch.onFileChanges(e => {
			assert.ok(e);
			assert.equal(e.changes.length, 2);

			assert.ok(e.contains(deleted, FileChangeType.DELETED));
			assert.ok(!e.contains(updated, FileChangeType.UPDATED));
			assert.ok(e.contains(unrelated, FileChangeType.UPDATED));

			done();
		});

		watch.report(raw);
	});
});


text:
CREATE TABLE [dbo].[AspNetUserClaims] (
    [Id]         INT            IDENTITY (1, 1) NOT NULL,
    [ClaimType]  NVARCHAR (MAX) NULL,
    [ClaimValue] NVARCHAR (MAX) NULL,
    [UserId]     NVARCHAR (450) NOT NULL,
    CONSTRAINT [PK_AspNetUserClaims] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_AspNetUserClaims_AspNetUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE
);

GO
CREATE NONCLUSTERED INDEX [IX_AspNetUserClaims_UserId]
    ON [dbo].[AspNetUserClaims]([UserId] ASC);


text:
package br.com.objectos.jabuticava.cnab.itau;

import java.time.LocalDate;

import br.com.objectos.jabuticava.cnab.Itau;
import br.com.objectos.jabuticava.cnab.Lote;

import com.google.common.base.Function;

/**
 * @author marcos.piazzolla@objectos.com.br (Marcos Piazzolla)
 */
class LoteToDataDoCredito implements Function<Lote, LocalDate> {
  @Override
  public LocalDate apply(Lote input) {
    return input.get(Itau.lote().dataDeCredito());
  }
}


text:
require 'abstract_unit'

class NullResolverTest < ActiveSupport::TestCase
  def test_should_return_template_for_any_path
    resolver = ActionView::NullResolver.new()
    templates = resolver.find_all("path", "arbitrary", false, {:locale => [], :formats => [:html], :handlers => []})
    assert_equal 1, templates.size, "expected one template"
    assert_equal "Template generated by Null Resolver", templates.first.source
    assert_equal "arbitrary/path", templates.first.virtual_path
    assert_equal [:html],          templates.first.formats
  end
end


text:
import {Asin, KernelConfig} from '@tensorflow/tfjs-core';

import {unaryKernelFunc} from '../kernel_utils/kernel_funcs_utils';

import {UnaryOpType} from '../unary_op_util';

export const asin = unaryKernelFunc({opType: UnaryOpType.ASIN});

export const asinConfig: KernelConfig = {
  kernelName: Asin,
  backendName: 'webgpu',
  kernelFunc: asin
};


text:
API
===

Stubs and mocks
---------------

.. autofunction:: doubles.allow
.. autofunction:: doubles.expect
.. autofunction:: doubles.allow_constructor
.. autofunction:: doubles.expect_constructor
.. autofunction:: doubles.patch
.. autofunction:: doubles.patch_class

.. autoclass:: doubles.allowance.Allowance
    :members: and_raise, and_return, and_return_result_of, with_args, with_no_args
.. autoclass:: doubles.expectation.Expectation
    :members: with_args, with_no_args

Pure doubles
------------

.. autoclass:: doubles.InstanceDouble
    :inherited-members:
.. autoclass:: doubles.ClassDouble
    :members:
    :inherited-members:
.. autoclass:: doubles.ObjectDouble
    :members:

Test lifecycle
--------------
.. autofunction:: doubles.verify
.. autofunction:: doubles.teardown

Exceptions
----------

.. automodule:: doubles.exceptions
    :members:


text:
An interactive art exhibition.

## Development

```
npm install
npm run dev
```

Exhisting exhibitions
* [Movement in Squares](http://localhost:8000/movement-in-squares)
* [Cataract](http://localhost:8000/cataract)

## TODO
- Tests
- Controls to manipulate animation and art
- Improve 'movement in squares' performance
- Documentation!


text:
import requests
from bs4 import BeautifulSoup

class Grabfeed:
    rss = None
    atom = None

    def __init__(self, rss, atom):
        self.rss = rss
        self.atom = atom

def return_page_content(page_url):
    # Use haders to avoid being blocked
    hdr = {
        'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11'
        ' (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
        'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9'
        ',*/*;q=0.8',
        'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
        'Accept-Encoding': 'none',
        'Accept-Language': 'en-US,en;q=0.8',
        'Connection': 'keep-alive'
    }
    try:
        req = requests.get(
            page_url, headers=hdr)
        return req.text
    except:
        raise

def return_rss(page_url):
    rss_link = return_feed(page_url).rss
    if not rss_link:
        raise Exception("The page has no RSS feed")
    return rss_link

def return_atom(page_url):
    atom_link = return_feed(page_url).atom
    if not atom_link:
        raise Exception("The page has no Atom feed")
    return atom_link

def return_feed(page_url):
    page_content = return_page_content(page_url)
    atom_link = ''
    soup = BeautifulSoup(page_content, "html.parser")
    atom_link = soup.find('link',type='application/atom+xml')

    if not atom_link:
        atom_link = False
    else:
        atom_link = atom_link.get('href')
    rss_link = soup.find('link', type='application/rss+xml')
    if not rss_link:
        rss_link = False
    else:
        rss_link = rss_link.get('href')
    return Grabfeed(rss=rss_link, atom=atom_link)


text:
/*
TeeLog common function that will useful for futher development
*/
//=============
var CommonKlasses=function(){
//let find out if we are on localhost or remote
CommonKlasses.prototype.WhichUrl = function(){
var TeeLogAppUrl;
var TeeLogAppHost=location.protocol+'//'+window.location.hostname+'/';
if(TeeLogAppHost.includes("localhost/")){
TeeLogAppUrl=TeeLogAppHost+"TodoList";
}
else
{
TeeLogAppUrl=TeeLogAppHost;
}
return TeeLogAppUrl;
};
//=======================================
//
//
//==============Print Error Message=======================
CommonKlasses.prototype.ShowErrors = function(parenTs,Text){
parenTs.find(".ShowMessage").show("slide").html(""+Text+"");
};
//=================Print Success Message====================
CommonKlasses.prototype.ShowSuccess = function(parenTs,Text){
parenTs.find(".ShowMessage").show("slide").html(""+Text+"");
setTimeout(function(){
parenTs.find(".ShowMessage").hide("slide");
},3000);
};

//==============================
//
//
};
//============
//Scroll page Function
//===========
$.fn.scrollTubView = function () {
return this.each(function () {
$('html, body').animate({
scrollTop: $(this).offset().top
}, 1000);
});
};
//=================
//
//=========================
function AddZero(i) {
    if (i < 10) {i = "0" + i;}  // add zero in front of numbers < 10
    return i;
}
//
//=====================================
 // Set clock to run using  momenTId
 //=====================================
function startTime(){
    var today = new Date();
    var h = today.getHours();
    var m = today.getMinutes();
    var s = today.getSeconds();
//====================
    m = AddZero(m);
    s = AddZero(s);
    h = AddZero(h);
  //==================
   var weekday = new Array(7);
    weekday[0] = "Sunday";
    weekday[1] = "Monday";
    weekday[2] = "Tuesday";
    weekday[3] = "Wednesday";
    weekday[4] = "Thursday";
    weekday[5] = "Friday";
    weekday[6] = "Saturday";
	var nday = weekday[today.getDay()];
	var dDt= today.getUTCDate();
	 //===========
   var Perid;
   if (h === "00") {Perid= "It is a new Day !";}
   else if (h < "12") {Perid= "Good Morning !";}
   else if (h >= "12" && h < "17") {Perid= "Good Afternoon !";}
   else if (h >= "17" && h < "21") {Perid= "Good Evening !";}
   else if (h >= "21") {Perid= "We are in late night !"; }
   var TimeStake=document.getElementById("momenT");
   var AdatesNtime="It´s  "+nday+"  "+dDt+" @    "+ h + ":" + m + ":" + s+ "   "+Perid+"";
   TimeStake.innerHTML =AdatesNtime;
   setTimeout(startTime, 500);
}

//==================
//
//
//
//==================================
(function(){
//Initiating CommonKlasses
var
TeeLogClass=new CommonKlasses(),
//Action to take such Add and update
actionToTake,
//Get Location Url
urlNow=TeeLogClass.WhichUrl();
//Show Clock
if($("#momenT").length){
startTime();
}
//=====================
 $("a[href='#']").click(function(e) {
    e.preventDefault();
  });
//=================
$(".submitdata").click(function(event) {
event.preventDefault();
//Getting Required Variables
var
actionType= $(this).data('action'),
TaskTitle = $("input#inputTitile").val(),
parenTs=$(this).parents("div.modal-content"),
//TaskPriority = $("input[name='priorityOption']").val(),
TaskWeekNumber = $("select#inputWeek").val(),
TaskDateTime = $("input#inputDateTime").val();
//===============
var checkTimeIsAdded=TaskDateTime.split("@");
//Form Validation happen Here Before send
if(TaskTitle ==="")
{
//print errors via our 	CommonKlasses()
TeeLogClass.ShowErrors(parenTs,"Add Valid Title");
return;//stop runing
}
//
//
else if(TaskDateTime ==="")
{
//print errors via our 	CommonKlasses()
TeeLogClass.ShowErrors(parenTs,"Select DateTime");
return;//stop runing
}
//
//checkTimeIsAdded
else if(checkTimeIsAdded[1] ==="00:00")
{
//print errors via our 	CommonKlasses()
TeeLogClass.ShowErrors(parenTs,"Select Valid Time");
return;//stop runing
}
else if(TaskWeekNumber ==="")
{
//print errors via our 	CommonKlasses()
TeeLogClass.ShowErrors(parenTs,"Select Week Number");
return;//stop runing
}
//
//

//here we want to detect which control method to use
switch(actionType){
case "AddNew":
actionToTake="/todomanager/add";
break;
case "Update":
actionToTake="/todomanager/update";
break;
}
//== Reaching controller with Jquery Ajax
 $.ajax({
 type: "POST",
 dataType: 'text',
  url: urlNow+actionToTake,
  cache: false,
  data: $('form#addNewTaskForm').serialize(),
  success: function(data){
 TeeLogClass.ShowSuccess(parenTs,data);
  },
  error: function(MLHttpRequest, textStatus, errorThrown){
  TeeLogClass.ShowErrors(parenTs,"There is   "+textStatus+"  See >>  "+errorThrown);
  }
 });
//================
});
//=========here we want to update status
//
//
//
//==================================
$("span[data-task-id]").click(function(event) {
event.preventDefault();
var
IdToUp=$(this).data("task-id"),
parenTs=$(this).parents("li"),
actionType=$(this).attr("class");
//here we want to detect which control method to use
switch(actionType){
case "done":
actionToTake="/todomanager/updateStatus";
break;
case "remove":
actionToTake="/todomanager/delete";
break;
}
//=====================
//== Reaching controller with Jquery Ajax
 $.ajax({
type: "POST",
url: urlNow+actionToTake,
cache: false,
dataType: 'text',
data: {id:IdToUp},
success: function(json){
TeeLogClass.ShowSuccess(parenTs,json);
switch(actionType){
case "done":
parenTs.addClass("complete");
break;
case "remove":
parenTs.remove();
break;
}
//=====================
},
  error: function(MLHttpRequest, textStatus, errorThrown){
 TeeLogClass.ShowErrors(parenTs,"There is   "+textStatus+"  See >>  "+errorThrown);
  }
 });
//
//
//
//==========================
});
//===========selectTask=======================
//=========here we want to update status
//
//
//
//==================================
$("#selectTask").on("change",function(event) {
event.preventDefault();
//change the submit button to update button
$("button[data-action='AddNew']").attr("data-action", "Update").text("Update");
var
IdToGet=$(this).val(),
parenTs=$(this).parents("div.modal-content");
//=====================
//== Reaching controller with Jquery Ajax
 $.ajax({
 type: "GET",
 url: urlNow+"/todomanager/getTask",
 cache: false,
 dataType: 'json',
 data: {id:IdToGet},
 success: function(json){
 var
taskTitle=json.taskTitle,
taskPriority=json.taskPriority,
dateTime=json.dateTime,
businessWeekId=json.businessWeekId;
$("input#inputTitile").val(taskTitle);
$("input[value="+taskPriority+"]").prop("checked",true);
$("input#inputDateTime").val(dateTime);
$("select#inputWeek").val(businessWeekId);
$("input[name='selectTask']").val(IdToGet);
TeeLogClass.ShowSuccess(parenTs, "Data ready to send see form display");
},
  error: function(MLHttpRequest, textStatus, errorThrown){
 TeeLogClass.ShowErrors(parenTs,"There is   "+textStatus+"  See >>  "+errorThrown);
  }
 });
//
//
//
//==========================
});
//
//Change button from update button to AddNew Button
// If not set for AddNew Button
$("#cancel").click(function(event) {
event.preventDefault();
$('form#addNewTaskForm').trigger('reset');
$("button[data-action='Update']").attr("data-action", "AddNew").text("Add New");
});
//
//
//
//Close the jquery ready here
//
//==================================
})();
//==================================
//
//
//
//
//==================================


text:
namespace remoting {

namespace {

// If the user has already changed the default browser to the URL forwarder,
// then the setup process will finish immediately without showing any UI, so we
// delay reporting USER_INTERVENTION_REQUIRED so that the client doesn't pop up
// a toast when it's unnecessary.
constexpr base::TimeDelta kReportUserInterventionRequiredDelay =
    base::Milliseconds(500);

base::win::ScopedHandle GetCurrentUserToken() {
  HANDLE user_token = nullptr;
  if (!WTSQueryUserToken(WTS_CURRENT_SESSION, &user_token)) {
    PLOG(ERROR) << "Failed to get current user token";
    return base::win::ScopedHandle();
  }
  return base::win::ScopedHandle(user_token);
}

// If |switch_name| is empty, the process will be launched with no extra
// switches.
bool LaunchConfiguratorProcess(const std::string& switch_name,
                               base::win::ScopedHandle user_token) {
  DCHECK(user_token.IsValid());
  base::LaunchOptions launch_options;
  launch_options.as_user = user_token.Get();
  // The remoting_desktop.exe binary (where this code runs) has extra manifest
  // flags (uiAccess and requireAdministrator) that are undesirable for the
  // url_forwarder_configurator child process, so remoting_host.exe is used
  // instead.
  base::FilePath path;
  if (!base::PathService::Get(base::DIR_EXE, &path)) {
    LOG(ERROR) << "Failed to get executable path.";
    return false;
  }
  path = path.AppendASCII("remoting_host.exe");
  base::CommandLine command(path);
  command.AppendSwitchASCII(kProcessTypeSwitchName,
                            kProcessTypeUrlForwarderConfigurator);
  if (!switch_name.empty()) {
    command.AppendSwitch(switch_name);
  }
  int exit_code = -1;
  base::LaunchProcess(command, launch_options).WaitForExit(&exit_code);
  return exit_code == 0;
}

}  // namespace

UrlForwarderConfiguratorWin::UrlForwarderConfiguratorWin()
    : io_task_runner_(base::ThreadPool::CreateSequencedTaskRunner(
          {base::MayBlock(), base::WithBaseSyncPrimitives()})) {}

UrlForwarderConfiguratorWin::~UrlForwarderConfiguratorWin() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}

void UrlForwarderConfiguratorWin::IsUrlForwarderSetUp(
    IsUrlForwarderSetUpCallback callback) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  auto user_token = GetCurrentUserToken();
  if (user_token.IsValid()) {
    io_task_runner_->PostTaskAndReplyWithResult(
        FROM_HERE,
        base::BindOnce(&LaunchConfiguratorProcess, std::string(),
                       std::move(user_token)),
        std::move(callback));
    return;
  }

  if (GetLastError() != ERROR_NO_TOKEN) {
    std::move(callback).Run(false);
    return;
  }

  if (is_url_forwarder_set_up_callback_) {
    LOG(ERROR) << "Query is already in progress.";
    std::move(callback).Run(false);
    return;
  }
  DCHECK(!wts_session_change_observer_);

  HOST_LOG << "Can't determine URL Forwarder state as no user is signed in. "
           << "Will check again after user signs in.";
  is_url_forwarder_set_up_callback_ = std::move(callback);
  wts_session_change_observer_ = std::make_unique<WtsSessionChangeObserver>();
  bool start_success = wts_session_change_observer_->Start(
      base::BindRepeating(&UrlForwarderConfiguratorWin::OnWtsSessionChange,
                          base::Unretained(this)));
  if (!start_success) {
    std::move(is_url_forwarder_set_up_callback_).Run(false);
  }
}

void UrlForwarderConfiguratorWin::SetUpUrlForwarder(
    const SetUpUrlForwarderCallback& callback) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  if (set_up_url_forwarder_callback_) {
    LOG(ERROR) << "Setup is already in progress.";
    callback.Run(SetUpUrlForwarderResponse::FAILED);
    return;
  }

  set_up_url_forwarder_callback_ = callback;
  report_user_intervention_required_timer_.Start(
      FROM_HERE, kReportUserInterventionRequiredDelay, this,
      &UrlForwarderConfiguratorWin::OnReportUserInterventionRequired);
  auto user_token = GetCurrentUserToken();
  if (!user_token.IsValid()) {
    OnSetUpResponse(false);
    return;
  }
  io_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(&LaunchConfiguratorProcess, kSetUpUrlForwarderSwitchName,
                     std::move(user_token)),
      base::BindOnce(&UrlForwarderConfiguratorWin::OnSetUpResponse,
                     weak_factory_.GetWeakPtr()));
}

void UrlForwarderConfiguratorWin::OnSetUpResponse(bool success) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  report_user_intervention_required_timer_.AbandonAndStop();
  set_up_url_forwarder_callback_.Run(success
                                         ? SetUpUrlForwarderResponse::COMPLETE
                                         : SetUpUrlForwarderResponse::FAILED);
  set_up_url_forwarder_callback_.Reset();
}

void UrlForwarderConfiguratorWin::OnReportUserInterventionRequired() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  set_up_url_forwarder_callback_.Run(
      SetUpUrlForwarderResponse::USER_INTERVENTION_REQUIRED);
}

void UrlForwarderConfiguratorWin::OnWtsSessionChange(uint32_t event,
                                                     uint32_t session_id) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  if (event != WTS_SESSION_LOGON) {
    return;
  }

  DCHECK(is_url_forwarder_set_up_callback_);

  HOST_LOG << "User logged in. Checking URL forwarder setup state now.";
  auto user_token = GetCurrentUserToken();
  if (!user_token.IsValid()) {
    std::move(is_url_forwarder_set_up_callback_).Run(false);
    return;
  }
  io_task_runner_->PostTaskAndReplyWithResult(
      FROM_HERE,
      base::BindOnce(&LaunchConfiguratorProcess, std::string(),
                     std::move(user_token)),
      std::move(is_url_forwarder_set_up_callback_));
  wts_session_change_observer_.reset();
}

// static
std::unique_ptr<UrlForwarderConfigurator> UrlForwarderConfigurator::Create() {
  return std::make_unique<UrlForwarderConfiguratorWin>();
}

}  // namespace remoting


text:
package com.episodecountdown;

import android.content.Context;
import android.database.Cursor;
import android.support.v4.widget.CursorAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.episodecountdown.R;
import com.squareup.picasso.Picasso;

public class WatchlistAdapter extends CursorAdapter{

	public WatchlistAdapter(Context context, Cursor c, int flags){
		super(context, c, flags);
	}

	@Override
	public void bindView(View view, Context context, Cursor cursor) {

		final ViewHolder viewHolder = (ViewHolder) view.getTag();

		//Combining Title and Year
		String titleString = cursor.getString(WatchlistFragment.COL_TITLE);
		if (titleString.contains(" (")) {
			// Do nothing
		}
		else
			titleString = titleString.concat(" (" + cursor.getString(WatchlistFragment.COL_YEAR) + ")");
		viewHolder.title.setText(titleString);

		String country = cursor.getString(WatchlistFragment.COL_COUNTRY);
		if (country == "null")
			viewHolder.country.setText("N/A");
		else {
			viewHolder.country.setText(country);
		}

		viewHolder.runtime.setText(cursor.getString(WatchlistFragment.COL_RUNTIME) + " Minutes");

		//get Show status
		String statuString = cursor.getString(WatchlistFragment.COL_STATUS);
		viewHolder.status.setText(statuString);

		String genreString = cursor.getString(WatchlistFragment.COL_GENRES);
		viewHolder.genreTextView.setText(genreString);

		if (statuString.equalsIgnoreCase("ended")){
			viewHolder.airsTextView.setText(mContext.getString(R.string.show_ended_string));
			viewHolder.airsTextView.setBackgroundColor(mContext.getResources().getColor(R.color.palette_red_translucent));
		} else {
			viewHolder.airsTextView.setText("Airs " + cursor.getString(WatchlistFragment.COL_AIRDAY) + " at "
					+ cursor.getString(WatchlistFragment.COL_AIRTIME) + " on " + cursor.getString(WatchlistFragment.COL_NETWORK));
			viewHolder.airsTextView.setBackgroundColor(mContext.getResources().getColor(R.color.palette_green_translucent));
		}

//		String startedString = cursor.getString(WatchlistFragment.COL_FIRST_AIRED);
//		viewHolder.started.setText(Utility.getReadableDateString(Long.parseLong(startedString)));

		Picasso.with(mContext).load(cursor.getString(WatchlistFragment.COL_POSTER))
			.resize(0, 300)
			.into(viewHolder.poster);
	}

	@Override
	public View newView(Context context, Cursor cursor, ViewGroup parent) {
		View view = LayoutInflater.from(context).inflate(R.layout.watchlist_list_item_layout, parent, false);
		ViewHolder viewHolder = new ViewHolder(view);
		//Tag can be used to store any object!! But when reading, have to know what was storred there.
		view.setTag(viewHolder);
		return view;
	}

	public static class ViewHolder {
		public final ImageView poster;
		public final TextView title, status, country, runtime;
		public final TextView airsTextView, genreTextView;

		public ViewHolder (View view) {
			poster = (ImageView) view.findViewById(R.id.watchlist_list_show_poster);
			title = (TextView) view.findViewById(R.id.watchlist_list_show_title);
			status = (TextView) view.findViewById(R.id.watchlist_item_show_status);
			country = (TextView) view.findViewById(R.id.watchlist_item_show_origin_country);
			runtime = (TextView) view.findViewById(R.id.watchlist_item_show_runtime);
			//started = (TextView) view.findViewById(R.id.watchlist_item_show_started_textview);
			airsTextView = (TextView) view.findViewById(R.id.watchlist_list_show_airs_textview);
			genreTextView = (TextView) view.findViewById(R.id.watchlist_item_show_genre);
		}
	}
}


text:
{% extends path+"/scenario_prompts-typical_01a/_layout-case-simple-full-width.html" %}

{% block citizen_content %}

{{ data.nuggets | log }}

Review evidence before making your recommendation

	{#
Additional attendees

John Smith

Edit additional attendees

 #}

	{#
Condition history
  #}

Condition history

		{% if data['reportedcondition01']%}

			{{ reportedcondition01 }}

Onset and progression:
{{ condition01Time }}

Symptoms:
{{ condition01Symptoms }}

Investigations and medical input:
{{ condition01Investigations }}

Impact on function:
{{ condition01Impact }}

			Change

		{% else %}{% endif %}
		{% if data['reportedcondition02']%}

			{{ reportedcondition02 }}

Onset and progression:
{{ condition02Time }}

Symptoms:
{{ condition02Symptoms }}

Investigations and medical input:
{{ condition02Investigations }}

Impact on function:
{{ condition02Impact }}

			Change

		{% else %}{% endif %}
		{% if data['reportedcondition03']%}

			{{ reportedcondition03 }}

Onset and progression:
{{ condition03Time }}

Symptoms:
{{ condition03Symptoms }}

Investigations and medical input:
{{ condition03Investigations }}

Impact on function:
{{ condition03Impact }}

			Change

		{% else %}{% endif %}
		{% if data['reportedcondition04']%}

			{{ reportedcondition04 }}

Onset and progression:
{{ condition04Time }}

Symptoms:
{{ condition04Symptoms }}

Investigations and medical input:
{{ condition04Investigations }}

Impact on function:
{{ condition04Impact }}

			Change

		{% else %}{% endif %}
		{% if data['reportedcondition05']%}

			{{ reportedcondition05 }}

Onset and progression:
{{ condition05Time }}

Symptoms:
{{ condition05Symptoms }}

Investigations and medical input:
{{ condition05Investigations }}

Impact on function:
{{ condition05Impact }}

			Change

		{% else %}{% endif %}
		{% if data['reportedcondition06']%}

			{{ reportedcondition06 }}

Onset and progression:
{{ condition06Time }}

Symptoms:
{{ condition06Symptoms }}

Investigations and medical input:
{{ condition06Investigations }}

Impact on function:
{{ condition06Impact }}

			Change

		{% else %}{% endif %}
		{% if data['reportedcondition07']%}

			{{ reportedcondition07 }}

Onset and progression:
{{ condition07Time }}

Symptoms:
{{ condition07Symptoms }}

Investigations and medical input:
{{ condition07Investigations }}

Impact on function:
{{ condition07Impact }}

			Change

		{% else %}{% endif %}

Other details

			Medication and side effects
			{{ medicationSideEffects }}
			Change

			Social and work history
			{% for item in socialWorkComments | sortBy("time",false) %}
{{ item.comment }}{{ item.text }}
{% endfor %}
			Change

			Typical day
			{% for item in typicalDayComments | sortBy("time",false) %}
{{ item.comment }}
{% endfor %}
			Change

			Additional attendees
			Joe Bloggs
			Change

{#
Physical assessments

			General health
			Height (m): 1.3
Weight (Kg): 94
BMI: 25%
			Change

Lower back and legs

			Lower back
			Forward flexion: Unrestricted
Squat and rise: Full
			Change

			Left leg
			Not assessed
			Change

			Right leg
			Not assessed
			Change

 #}

{#
Mental health assessment

			Appearance
			Lorem ipsum dolor sit amet, consectetur adipiscing elit.
			Change

			Behaviour
			Not assessed

			Speech
			Not assessed

			Mood
			Lorem ipsum dolor sit amet, consectetur adipiscing elit.

			Cognition
			Not assessed

			Insight
			Not assessed

			Thoughts
			Not assessed

			Perceptions
			Not assessed

			Addictions
			Not assessed

			Cognitive
			Not assessed

 #}

Make your recommendation

{% endblock %}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>GO Poké Me</title>
    <meta name="description" content="A Pokémon GO calculator for maximizing lucky egg yield.">

    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/css/main.css">

      GO Poké Me © is maintained by JohannesEH

        Loading...

Tools for Pokémon GO

          <button class="frontpage btn btn-lg btn-success"> Pokédex</button>
          <button class="frontpage btn btn-lg btn-success"> Lucky Egg Calculator</button>


text:
namespace crypto {
class ECPrivateKey;
}  // namespace crypto

namespace net {

class ChannelIDService;

class NET_EXPORT_PRIVATE ChannelIDKeyChromium : public quic::ChannelIDKey {
 public:
  explicit ChannelIDKeyChromium(
      std::unique_ptr<crypto::ECPrivateKey> ec_private_key);
  ~ChannelIDKeyChromium() override;

  // quic::ChannelIDKey interface
  bool Sign(quic::QuicStringPiece signed_data,
            std::string* out_signature) const override;
  std::string SerializeKey() const override;

 private:
  std::unique_ptr<crypto::ECPrivateKey> ec_private_key_;
};

// ChannelIDSourceChromium implements the QUIC quic::ChannelIDSource interface.
class ChannelIDSourceChromium : public quic::ChannelIDSource {
 public:
  explicit ChannelIDSourceChromium(ChannelIDService* channel_id_service);
  ~ChannelIDSourceChromium() override;

  // quic::ChannelIDSource interface
  quic::QuicAsyncStatus GetChannelIDKey(
      const std::string& hostname,
      std::unique_ptr<quic::ChannelIDKey>* channel_id_key,
      quic::ChannelIDSourceCallback* callback) override;

 private:
  class Job;

  void OnJobComplete(Job* job);

  // Set owning pointers to active jobs.
  std::map<Job*, std::unique_ptr<Job>> active_jobs_;

  // The service for retrieving Channel ID keys.
  ChannelIDService* const channel_id_service_;

  DISALLOW_COPY_AND_ASSIGN(ChannelIDSourceChromium);
};

}  // namespace net

#endif  // NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_


text:
default_target: all
.PHONY : default_target

#=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canonical targets will work.
.SUFFIXES:

# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =

.SUFFIXES: .hpux_make_needs_suffix_list

# Suppress display of executed commands.
$(VERBOSE).SILENT:

# A target that is always out of date.
cmake_force:
.PHONY : cmake_force

#=============================================================================
# Set environment variables for the build.

# The shell in which to execute make rules.
SHELL = /bin/sh

# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake

# The command to remove a file.
RM = /usr/bin/cmake -E remove -f

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/olfrik/Projects/seqan/src

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/olfrik/Projects/seqan/src

#=============================================================================
# Targets provided globally by CMake.

# Special rule for the target edit_cache
edit_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
	/usr/bin/cmake -i .
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target install
install: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
	/usr/bin/cmake -P cmake_install.cmake
.PHONY : install

# Special rule for the target install
install/fast: preinstall/fast
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
	/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast

# Special rule for the target install/local
install/local: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
	/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local

# Special rule for the target install/local
install/local/fast: install/local
.PHONY : install/local/fast

# Special rule for the target install/strip
install/strip: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
	/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip

# Special rule for the target install/strip
install/strip/fast: install/strip
.PHONY : install/strip/fast

# Special rule for the target list_install_components
list_install_components:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components

# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast

# Special rule for the target rebuild_cache
rebuild_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# Special rule for the target test
test:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
	/usr/bin/ctest --force-new-ctest-process $(ARGS)
.PHONY : test

# Special rule for the target test
test/fast: test
.PHONY : test/fast

# The main all target
all: cmake_check_build_system
	cd /home/olfrik/Projects/seqan/src && $(CMAKE_COMMAND) -E cmake_progress_start /home/olfrik/Projects/seqan/src/CMakeFiles /home/olfrik/Projects/seqan/src/sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/progress.marks
	cd /home/olfrik/Projects/seqan/src && $(MAKE) -f CMakeFiles/Makefile2 sandbox/olfrik/apps/t3AlGloA1/all
	$(CMAKE_COMMAND) -E cmake_progress_start /home/olfrik/Projects/seqan/src/CMakeFiles 0
.PHONY : all

# The main clean target
clean:
	cd /home/olfrik/Projects/seqan/src && $(MAKE) -f CMakeFiles/Makefile2 sandbox/olfrik/apps/t3AlGloA1/clean
.PHONY : clean

# The main clean target
clean/fast: clean
.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
	cd /home/olfrik/Projects/seqan/src && $(MAKE) -f CMakeFiles/Makefile2 sandbox/olfrik/apps/t3AlGloA1/preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
	cd /home/olfrik/Projects/seqan/src && $(MAKE) -f CMakeFiles/Makefile2 sandbox/olfrik/apps/t3AlGloA1/preinstall
.PHONY : preinstall/fast

# clear depends
depend:
	cd /home/olfrik/Projects/seqan/src && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend

# Convenience name for target.
sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/rule:
	cd /home/olfrik/Projects/seqan/src && $(MAKE) -f CMakeFiles/Makefile2 sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/rule
.PHONY : sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/rule

# Convenience name for target.
t3AlGloA1: sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/rule
.PHONY : t3AlGloA1

# fast build rule for target.
t3AlGloA1/fast:
	cd /home/olfrik/Projects/seqan/src && $(MAKE) -f sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/build.make sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/build
.PHONY : t3AlGloA1/fast

t3AlGloA1.o: t3AlGloA1.cpp.o
.PHONY : t3AlGloA1.o

# target to build an object file
t3AlGloA1.cpp.o:
	cd /home/olfrik/Projects/seqan/src && $(MAKE) -f sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/build.make sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/t3AlGloA1.cpp.o
.PHONY : t3AlGloA1.cpp.o

t3AlGloA1.i: t3AlGloA1.cpp.i
.PHONY : t3AlGloA1.i

# target to preprocess a source file
t3AlGloA1.cpp.i:
	cd /home/olfrik/Projects/seqan/src && $(MAKE) -f sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/build.make sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/t3AlGloA1.cpp.i
.PHONY : t3AlGloA1.cpp.i

t3AlGloA1.s: t3AlGloA1.cpp.s
.PHONY : t3AlGloA1.s

# target to generate assembly for a file
t3AlGloA1.cpp.s:
	cd /home/olfrik/Projects/seqan/src && $(MAKE) -f sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/build.make sandbox/olfrik/apps/t3AlGloA1/CMakeFiles/t3AlGloA1.dir/t3AlGloA1.cpp.s
.PHONY : t3AlGloA1.cpp.s

# Help Target
help:
	@echo "The following are some of the valid targets for this Makefile:"
	@echo "... all (the default if no target is provided)"
	@echo "... clean"
	@echo "... depend"
	@echo "... edit_cache"
	@echo "... install"
	@echo "... install/local"
	@echo "... install/strip"
	@echo "... list_install_components"
	@echo "... rebuild_cache"
	@echo "... t3AlGloA1"
	@echo "... test"
	@echo "... t3AlGloA1.o"
	@echo "... t3AlGloA1.i"
	@echo "... t3AlGloA1.s"
.PHONY : help

#=============================================================================
# Special targets to cleanup operation of make.

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
	cd /home/olfrik/Projects/seqan/src && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system


text:
PG_BIN_PATH=${POSTGRES_BIN_PATH:=/Applications/Postgres.app/Contents/Versions/9.6/bin/}

# Postgres binary name
PG_BIN_NAME=${POSTGRES_BIN_NAME:=createdb}

# Postgres database template name
PG_DATABASE_TEMPLATE_NAME=${POSTGRES_DATABASE_TEMPLATE_NAME:=development}

# Postgres database host
PG_DATABASE_HOST=${POSTGRES_DATABASE_HOST:=localhost}

# Postgres database username
PG_DATABASE_USERNAME=${POSTGRES_DATABASE_USERNAME:=postgres}

# To get branch name
branch=$(git rev-parse --abbrev-ref HEAD)
database_prefix="gandalf-dev_"

if [[ $branch =~ .*hotfix* ]]
then
   database="${database_prefix}hotfix"
else
   database="${database_prefix}${branch}"
fi

cmd="${PG_BIN_PATH}${PG_BIN_NAME} -T ${PG_DATABASE_TEMPLATE_NAME} ${database} -h ${PG_DATABASE_HOST} -U ${PG_DATABASE_USERNAME} -w"

eval $cmd

echo "Database created!"


text:
from datetime import datetime, timedelta
import datetime as dt   # dt is used here to make the tests pass (datetime is mocked)

from flask.views import View
from flask import request, jsonify, make_response, current_app, abort
from werkzeug.exceptions import NotAcceptable
from werkzeug.wrappers import BaseResponse
from werkzeug.http import http_date

from moxie.core.exceptions import ApplicationException, exception_handler
from moxie.core.metrics import statsd

def accepts(*accept_values):
    """Given a list of mime-types this view should route responses
    through depending upon the request Accept headers.
    """
    def wrapper(f):
        mimetypes = getattr(f, 'mimetypes', [])
        mimetypes.extend(accept_values)
        mimetypes = setattr(f, 'mimetypes', mimetypes)
        return f
    return wrapper

class ServiceMetaclass(type):
    """Metaclass which picks up any Service Responses and registers them.
    Service Responses:
        Methods which are decorated with @accepts this sets a .mimetypes
        attribute on the method listing any mimetypes which the method supports
    Note: We also register service_responses from our base classes.
    """
    def __new__(cls, name, bases, attrs):
        service_responses = dict()
        for b in bases:  # Bases first so they get (correctly?) overriden
            service_responses.update(getattr(b, 'service_responses', dict()))
        for attr in attrs.values():
            mimetypes = getattr(attr, 'mimetypes', [])
            for mt in mimetypes:
                service_responses[mt] = attr
        attrs['service_responses'] = service_responses
        return type.__new__(cls, name, bases, attrs)

class ServiceView(View):

    __metaclass__ = ServiceMetaclass
    default_response = NotAcceptable
    methods = ['GET', 'OPTIONS']

    cors_allow_headers = ''
    cors_allow_credentials = False
    cors_max_age = 21600

    # Set to a timedelta or datetime to control HTTP caching headers
    expires = None

    @classmethod
    def as_view(cls, *args, **kwargs):
        view = super(ServiceView, cls).as_view(*args, **kwargs)
        view.provide_automatic_options = False
        return view

    def _handle_options(self):
        options_resp = current_app.make_default_options_response()
        return self._cors_headers(options_resp, preflight=True)

    def _cors_headers(self, response, preflight=False, origin=None):
        """Applies the appropriate CORS headers for a given Response"""
        if not origin and request:  # Origin must exist in a valid CORS request
            origin = request.headers.get('origin')
        h = {}
        allow_origins = current_app.config.get('DEFAULT_ALLOW_ORIGINS', [])
        if not self.cors_allow_credentials:
            h['Access-Control-Allow-Origin'] = '*'
        elif current_app.debug or origin in allow_origins:
            h['Access-Control-Allow-Origin'] = origin
        else:
            abort(400)
        if preflight:
            h['Access-Control-Allow-Methods'] = response.headers['allow']
            h['Access-Control-Max-Age'] = str(self.cors_max_age)
            if self.cors_allow_headers:
                h['Access-Control-Allow-Headers'] = self.cors_allow_headers
        if self.cors_allow_credentials:
            h['Access-Control-Allow-Credentials'] = 'true'
        response.headers.extend(h)
        return response

    def _expires_headers(self, response):
        """Applies Expires and Cache-Control headers
        :param response: response to extend
        :return: response
        """
        h = {}
        if self.expires:
            if isinstance(self.expires, timedelta):
                now = datetime.utcnow()
                now += self.expires
                h['Expires'] = http_date(now)
                h['Cache-Control'] = 'max-age={seconds}'.format(seconds=int(self.expires.total_seconds()))
            elif isinstance(self.expires, dt.datetime):
                difference = self.expires - datetime.utcnow()
                h['Expires'] = http_date(self.expires)
                h['Cache-Control'] = 'max-age={seconds}'.format(seconds=difference.seconds)
            response.headers.extend(h)
        return response

    def dispatch_request(self, *args, **kwargs):
        """Finds the best_match service_response from those registered
        If no good service_response can be found we generally want to
        return a NotAcceptable 406.
        """
        if request.method == 'OPTIONS':
            return self._handle_options()
        best_match = request.accept_mimetypes.best_match(
                self.service_responses.keys())
        if best_match:
            service_response = self.service_responses[best_match]
            try:
                with statsd.timer('{module}.{view}'.format(module=self.__module__, view=self.__class__.__name__)):
                    response = self.handle_request(*args, **kwargs)
                    response = make_response(service_response(self, response))
                    response = self._expires_headers(response)
            except ApplicationException as ae:
                response = exception_handler(ae)
            except:
                if current_app.debug:
                    raise
                response = exception_handler(ApplicationException())
            response = self._cors_headers(response)
            return response
        else:
            return self.default_response()

    def handle_request(self):
        """This function should be implemented by all views to build
        a common response object. Usually in the form of a Python
        dictionary object. This response is then formatted and returned
        by a method depending upon the request headers Accept mimetypes.
        """
        return dict()

    @accepts('application/json')
    def as_json(self, response):
        if issubclass(type(response),
                (BaseResponse, current_app.response_class)):
            return response
        else:
            return jsonify(response)