text:
package com.basdado.trainfinder.controller;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import javax.annotation.PostConstruct;
import javax.cache.Cache;
import javax.cache.CacheManager;
import javax.ejb.Singleton;
import javax.inject.Inject;

import org.apache.commons.lang3.tuple.ImmutableTriple;
import org.apache.commons.lang3.tuple.Triple;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.basdado.trainfinder.config.ConfigService;
import com.basdado.trainfinder.config.OpenStreetMapConfiguration;
import com.basdado.trainfinder.exception.PathFindingException;
import com.basdado.trainfinder.model.LatLng;
import com.basdado.trainfinder.model.OsmRailwayMap;
import com.basdado.trainfinder.model.OsmRailwayMap.OsmRailwayMapNode;
import com.basdado.trainfinder.model.Railway;
import com.basdado.trainfinder.model.Station;
import com.basdado.trainfinder.util.CoordinateUtil;
import com.basdado.trainfinder.util.RailwayMapUtil;

import de.topobyte.osm4j.core.access.OsmHandler;
import de.topobyte.osm4j.core.access.OsmInputException;
import de.topobyte.osm4j.core.model.iface.OsmBounds;
import de.topobyte.osm4j.core.model.iface.OsmNode;
import de.topobyte.osm4j.core.model.iface.OsmRelation;
import de.topobyte.osm4j.core.model.iface.OsmTag;
import de.topobyte.osm4j.core.model.iface.OsmWay;
import de.topobyte.osm4j.xml.dynsax.OsmXmlReader;

@Singleton
public class TrainRoutingController {

	private static final String RAILWAY_CACHE_KEY = "railwayPathCache";

	private static final Logger logger = LoggerFactory.getLogger(TrainRoutingController.class);

	@Inject private ConfigService configService;
	@Inject private CacheManager cacheManager;

	private OsmRailwayMap railwayMap;
	private Map<String, Boolean> nodesAddedNearStation;

	private Cache<String, Railway> railwayCache;

	@PostConstruct
	private void init() {

		OpenStreetMapConfiguration osmConfig = configService.getOpenStreetMapConfiguration();

		OsmXmlReader xmlReader;
		try {
			final String railRoadFile = osmConfig.getRailroadFile();
			logger.info("Reading railway map at: " + railRoadFile);
			xmlReader = new OsmXmlReader(railRoadFile, true);
		} catch (FileNotFoundException e) {
			throw new IllegalArgumentException("File not found: " + osmConfig.getRailroadFile(), e);
		}

		this.railwayMap = new OsmRailwayMap();
		xmlReader.setHandler(new OsmRailwayMapReader(railwayMap));
		try {
			xmlReader.read();
		} catch (OsmInputException e) {
			throw new IllegalArgumentException("Error in OSM file", e);
		}
		nodesAddedNearStation = new HashMap<>();

		logger.info("Railway map was read succesfully, using " + railwayMap.getNodes().size() + " nodes");

		railwayCache = (Cache<String, Railway>)
				cacheManager.getCache(RAILWAY_CACHE_KEY, String.class, Railway.class);
	}

	public Railway getRailway(Station from, Station to) throws PathFindingException {

		if (nodesAddedNearStation.get(from.getCode()) == null || !nodesAddedNearStation.get(from.getCode())) {
			addNodesOnTracksNear(from.getLocation());
			nodesAddedNearStation.put(from.getCode(), true);
		}

		if (nodesAddedNearStation.get(to.getCode()) == null || !nodesAddedNearStation.get(to.getCode())) {
			addNodesOnTracksNear(to.getLocation());
			nodesAddedNearStation.put(to.getCode(), true);
		}

		Railway res = railwayCache.get(getCacheKey(from, to));
		if (res == null) {
			// Try to get it from the inverse path:
			Railway inverseRes = railwayCache.get(getCacheKey(to, from));
			if (inverseRes != null) {
				res = inverseRes.reversed();
			}
		}
		if (res == null) {
			// Actually calculate it
			logger.info("Calculating path from station " + from.getShortName() + "(" + from.getCode() + ") to " + to.getShortName() + "(" + to.getCode() + ").");
			List<Long> pathNodes = calculateShortestPathBetween(from.getLocation(), to.getLocation());
			if (pathNodes != null) {
				res = generateRailway(pathNodes, from, to);
				railwayCache.put(getCacheKey(from, to), res);
			}
		}

		return res;
	}

	private String getCacheKey(Station from, Station to) {
		return from.getCode() + "-" + to.getCode();
	}

	private List<Long> calculateShortestPathBetween(LatLng from, LatLng to) throws PathFindingException {

		List<Long> sourceNodes = findNodesNear(from);
		if (sourceNodes.isEmpty()) {
			sourceNodes = addNodesOnTracksNear(from);
		}
		if (sourceNodes.isEmpty()) {
			throw new PathFindingException("Could not find railway nodes near from coordinate " + from);
		}
		List<Long> destNodes = findNodesNear(to);
		if (destNodes.isEmpty()) {
			destNodes = addNodesOnTracksNear(to);
		}
		if (destNodes.isEmpty()) {
			throw new PathFindingException("Could not find railway nodes near to coordinate " + to);
		}

		// First try to find a path directly from the closest node to "from" to the closest node to "to".
		List<Long> pathNodes = RailwayMapUtil.calculateShortestPathBetween(railwayMap, sourceNodes.get(0), new HashSet<>(Arrays.asList(destNodes.get(0))));
		if (pathNodes != null && !pathNodes.isEmpty()) {
			return pathNodes;
		}

		// Otherwise, try any combination of nodes
		for (Long sourceNodeId : sourceNodes) {

			pathNodes = RailwayMapUtil.calculateShortestPathBetween(railwayMap, sourceNodeId, new HashSet<>(Arrays.asList(destNodes.get(0))));
			if (pathNodes != null && !pathNodes.isEmpty()) {
				return pathNodes;
			}
		}

		throw new PathFindingException("Could not find a path from " + from + " to " + to);
	}

	private Railway generateRailway(List<Long> pathNodes, Station from, Station to) {

		LatLng[] path = new LatLng[pathNodes.size()];
		double[] distanceUntil = new double[pathNodes.size()];
		Long previousPathNodeId = null;
		OsmRailwayMapNode previousPathNode = null;
		int i = 0;

		for (Long pathNodeId : pathNodes) {

			OsmRailwayMapNode pathNode = railwayMap.getNode(pathNodeId);
			path[i] = pathNode.getPosition();
			if (i == 0) {
				distanceUntil[i] = 0;
			} else {
				double distanceToPreviousNode = pathNode.isConnectedTo(previousPathNodeId) ?
						pathNode.getDistanceToConnectedNode(previousPathNodeId) :
						CoordinateUtil.dist(pathNode.getPosition(), previousPathNode.getPosition());

				distanceUntil[i] = distanceUntil[i - 1] + distanceToPreviousNode;
			}

			previousPathNodeId = pathNodeId;
			previousPathNode = pathNode;
			i++;
		}

		return new Railway(path, distanceUntil, from, to);
	}

	private List<Long> findNodesNear(LatLng pos) {
		List<Long> preferredNodes = railwayMap.findNodesNear(pos, configService.getOpenStreetMapConfiguration().getPreferredStationToTrackDistance());
//		if (preferredNodes.isEmpty()) {
//			return railwayMap.findNodesNear(pos, configService.getOpenStreetMapConfiguration().getMaxStationToTrackDistance());
//		} else {
			return preferredNodes;
//		}
	}

	private List<Long> addNodesOnTracksNear(LatLng pos) {
		return addNodesOnTracksNear(pos, configService.getOpenStreetMapConfiguration().getPreferredStationToTrackDistance());
	}

	/**
	 * Adds nodes on the tracks near the given position (to make navigation easier).
	 * Returns the IDs of the added nodes if any. If no IDs are returned, then
	 * no track were found near the given position within maxDist.
	 *
	 * @param pos
	 * @param maxDist
	 * @return
	 */
	private List<Long> addNodesOnTracksNear(LatLng pos, double maxDist) {

		double trackNodeDistance = railwayMap.getLongestNodeConnectionDistance() + maxDist;
		List<Long> nearbyTrackNodes = railwayMap.findNodesNear(pos, trackNodeDistance);

		// Triple: left = existing node 1, middle = existing node 2, right = new node.
		List<Triple<Long, Long, Long>> addedNodes = new ArrayList<>();

		// Find all paths (lines) that pass nearby pos.
		for (Long nodeId : nearbyTrackNodes) {
			OsmRailwayMapNode node = railwayMap.getNode(nodeId);
			for (Long neighborNodeId : node.getConnections().keySet()) {
				if (nodeId < neighborNodeId) { // To prevent calculating this twice for the same path
					OsmRailwayMapNode neighborNode = railwayMap.getNode(neighborNodeId);

					double trackDist = CoordinateUtil.crossTrackDist(node.getPosition(), neighborNode.getPosition(), pos);
					if (trackDist < maxDist) { // This track passes by close enough, so let's add a new node:

						long newNodeId = addNodeOnPath(node.getPosition(), neighborNode.getPosition(), pos);
						addedNodes.add(new ImmutableTriple<>(nodeId, neighborNodeId, newNodeId));

					}

				}
			}
		}

		// Fix the connections
		for (Triple<Long, Long, Long> addedNode : addedNodes) {

			Long node1Id = addedNode.getLeft();
			Long node2Id = addedNode.getMiddle();
			Long newNodeId = addedNode.getRight();

			railwayMap.removeConnection(node1Id, node2Id);
			railwayMap.addWay(Arrays.asList(node1Id, newNodeId, node2Id));
		}

		return addedNodes.stream().map(n -> n.getRight())
				.sorted(Comparator.comparing(a -> CoordinateUtil.angularDist(railwayMap.getNode(a).getPosition(), pos)))
				.collect(Collectors.toList());

	}

	private Long addNodeOnPath(LatLng c1, LatLng c2, LatLng pos) {

		double alongTrack = CoordinateUtil.alongTrackDist(c1, c2, pos);
		double trackLength = CoordinateUtil.dist(c1, c2);

		LatLng nodeOnPathPos = CoordinateUtil.interpolate(c1, c2, alongTrack / trackLength);
		long newNodeId = 0;
		// Find the first free node index
		while(railwayMap.getNode(newNodeId) != null) {
			newNodeId++;
		}

		railwayMap.addNode(newNodeId, new OsmRailwayMapNode(nodeOnPathPos));

		return newNodeId;
	}

	private class OsmRailwayMapReader implements OsmHandler {

		private final OsmRailwayMap target;

		public OsmRailwayMapReader(OsmRailwayMap target) {
			this.target = target;
		}

		@Override
		public void complete() throws IOException {
			target.clean();
		}

		@Override
		public void handle(OsmBounds bounds) throws IOException {
			// We don't care about bounds for the train map
		}

		@Override
		public void handle(OsmNode node) throws IOException {
			target.addNode(node);

		}

		@Override
		public void handle(OsmWay way) throws IOException {

			boolean isRailway = false;
			for (int i = 0; i < way.getNumberOfTags(); i++) {
				OsmTag tag = way.getTag(i);
				if ("railway".equals(tag.getKey()) && "rail".equals(tag.getValue())) {
					isRailway = true;
					break;
				}
			}

			if (isRailway) {
				target.addWay(way);
			}

		}

		@Override
		public void handle(OsmRelation arg0) throws IOException {
			// Not important for railway map
		}

	}
}


text:
<?php
namespace Application\Form\Element;

use Zend\InputFilter\InputProviderInterface;

class Number extends \Zend\Form\Element\Number implements InputProviderInterface {
    use InputFilterTrait;
}

redpajama_set_name: RedPajamaGithub


text:
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/*
Copyright 2014 Mozilla Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

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

'use strict';

var VIEWER_URL = chrome.extension.getURL('content/web/viewer.html');

function getViewerURL(pdf_url) {
  return VIEWER_URL + '?file=' + encodeURIComponent(pdf_url);
}

document.addEventListener('beforeload', function(event) {
  var elem = event.target;
  if (elem.nodeName.toUpperCase() !== 'EMBED') {
    return;
  }
  if (!/^application\/pdf$/i.test(elem.type)) {
    return;
  }
  event.preventDefault();
  elem.type = 'text/html';
  elem.src = getViewerURL(elem.src);
}, true);


text:
using System.Collections.Generic;
using Syslog.Framework.Logging.TransportProtocols;

namespace Syslog.Framework.Logging
{
	public class SyslogLoggerSettings
	{
		#region Fields and Methods

		/// <summary>
		/// Gets or sets the protocol used to send messages to a Syslog server.
		/// </summary>
		public TransportProtocol MessageTransportProtocol { get; set; } = TransportProtocol.Udp;

		/// <summary>
		/// Gets or sets the host for the Syslog server.
		/// </summary>
		/// <remarks>
		/// Used only when <see cref="MessageTransportProtocol"/> is set to <see cref="TransportProtocol.Udp"/>.
		/// </remarks>
		public string ServerHost { get; set; } = "127.0.0.1";

		/// <summary>
		/// Gets or sets the port for the Syslog server.
		/// </summary>
		/// <remarks>
		/// Used only when <see cref="MessageTransportProtocol"/> is set to <see cref="TransportProtocol.Udp"/>.
		/// </remarks>
		public int ServerPort { get; set; } = 514;

		/// <summary>
		/// Gets or sets the path to a Unix socket for logging.
		/// </summary>
		/// <remarks>
		/// Used only when <see cref="MessageTransportProtocol"/> is set to <see cref="TransportProtocol.UnixSocket"/>.
		/// </remarks>
		public string UnixSocketPath { get; set; } = "/dev/log";

		/// <summary>
		/// Gets or sets the facility type.
		/// </summary>
		public FacilityType FacilityType { get; set; } = FacilityType.Local0;

		/// <summary>
		/// Gets or sets the header type. Set this instead of HeaderFormat.
		/// </summary>
		public SyslogHeaderType HeaderType { get; set; } = SyslogHeaderType.Rfc3164; // Default to 3164 to be backwards compatible with v1.

		/// <summary>
		/// Structured data that is sent with every request. Only for RFC 5424.
		/// </summary>
		public IEnumerable<SyslogStructuredData> StructuredData { get; set; }

		/// <summary>
		/// Gets or sets whether to log messages using UTC or local time. Defaults to false (use local time).
		/// </summary>
		public bool UseUtc { get; set; } = false; // Default to false to be backwards compatible with v1.

		/// <summary>
		/// Gets or sets custom implementation of transport protocol.
		/// </summary>
		/// <remarks>
		/// When it is set, <see cref="MessageTransportProtocol"/> is ignored.
		/// </remarks>
		public IMessageSender CustomMessageSender { get; set; }

		#endregion
	}

	/// <summary>
	/// Allows sending of structured data in RFC 5424.
	/// </summary>
	public class SyslogStructuredData
	{
		/// <summary>
		/// Creates an instance of SyslogStructuredData.
		/// </summary>
		public SyslogStructuredData()
		{
		}

		/// <summary>
		/// Creates an instance of SyslogStructuredData.
		/// </summary>
		/// <param name="id"></param>
		public SyslogStructuredData(string id)
		{
			Id = id;
		}

		/// <summary>
		/// Gets the ID for the structured data.
		/// </summary>
		public string Id { get; set; }

		/// <summary>
		/// Gets the list of structured data elements.
		/// </summary>
		public IEnumerable<SylogStructuredDataElement> Elements { get; set; }
	}

	/// <summary>
	/// A named value for structured data.
	/// </summary>
	public class SylogStructuredDataElement
	{
		/// <summary>
		/// Creates an instance of SylogStructuredDataElement.
		/// </summary>
		public SylogStructuredDataElement()
		{
		}

		/// <summary>
		/// Creates an instance of SylogStructuredDataElement.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="value"></param>
		public SylogStructuredDataElement(string name, string value)
		{
			Name = name;
			Value = value;
		}

		/// <summary>
		/// Gets the name of the element.
		/// </summary>
		public string Name { get; set; }

		/// <summary>
		/// Gets the value of the element.
		/// </summary>
		public string Value { get; set; }
	}
}


text:
require 'test_helper'

class MessagesControllerTest < ActionDispatch::IntegrationTest
  test "should get index" do
    get messages_index_url
    assert_response :success
  end

  test "should get show" do
    get messages_show_url
    assert_response :success
  end

  test "should get new" do
    get messages_new_url
    assert_response :success
  end

  test "should get create" do
    get messages_create_url
    assert_response :success
  end

  test "should get edit" do
    get messages_edit_url
    assert_response :success
  end

  test "should get update" do
    get messages_update_url
    assert_response :success
  end

  test "should get destroy" do
    get messages_destroy_url
    assert_response :success
  end

end


text:
def format_function(func, params, attrs=None):
    if attrs is None:
        attrs = []
    tname = type(func).__name__
    name = func.name
    kwargs_input = [f"{arg}={val}" for arg, val in params.items()]
    input = ", ".join(kwargs_input)
    msg = f"{tname}({input})"
    if name is not None:
        msg += f": {name}"

    msg += "\n"
    for a in attrs:
        msg += _format_named_arr(a[0], a[1])
    return msg

def _format_named_arr(name, arr):
    from textwrap import TextWrapper

    prefix = f"  {name}: "
    wrapper = TextWrapper(initial_indent=prefix)
    msg = wrapper.fill(str(arr).split("\n")[0]) + "\n"
    prefix = "     "
    wrapper = TextWrapper(initial_indent=prefix, subsequent_indent=prefix)
    for s in str(arr).split("\n")[1:]:
        msg += wrapper.fill(s) + "\n"
    return msg[:-1]


text:
import identity.Identity as identity
import gnupg
import InitializationMod
from identity.ImageStorage import ImageStorage
from identity.RicardianContract import *

class DemoData(object):

    def __init__(self):

        self.merchant_data = list()
        self.notary_data = list()

        gpg_which = InitializationMod.which('gpg')
        gpg = InitializationMod.BazaarInit.gen_keys(gpg_which)
        pub_key_armor = gpg.export_keys(gpg.list_keys()[0]['keyid'])
        priv_key_armor = gpg.export_keys(gpg.list_keys()[0]['keyid'], secret=True)
        guid = InitializationMod.BazaarInit.create_GUID(str(gpg.sign(pub_key_armor, binary=True)))

        #Code to create a merchant
        #merchant dictionary
        merch_dict = dict()
        merch_dict2 = dict()
        merch_dict3 = dict()
        merch_dict4 = dict()

        #listing dictionary
        listing_dict = dict()
        listing_dict2 = dict()
        listing_dict3 = dict()
        listing_dict4 = dict()
        listing_dict5 = dict()
        listing_dict6 = dict()

        #listings for merchant 1
        listing_dict['expiry'] = "12/25/15"
        listing_dict['price'] = "1000"
        listing_dict['bitcoin_address'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        listing_dict['item_name'] = "Custom Computer Intel Core i7, 16GB Ram, 3TB"
        listing_dict['keywords'] = "custom, computer, liquidcooling, used, intel, core, i7"
        listing_dict['description'] = "Slightly used custom built gaming computer. Specs are as follows: Intel Core i7 4770K, 16GB Ram, 3TB, 240GB SSD, GTX 760ti"
        listing_dict['images'] = list()

        #add image to listing
        listing_dict['images'].append(DemoDataStrings.computer)

        #listings for merchant 2
        listing_dict2['expiry'] = "12/25/16"
        listing_dict2['price'] = "50"
        listing_dict2['bitcoin_address'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        listing_dict2['item_name'] = "Cleveland Indians Fitted (7 1/2)"
        listing_dict2['keywords'] = "fiftyninefifty,fitted,lids,mlb,baseball,hat"
        listing_dict2['description'] = "Cleveland Inidians Original MLB Fitted"
        listing_dict2['images'] = list()

        #add image to listing
        listing_dict2['images'].append(DemoDataStrings.cleveland)

        #listings for merchant 3
        listing_dict3['expiry'] = "12/25/16"
        listing_dict3['price'] = "1000"
        listing_dict3['bitcoin_address'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        listing_dict3['item_name'] = "1/2 Carat Diamond Ring"
        listing_dict3['keywords'] = "ring,carat,diamond,gift,wedding"
        listing_dict3['description'] = "1/2 carat diamond ring, beautiful clarity, incredible sparkle, your significant other will adore you!"
        listing_dict3['images'] = list()

        #add image to listing
        listing_dict3['images'].append(DemoDataStrings.ring)

        listing_dict4['expiry'] = "12/25/15"
        listing_dict4['price'] = "10000"
        listing_dict4['bitcoin_address'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        listing_dict4['item_name'] = "1 Carat Diamond Necklace"
        listing_dict4['keywords'] = "necklace,carat,diamond,gift,beautiful"
        listing_dict4['description'] = "Diamond necklace perfect for that special somebody!"
        listing_dict4['images'] = list()

        #add image to listing
        listing_dict4['images'].append(DemoDataStrings.necklace)

        #listings for merchant 4
        listing_dict5['expiry'] = "12/25/15"
        listing_dict5['price'] = "100"
        listing_dict5['bitcoin_address'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        listing_dict5['item_name'] = "PVL Iso-Gold Premium Isolated Whey Protein *Exclusive Bonus Size!*, 6 lbs"
        listing_dict5['keywords'] = "protein,whey,gold,premium"
        listing_dict5['description'] = "PVL has always been a manufacturer of superior protein products, and the new 2012 formula of Iso-Gold exceeds expectations. Using the latest research this formula improves on their already premier formula, you can expect to see the extra features help boost your immune system and digest the protein even easier. Taking Iso-Gold before or after training will excel your recovery rate and improve on building muscles."
        listing_dict5['images'] = list()

        #add image to listing
        listing_dict5['images'].append(DemoDataStrings.protienfront)
        listing_dict5['images'].append(DemoDataStrings.protienback)

        #listings for merchant 4atman
        listing_dict6['expiry'] = "12/25/15"
        listing_dict6['price'] = "50"
        listing_dict6['bitcoin_address'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        listing_dict6['item_name'] = "BSN N.O.-XPLODE *Exclusive Bonus Size*, 999 Grams"
        listing_dict6['keywords'] = "preworkout,energy,noxplode"
        listing_dict6['description'] = "The Original Pre-Workout Igniter. Re-engineered."
        listing_dict6['images'] = list()

        #add image to listing
        listing_dict6['images'].append(DemoDataStrings.prefront)
        listing_dict6['images'].append(DemoDataStrings.preback)

        merch_dict['guid'] = guid
        merch_dict['pubkey'] = pub_key_armor
        merch_dict['email'] = "mandeldr@mcmaster.ca"
        merch_dict['nickname'] = "DanuelGinobli"
        merch_dict['bitcoinReceivingAddress'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        merch_dict['storeDescription'] = "The best computer wholesaler on the OpenBazaar"
        merch_dict['myListings'] = [identity.RicardianContract(listing_dict, merch_dict, guid, pub_key_armor)]
        merch_dict['avatar'] = ImageStorage(DemoDataStrings.danny_profile)

        merch_dict2['guid'] = guid
        merch_dict2['pubkey'] = pub_key_armor
        merch_dict2['email'] = "info@hatman.ca"
        merch_dict2['nickname'] = "The Hat Man"
        merch_dict2['bitcoinReceivingAddress'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        merch_dict2['storeDescription'] = "The best fitted hat wholesaler on the OpenBazaar"
        merch_dict2['myListings'] = [identity.RicardianContract(listing_dict2, merch_dict2, guid, pub_key_armor)]
        merch_dict2['avatar'] = ImageStorage(DemoDataStrings.hatman)

        merch_dict3['guid'] = guid
        merch_dict3['pubkey'] = pub_key_armor
        merch_dict3['email'] = "marilyn@marilynsjewellery.com"
        merch_dict3['nickname'] = "Marilyn's Jewellery"
        merch_dict3['bitcoinReceivingAddress'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        merch_dict3['storeDescription'] = "The hottest diamonds on the OpenBazaar"
        merch_dict3['myListings'] = [identity.RicardianContract(listing_dict3, merch_dict3, guid, pub_key_armor), identity.RicardianContract(listing_dict4, merch_dict3, guid, pub_key_armor)]
        merch_dict3['avatar'] = ImageStorage(DemoDataStrings.marlyn)

        merch_dict4['guid'] = guid
        merch_dict4['pubkey'] = pub_key_armor
        merch_dict4['email'] = "popeyes@popeyessupplements.com"
        merch_dict4['nickname'] = "Popeye's Supplement Store"
        merch_dict4['bitcoinReceivingAddress'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        merch_dict4['storeDescription'] = "Supplements Lowest Prices!"
        merch_dict4['myListings'] = [identity.RicardianContract(listing_dict5, merch_dict4, guid, pub_key_armor), identity.RicardianContract(listing_dict6, merch_dict4, guid, pub_key_armor)]
        merch_dict4['avatar'] = ImageStorage(DemoDataStrings.popeye)

        self.merchant_data.append(identity.Merchant(merch_dict4))
        self.merchant_data.append(identity.Merchant(merch_dict3))
        self.merchant_data.append(identity.Merchant(merch_dict2))
        self.merchant_data.append(identity.Merchant(merch_dict))

        #code to create a notary
        #give notary instance to DemoData

        #create an empty dict and populate fields with notary data
        notary_dict = dict()
        notary_dict['pubkey'] = pub_key_armor
        notary_dict['fee'] = "0.5"
        notary_dict['name'] = "Marilyn's Jewellery"
        notary_dict['guid'] = guid
        notary_dict['bitcoinReceivingAddress'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        notary_dict['email'] = "marilyn@marilynsjewellery.com"
        notary_dict['description'] = "The Hottest Service"
        notary_dict['avatar'] = ImageStorage(DemoDataStrings.marlyn)

        notary_dict1 = dict()
        notary_dict1['pubkey'] = pub_key_armor
        notary_dict1['fee'] = "0.25"
        notary_dict1['name'] = "DanuelGinobli"
        notary_dict1['guid'] = guid
        notary_dict1['bitcoinReceivingAddress'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        notary_dict1['email'] = "mandeldr@mcmaster.ca"
        notary_dict1['description'] = "Standard notarization services, great service, fair prices!"
        notary_dict1['avatar'] = ImageStorage(DemoDataStrings.danny_profile)

        notary_dict2 = dict()
        notary_dict2['pubkey'] = pub_key_armor
        notary_dict2['fee'] = "0.1"
        notary_dict2['name'] = "Popeye's Supplement Store"
        notary_dict2['guid'] = guid
        notary_dict2['bitcoinReceivingAddress'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        notary_dict2['email'] = "popeyes@popeyessupplements.com"
        notary_dict2['description'] = "The strongest service in town"
        notary_dict2['avatar'] = ImageStorage(DemoDataStrings.popeye)

        notary_dict3 = dict()
        notary_dict3['pubkey'] = pub_key_armor
        notary_dict3['fee'] = "free"
        notary_dict3['name'] = "The Hat Man"
        notary_dict3['guid'] = guid
        notary_dict3['bitcoinReceivingAddress'] = "19PhnZCxayeitE3D3SjWWJ3QbN9UEU2mMV"
        notary_dict3['email'] = "info@hatman.ca"
        notary_dict3['description'] = "Standard notarization services, great service, fair prices!"
        notary_dict3['avatar'] = ImageStorage(DemoDataStrings.hatman)

        #now set the notary settings
        self.notary_data.append(identity.NotaryRepresentation(notary_dict))
        self.notary_data.append(identity.NotaryRepresentation(notary_dict1))
        self.notary_data.append(identity.NotaryRepresentation(notary_dict2))
        self.notary_data.append(identity.NotaryRepresentation(notary_dict3))

    def get_notary_data(self):
        return self.notary_data

    def get_merchant_data(self):
        return self.merchant_data

class DemoDataStrings(object):
    computer = "images/demo/computer.jpg"
    danny_profile = "images/demo/danny_profile.jpg"

    cleveland = "images/demo/cleveland.jpg"
    hatman = "images/demo/hatman.jpg"

    marlyn = "images/demo/marilyn.jpg"
    ring = "images/demo/ring.jpg"
    necklace = "images/demo/necklace.jpg"

    popeye = "images/demo/popeyes.png"
    protienback = "images/demo/protienback.jpg"
    protienfront = "images/demo/protienfront.png"
    preback = "images/demo/preback.png"
    prefront = "images/demo/prefront.jpg"


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@android:color/white" />
    <corners android:topLeftRadius="@dimen/auto_dimen2_6" />
    <padding
        android:left="@dimen/auto_dimen2_2"
        android:top="@dimen/auto_dimen2_2"
        android:right="@dimen/auto_dimen2_2" />
</shape>


text:
Podspecs
========

A collection of forked podspecs.

## Setup

Add this spec repo using the command below. Give it a name that starts with a [letter before **M**](http://guides.cocoapods.org/making/private-cocoapods.html#-create-a-private-spec-repo), in this case `forks`.

```
$ git repo add forks https://github.com/phatblat/Podspecs.git
```

It will land in your ~/.cocoapods/repos dir.

## Testing

Use the `pod search` command for simply testing where and how a spec is published.

## License

This repo is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for rights and limitations.