text:
/**
 * Generated with Acceleo
 */
package org.wso2.developerstudio.eclipse.gmf.esb.components;

// Start of user code for imports
import java.util.Iterator;
import java.util.List;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.WrappedException;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcorePackage;

import org.eclipse.emf.ecore.resource.ResourceSet;

import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.emf.ecore.util.EcoreUtil;

import org.eclipse.emf.eef.runtime.api.notify.EStructuralFeatureNotificationFilter;
import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.api.notify.NotificationFilter;

import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;

import org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext;
import org.eclipse.emf.eef.runtime.context.impl.EReferencePropertiesEditionContext;

import org.eclipse.emf.eef.runtime.impl.components.SinglePartPropertiesEditingComponent;

import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;

import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil;

import org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy;

import org.eclipse.emf.eef.runtime.policies.impl.CreateEditingPolicy;

import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;

import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

import org.wso2.developerstudio.eclipse.gmf.esb.ComplexEndpoints;
import org.wso2.developerstudio.eclipse.gmf.esb.ComplexEndpointsOutputConnector;
import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;

import org.wso2.developerstudio.eclipse.gmf.esb.parts.ComplexEndpointsPropertiesEditionPart;
import org.wso2.developerstudio.eclipse.gmf.esb.parts.EsbViewsRepository;

// End of user code

/**
 *
 *
 */
public class ComplexEndpointsPropertiesEditionComponent extends SinglePartPropertiesEditingComponent {

	public static String BASE_PART = "Base"; //$NON-NLS-1$

	/**
	 * Settings for outputConnector ReferencesTable
	 */
	protected ReferencesTableSettings outputConnectorSettings;

	/**
	 * Default constructor
	 *
	 */
	public ComplexEndpointsPropertiesEditionComponent(PropertiesEditingContext editingContext, EObject complexEndpoints, String editing_mode) {
		super(editingContext, complexEndpoints, editing_mode);
		parts = new String[] { BASE_PART };
		repositoryKey = EsbViewsRepository.class;
		partKey = EsbViewsRepository.ComplexEndpoints.class;
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
	 *      org.eclipse.emf.ecore.resource.ResourceSet)
	 *
	 */
	public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
		setInitializing(true);
		if (editingPart != null && key == partKey) {
			editingPart.setContext(elt, allResource);

			final ComplexEndpoints complexEndpoints = (ComplexEndpoints)elt;
			final ComplexEndpointsPropertiesEditionPart basePart = (ComplexEndpointsPropertiesEditionPart)editingPart;
			// init values
			if (isAccessible(EsbViewsRepository.ComplexEndpoints.Properties.description))
				basePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, complexEndpoints.getDescription()));

			if (isAccessible(EsbViewsRepository.ComplexEndpoints.Properties.commentsList))
				basePart.setCommentsList(complexEndpoints.getCommentsList());

			if (isAccessible(EsbViewsRepository.ComplexEndpoints.Properties.outputConnector)) {
				outputConnectorSettings = new ReferencesTableSettings(complexEndpoints, EsbPackage.eINSTANCE.getComplexEndpoints_OutputConnector());
				basePart.initOutputConnector(outputConnectorSettings);
			}
			if (isAccessible(EsbViewsRepository.ComplexEndpoints.Properties.name))
				basePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, complexEndpoints.getName()));

			// init filters

			if (isAccessible(EsbViewsRepository.ComplexEndpoints.Properties.outputConnector)) {
				basePart.addFilterToOutputConnector(new ViewerFilter() {
					/**
					 * {@inheritDoc}
					 *
					 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
					 */
					public boolean select(Viewer viewer, Object parentElement, Object element) {
						return (element instanceof String && element.equals("")) || (element instanceof ComplexEndpointsOutputConnector); //$NON-NLS-1$
					}

				});
				// Start of user code for additional businessfilters for outputConnector
				// End of user code
			}

			// init values for referenced views

			// init filters for referenced views

		}
		setInitializing(false);
	}

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#associatedFeature(java.lang.Object)
	 */
	public EStructuralFeature associatedFeature(Object editorKey) {
		if (editorKey == EsbViewsRepository.ComplexEndpoints.Properties.description) {
			return EsbPackage.eINSTANCE.getEsbElement_Description();
		}
		if (editorKey == EsbViewsRepository.ComplexEndpoints.Properties.commentsList) {
			return EsbPackage.eINSTANCE.getEsbElement_CommentsList();
		}
		if (editorKey == EsbViewsRepository.ComplexEndpoints.Properties.outputConnector) {
			return EsbPackage.eINSTANCE.getComplexEndpoints_OutputConnector();
		}
		if (editorKey == EsbViewsRepository.ComplexEndpoints.Properties.name) {
			return EsbPackage.eINSTANCE.getComplexEndpoints_Name();
		}
		return super.associatedFeature(editorKey);
	}

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
	 *
	 */
	public void updateSemanticModel(final IPropertiesEditionEvent event) {
		ComplexEndpoints complexEndpoints = (ComplexEndpoints)semanticObject;
		if (EsbViewsRepository.ComplexEndpoints.Properties.description == event.getAffectedEditor()) {
			complexEndpoints.setDescription((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String)event.getNewValue()));
		}
		if (EsbViewsRepository.ComplexEndpoints.Properties.commentsList == event.getAffectedEditor()) {
			if (event.getKind() == PropertiesEditionEvent.SET) {
				complexEndpoints.getCommentsList().clear();
				complexEndpoints.getCommentsList().addAll(((EList) event.getNewValue()));
			}
		}
		if (EsbViewsRepository.ComplexEndpoints.Properties.outputConnector == event.getAffectedEditor()) {
			if (event.getKind() == PropertiesEditionEvent.ADD) {
				EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, outputConnectorSettings, editingContext.getAdapterFactory());
				PropertiesEditingProvider provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt(semanticObject, PropertiesEditingProvider.class);
				if (provider != null) {
					PropertiesEditingPolicy policy = provider.getPolicy(context);
					if (policy instanceof CreateEditingPolicy) {
						policy.execute();
					}
				}
			} else if (event.getKind() == PropertiesEditionEvent.EDIT) {
				EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(editingContext, this, (EObject) event.getNewValue(), editingContext.getAdapterFactory());
				PropertiesEditingProvider provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt((EObject) event.getNewValue(), PropertiesEditingProvider.class);
				if (provider != null) {
					PropertiesEditingPolicy editionPolicy = provider.getPolicy(context);
					if (editionPolicy != null) {
						editionPolicy.execute();
					}
				}
			} else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
				outputConnectorSettings.removeFromReference((EObject) event.getNewValue());
			} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
				outputConnectorSettings.move(event.getNewIndex(), (ComplexEndpointsOutputConnector) event.getNewValue());
			}
		}
		if (EsbViewsRepository.ComplexEndpoints.Properties.name == event.getAffectedEditor()) {
			complexEndpoints.setName((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String)event.getNewValue()));
		}
	}

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
	 */
	public void updatePart(Notification msg) {
		super.updatePart(msg);
		if (editingPart.isVisible()) {
			ComplexEndpointsPropertiesEditionPart basePart = (ComplexEndpointsPropertiesEditionPart)editingPart;
			if (EsbPackage.eINSTANCE.getEsbElement_Description().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(EsbViewsRepository.ComplexEndpoints.Properties.description)) {
				if (msg.getNewValue() != null) {
					basePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
				} else {
					basePart.setDescription("");
				}
			}
			if (EsbPackage.eINSTANCE.getEsbElement_CommentsList().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(EsbViewsRepository.ComplexEndpoints.Properties.commentsList)) {
				if (msg.getNewValue() instanceof EList<?>) {
					basePart.setCommentsList((EList<?>)msg.getNewValue());
				} else if (msg.getNewValue() == null) {
					basePart.setCommentsList(new BasicEList<Object>());
				} else {
					BasicEList<Object> newValueAsList = new BasicEList<Object>();
					newValueAsList.add(msg.getNewValue());
					basePart.setCommentsList(newValueAsList);
				}
			}

			if (EsbPackage.eINSTANCE.getComplexEndpoints_OutputConnector().equals(msg.getFeature()) && isAccessible(EsbViewsRepository.ComplexEndpoints.Properties.outputConnector))
				basePart.updateOutputConnector();
			if (EsbPackage.eINSTANCE.getComplexEndpoints_Name().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(EsbViewsRepository.ComplexEndpoints.Properties.name)) {
				if (msg.getNewValue() != null) {
					basePart.setName(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
				} else {
					basePart.setName("");
				}
			}

		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#getNotificationFilters()
	 */
	@Override
	protected NotificationFilter[] getNotificationFilters() {
		NotificationFilter filter = new EStructuralFeatureNotificationFilter(
			EsbPackage.eINSTANCE.getEsbElement_Description(),
			EsbPackage.eINSTANCE.getEsbElement_CommentsList(),
			EsbPackage.eINSTANCE.getComplexEndpoints_OutputConnector(),
			EsbPackage.eINSTANCE.getComplexEndpoints_Name()		);
		return new NotificationFilter[] {filter,};
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
	 *
	 */
	public Diagnostic validateValue(IPropertiesEditionEvent event) {
		Diagnostic ret = Diagnostic.OK_INSTANCE;
		if (event.getNewValue() != null) {
			try {
				if (EsbViewsRepository.ComplexEndpoints.Properties.description == event.getAffectedEditor()) {
					Object newValue = event.getNewValue();
					if (newValue instanceof String) {
						newValue = EEFConverterUtil.createFromString(EsbPackage.eINSTANCE.getEsbElement_Description().getEAttributeType(), (String)newValue);
					}
					ret = Diagnostician.INSTANCE.validate(EsbPackage.eINSTANCE.getEsbElement_Description().getEAttributeType(), newValue);
				}
				if (EsbViewsRepository.ComplexEndpoints.Properties.commentsList == event.getAffectedEditor()) {
					BasicDiagnostic chain = new BasicDiagnostic();
					for (Iterator iterator = ((List)event.getNewValue()).iterator(); iterator.hasNext();) {
						chain.add(Diagnostician.INSTANCE.validate(EsbPackage.eINSTANCE.getEsbElement_CommentsList().getEAttributeType(), iterator.next()));
					}
					ret = chain;
				}
				if (EsbViewsRepository.ComplexEndpoints.Properties.name == event.getAffectedEditor()) {
					Object newValue = event.getNewValue();
					if (newValue instanceof String) {
						newValue = EEFConverterUtil.createFromString(EsbPackage.eINSTANCE.getComplexEndpoints_Name().getEAttributeType(), (String)newValue);
					}
					ret = Diagnostician.INSTANCE.validate(EsbPackage.eINSTANCE.getComplexEndpoints_Name().getEAttributeType(), newValue);
				}
			} catch (IllegalArgumentException iae) {
				ret = BasicDiagnostic.toDiagnostic(iae);
			} catch (WrappedException we) {
				ret = BasicDiagnostic.toDiagnostic(we);
			}
		}
		return ret;
	}

}


text:
package lib

import java.util

import org.hornetq.api.core.{TransportConfiguration}
import org.hornetq.api.core.client._
import org.hornetq.api.core.management.{ResourceNames, ManagementHelper}
import org.hornetq.api.jms.HornetQJMSClient
import org.hornetq.core.remoting.impl.netty.{TransportConstants, NettyConnectorFactory}
import org.hornetq.jms.client.{HornetQQueueConnectionFactory, HornetQConnectionFactory}
import javax.jms._
import play.Play
import play.libs.Json

/**
 * @author Andrii Sergiienko
 * Created by Andrey on 5/8/2015.
 */

class HornetQWrapper(bus_host: String, bus_port: String, bus_user: String, bus_pswd: String) {
  private val cp = new util.HashMap[String,Object]()
  cp.put(TransportConstants.PORT_PROP_NAME,bus_port)
  cp.put(TransportConstants.HOST_PROP_NAME,bus_host)

  // Management Core Connection
  private val tc = new TransportConfiguration(classOf[NettyConnectorFactory].getName(),cp)
  private val l: ServerLocator = HornetQClient.createServerLocatorWithoutHA(tc)
  private val sf: ClientSessionFactory = l.createSessionFactory()
  private val cs: ClientSession = sf.createSession(bus_user,bus_pswd,false,true,true,true,1)
  private val cr: ClientRequestor = new ClientRequestor(cs,"jms.queue.hornetq.management")
  cs.start()
  //

  // Client JMS Connection
  private val jmsConnectionFactory: HornetQConnectionFactory  = new HornetQConnectionFactory(false, tc);
  private val jmsConnection: Connection  = jmsConnectionFactory.createConnection(bus_user,bus_pswd)
  jmsConnection.start()
  //

  def getHostname() : String = {
    return bus_host
  }
  def listQueues() : Map[String,Integer] = {
    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putAttribute(m, ResourceNames.JMS_SERVER, "queueNames")
    val reply: ClientMessage = cr.request(m)
    val queueNamesO: Array[Object] = ManagementHelper.getResult(reply).asInstanceOf[Array[Object]]
    var map: Map[String,Integer] = Map[String,Integer]()
    for (queueName <- queueNamesO) map += (queueName.toString() -> messagesCount(queueName.toString(),ResourceNames.JMS_QUEUE))
    return map
  }

  def listTopics() : Map[String,Integer] = {
    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putAttribute(m, ResourceNames.JMS_SERVER, "topicNames")
    val reply: ClientMessage = cr.request(m)
    val topicNamesO: Array[Object] = ManagementHelper.getResult(reply).asInstanceOf[Array[Object]]
    var map: Map[String,Integer] = Map[String,Integer]()
    for (topicName <- topicNamesO) map += (topicName.toString() -> messagesCount(topicName.toString(),ResourceNames.JMS_TOPIC))
    return map
  }

  def messagesCount(Name: String, qtype: String) : Integer = {
    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putAttribute(m, qtype + Name, "messageCount")
    val reply: ClientMessage = cr.request(m)
    return ManagementHelper.getResult(reply).asInstanceOf[Integer]
  }

  def listAllSubscriptions(Name: String) : Object = {
    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putOperationInvocation(m,ResourceNames.JMS_TOPIC + Name,"listAllSubscriptionsAsJSON")
    val r: ClientMessage = cr.request(m)
    val o = ManagementHelper.getResult(r).asInstanceOf[String]
    val j = Json.parse(o)
    return j
  }

  def listAllPublishers() : Object = {
    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putOperationInvocation(m,ResourceNames.CORE_SERVER,"listProducersInfoAsJSON")
    val r: ClientMessage = cr.request(m)
    val o = ManagementHelper.getResult(r).asInstanceOf[String]
    val j = Json.parse(o)
    return j
  }

  def listAllConsumers() : Object = {
    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putOperationInvocation(m,ResourceNames.JMS_SERVER,"listAllConsumersAsJSON")
    val r: ClientMessage = cr.request(m)
    val o = ManagementHelper.getResult(r).asInstanceOf[String]
    val j = Json.parse(o)
    return j
  }

  def listQueueConsumers(name: String) : Object = {
    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putOperationInvocation(m,ResourceNames.JMS_QUEUE + name,"listConsumersAsJSON")
    val r: ClientMessage = cr.request(m)
    val o = ManagementHelper.getResult(r).asInstanceOf[String]
    val j = Json.parse(o)
    return j
  }

  def getBusDetails() : Map[String,Object] = {
    var m: Map[String,Object] = Map[String,Object]()
    m += ("Version" -> getBusVersion())
    m += ("Clustered" -> getBusClustered())
    m += ("Connections" -> listConnections())
    return m
  }

  private def getBusVersion() : String = {
    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putAttribute(m, ResourceNames.CORE_SERVER, "Version")
    val reply: ClientMessage = cr.request(m)
    return ManagementHelper.getResult(reply).asInstanceOf[String]
  }

  private def getBusClustered() : String = {
    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putAttribute(m, ResourceNames.CORE_SERVER, "Clustered")
    val reply: ClientMessage = cr.request(m)
    val b: Boolean = ManagementHelper.getResult(reply).asInstanceOf[Boolean]
    if (b) return "Clustered" else return "Non-clustered"
  }

  private def listConnections() : Map[String,Integer] = {
    def adjust[A, B](m: Map[A, B], k: A)(f: B => B) = m.updated(k, f(m(k)))

    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putOperationInvocation(m, ResourceNames.CORE_SERVER, "listRemoteAddresses")
    val r: ClientMessage = cr.request(m)
    val o = ManagementHelper.getResult(r).asInstanceOf[Array[Object]]
    var cons: Map[String,Integer] = Map[String,Integer]()
    for(c <- o) {
      val s: String = c.toString()
      val i: Integer = s indexOf ':'
      if (i > 0) {
        val st: String = s.substring(1, i)
        if (cons.contains(st)) cons = adjust(cons, st)(_ + 1) else cons += (st -> 1)
      }
    }
    return cons
  }

  def sendMessageToQueue(queueName: String, message: String, isTopic: Boolean) = {
    val jmsSession: Session  = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE)
    val mp: MessageProducer = jmsSession.createProducer({if (isTopic) jmsSession.createTopic(queueName) else jmsSession.createQueue(queueName)})
    val msg: TextMessage = jmsSession.createTextMessage(message)
    mp.send(msg)
    mp.close()
    jmsSession.close()
  }

  def consumeMessageFromQueue(queueName: String, isTopic: Boolean) : String = {
    val jmsSession: Session  = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    val mc: MessageConsumer = jmsSession.createConsumer({if (isTopic) jmsSession.createTopic(queueName) else jmsSession.createQueue(queueName)})
    val msg: Message = mc.receive(5000)
    mc.close()
    jmsSession.close()
    if (null == msg) return "no message"
    if (msg.isInstanceOf[TextMessage]) {
      return msg.asInstanceOf[TextMessage].getText
    } else return msg.toString
  }

  def removeMessages(Name: String, topic: Boolean) :String = {
    val res: String = { if (topic) ResourceNames.JMS_TOPIC else ResourceNames.JMS_QUEUE }
    val m: ClientMessage = cs.createMessage(false)
    ManagementHelper.putOperationInvocation(m,res + Name,"removeMessages",null)
    val r: ClientMessage = cr.request(m)
    ManagementHelper.getResult(r)
    return "Removed"
  }

  def closeConnection() = {
    cs.stop()
    jmsConnection.stop()
  }
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.ignite.startup.cmdline;

import java.io.*;
import java.util.*;

/**
 * This class is a workaround for a versatile problems with passing arguments to the Ignite Windows batch launcher
 * scripts. It transforms command line options passed to the *.bat launcher scripts into a reformatted, adapted for
 * Windows batch usage variables.
 *

 * The idea behind the workaround is:

 * 1. User runs ignite.bat with some args.

 * 2. ignite.bat calls parseargs.bat with all that args.

 * 3. parsearg.bat runs this class with all that args.

 * 4. This class transforms the args and prints them out.

 * 5. parseargs.bat splits the output of this class and sets each variable it found.

 * 6. ignite.bat uses environment variables as if they were defined by a user.
 *

 *
 * @see JCommander command line parameters parsing library
 */
@SuppressWarnings("FieldCanBeLocal")
public class CommandLineTransformer {
    /** Prefix for every custom JVM option. */
    static final String JVM_OPTION_PREFIX = "-J";

    /** Flag to check in step 5 of the Workaround before splitting the output. */
    private static final String TRANSFORMATION_FAILED_FLAG = "CommandLineTransformerError";

    /** Delimiter used in step 5 of the Workaround. */
    private static final String ARGS_DELIMITER = " ";

    /** Interactive mode. */
    private boolean interactive;

    /** Verbose mode. */
    private boolean verbose;

    /** No pause mode. */
    private boolean noPause;

    /** No JMX mode. */
    private boolean noJMX;

    /** Supported parameter, parsed manually. */
    private String jvmOptions = "";

    /** Supported parameter, parsed manually. */
    private String springCfgPath = "";

    /**
     * Private constructor to promote usage of a factory method {@link #transform(String...)}.
     */
    private CommandLineTransformer() {
        // No-op
    }

    /**
     * Main method being triggered in step 3 of the Workaround.
     *

     * Method prints out TRANSFORMATION_FAILED_FLAG if something went wrong.
     *
     * @param args Command line arguments passed by a user in step 1 of the Workaround.
     */
    public static void main(String[] args) {
        PrintStream ps = null;

        try {
            // Intentionality configure output stream with UTF-8 encoding to support  non-ASCII named parameter values.
            ps = new PrintStream(System.out, true, "UTF-8");

            ps.println(transform(args));
        }
        catch (Throwable t) {
            t.printStackTrace();

            if (ps != null)
                ps.println(TRANSFORMATION_FAILED_FLAG);

            if (t instanceof Error)
                throw (Error)t;
        }
    }

    /**
     * @param args Arguments.
     * @return Transformed arguments.
     */
    public static String transform(String... args) {
        assert args != null;

        return new CommandLineTransformer().doTransformation(args);
    }

    /**
     * Actually does arguments transformation.
     *
     * @param args Arguments.
     * @return Transformed arguments.
     */
    private String doTransformation(String[] args) {
        List<String> argsList = new ArrayList<>();

        for (String arg : args) {
            switch (arg) {
                case "-i":
                    interactive = true;

                    break;

                case "-v":
                    verbose = true;

                    break;

                case "-np":
                    noPause = true;

                    break;

                case "-nojmx":
                    noJMX = true;

                    break;

                default:
                    argsList.add(arg);
            }
        }

        return reformatArguments(argsList);
    }

    /**
     * Transforms parsed arguments into a string.
     *
     * @param args Non-standard arguments.
     * @return Transformed arguments.
     */
    private String reformatArguments(List<String> args) {
        StringBuilder sb = new StringBuilder();

        addArgWithValue(sb, "INTERACTIVE", formatBooleanValue(interactive));
        addArgWithValue(sb, "QUIET", "-DIGNITE_QUIET=" + !verbose);
        addArgWithValue(sb, "NO_PAUSE", formatBooleanValue(noPause));
        addArgWithValue(sb, "NO_JMX", formatBooleanValue(noJMX));

        parseJvmOptionsAndSpringConfig(args);

        addArgWithValue(sb, "JVM_XOPTS", jvmOptions);
        addArgWithValue(sb, "CONFIG", springCfgPath);

        return sb.toString().trim();
    }

    /**
     * Formats boolean value into a string one.
     *
     * @param val Boolean value to be formatted.
     * @return 1 if val is true 0 otherwise.
     */
    private String formatBooleanValue(boolean val) {
        return String.valueOf(val ? 1 : 0);
    }

    /**
     * Transforms one argument.
     *
     * @param sb StringBuilder where transformation result will be written.
     * @param arg Argument's name.
     * @param val Argument's value.
     */
    private void addArgWithValue(StringBuilder sb, String arg, Object val) {
        sb.append("\"");
        sb.append(arg);
        sb.append("=");
        sb.append(val);
        sb.append("\"");
        sb.append(ARGS_DELIMITER);
    }

    /**
     * Manually parses non-trivial (from JCommander point of view) arguments.
     *
     * @param args Collection of unknown (from JCommander point of view) arguments.
     */
    private void parseJvmOptionsAndSpringConfig(Iterable<String> args) {
        for (String arg : args) {
            if (arg.startsWith(JVM_OPTION_PREFIX)) {
                String jvmOpt = arg.substring(JVM_OPTION_PREFIX.length());

                if (!checkJVMOptionIsSupported(jvmOpt))
                    throw new RuntimeException(JVM_OPTION_PREFIX + " JVM parameters for Ignite batch scripts " +
                        "with double quotes are not supported. " +
                        "Use JVM_OPTS environment variable to pass any custom JVM option.");

                jvmOptions = jvmOptions.isEmpty() ? jvmOpt : jvmOptions + " " + jvmOpt;
            }
            else {
                if (springCfgPath.isEmpty())
                    springCfgPath = arg;
                else
                    throw new RuntimeException("Unrecognised parameter has been found: " + arg);
            }
        }
    }

    /**
     * Check if a JVM option is supported. Unsupported options are those who
     * need double quotes in the declaration. It's a limitation of a current Workaround
     *
     * @param jvmOpt JVM option to check.
     * @return true if option is supported false otherwise.
     */
    private boolean checkJVMOptionIsSupported(String jvmOpt) {
        return !(jvmOpt.contains("-XX:OnError") || jvmOpt.contains("-XX:OnOutOfMemoryError"));
    }
}


text:
import keras
from kears.callbacks import Callback

# basic loss history
# usage:
# model.fit(..., callbacks = [LossHistory(), ...])
class LossHistory(Callback):
	def on_train_begin(self, logs = {}):
		self.loss = []
		self.val_loss = []
	def on_epoch_end(self, epoch, logs = {}):
		self.loss.append(logs.get('loss'))
		self.val_loss.append(logs.get('val_loss'))
#


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

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - result.info - boost/fusion/algorithm/query/detail/any.hpp - functions</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">

LCOV - code coverage report

            Current view:
            top level - boost/fusion/algorithm/query/detail - any.hpp (source / functions)

            Hit
            Total
            Coverage

            Test:
            result.info

            Lines:
            7
            7
            100.0 %

            Date:
            2017-07-07 11:26:11

            Functions:
            9
            9
            100.0 %

      Function Name
      Hit count

              _ZN5boost6fusion6detail10linear_anyINS0_13cons_iteratorIKNS0_4consINS_6spirit2qi10char_classINS5_3tag9char_codeINS8_5spaceENS5_13char_encoding8standardEEEEENS4_INS6_6actionINS6_14any_int_parserIiLj10ELj1ELin1EEEZ2m1RiRSt14basic_ifstreamIcSt11char_traitsIcEEEUliE0_EENS4_ISE_NS4_INSF_INS6_15any_real_parserIdNS6_13real_policiesIdEEEEZ2m1SI_SN_EUliE1_EENS0_4nil_EEEEEEEEEEENS3_IKSW_EENS6_6detail13fail_functionIN9__gnu_cxx17__normal_iteratorIPcSsEEKNS5_11unused_typeES1B_EEEEbRKT_RKT0_RT1_N4mpl_5bool_ILb0EEE.isra.568
              500000

              _ZN5boost6fusion6detail10linear_anyINS0_13cons_iteratorIKNS0_4consINS_6spirit2qi10char_classINS5_3tag9char_codeINS8_5spaceENS5_13char_encoding8standardEEEEENS4_INS6_6actionINS6_14any_int_parserIiLj10ELj1ELin1EEEZ2m2RiRSt14basic_ifstreamIcSt11char_traitsIcEEEUliE0_EENS4_ISE_NS4_INSF_INS6_15any_real_parserIdNS6_13real_policiesIdEEEEZ2m2SI_SN_EUldE1_EENS0_4nil_EEEEEEEEEEENS3_IKSW_EENS6_6detail13fail_functionIN9__gnu_cxx17__normal_iteratorIPcSsEEKNS5_11unused_typeES1B_EEEEbRKT_RKT0_RT1_N4mpl_5bool_ILb0EEE.isra.579
              500000

              _ZN5boost6fusion6detail10linear_anyINS0_13cons_iteratorIKNS0_4consINS_6spirit2qi10char_classINS5_3tag9char_codeINS8_5spaceENS5_13char_encoding8standardEEEEENS4_INS6_6actionINS6_15any_real_parserIdNS6_13real_policiesIdEEEEZ2m1RiRSt14basic_ifstreamIcSt11char_traitsIcEEEUliE1_EENS0_4nil_EEEEEEENS3_IKSS_EENS6_6detail13fail_functionIN9__gnu_cxx17__normal_iteratorIPcSsEEKNS5_11unused_typeES15_EEEEbRKT_RKT0_RT1_N4mpl_5bool_ILb0EEE.isra.566
              500000

              _ZN5boost6fusion6detail10linear_anyINS0_13cons_iteratorIKNS0_4consINS_6spirit2qi10char_classINS5_3tag9char_codeINS8_5spaceENS5_13char_encoding8standardEEEEENS4_INS6_6actionINS6_15any_real_parserIdNS6_13real_policiesIdEEEEZ2m2RiRSt14basic_ifstreamIcSt11char_traitsIcEEEUldE1_EENS0_4nil_EEEEEEENS3_IKSS_EENS6_6detail13fail_functionIN9__gnu_cxx17__normal_iteratorIPcSsEEKNS5_11unused_typeES15_EEEEbRKT_RKT0_RT1_N4mpl_5bool_ILb0EEE.isra.577
              500000

              _ZN5boost6fusion6detail10linear_anyINS0_13cons_iteratorIKNS0_4consINS_6spirit2qi6actionINS6_14any_int_parserIiLj10ELj1ELin1EEEZ2m1RiRSt14basic_ifstreamIcSt11char_traitsIcEEEUliE0_EENS4_INS6_10char_classINS5_3tag9char_codeINSJ_5spaceENS5_13char_encoding8standardEEEEENS4_INS7_INS6_15any_real_parserIdNS6_13real_policiesIdEEEEZ2m1SA_SF_EUliE1_EENS0_4nil_EEEEEEEEENS3_IKSW_EENS6_6detail13fail_functionIN9__gnu_cxx17__normal_iteratorIPcSsEEKNS5_11unused_typeES1A_EEEEbRKT_RKT0_RT1_N4mpl_5bool_ILb0EEE.isra.567
              500000

              _ZN5boost6fusion6detail10linear_anyINS0_13cons_iteratorIKNS0_4consINS_6spirit2qi6actionINS6_14any_int_parserIiLj10ELj1ELin1EEEZ2m1RiRSt14basic_ifstreamIcSt11char_traitsIcEEEUliE_EENS4_INS6_10char_classINS5_3tag9char_codeINSJ_5spaceENS5_13char_encoding8standardEEEEENS4_INS7_IS9_Z2m1SA_SF_EUliE0_EENS4_ISP_NS4_INS7_INS6_15any_real_parserIdNS6_13real_policiesIdEEEEZ2m1SA_SF_EUliE1_EENS0_4nil_EEEEEEEEEEEEENS3_IKSY_EENS6_6detail13fail_functionIN9__gnu_cxx17__normal_iteratorIPcSsEEKNS5_11unused_typeES1E_EEEEbRKT_RKT0_RT1_N4mpl_5bool_ILb0EEE.isra.569
              500000

              _ZN5boost6fusion6detail10linear_anyINS0_13cons_iteratorIKNS0_4consINS_6spirit2qi6actionINS6_14any_int_parserIiLj10ELj1ELin1EEEZ2m2RiRSt14basic_ifstreamIcSt11char_traitsIcEEEUliE0_EENS4_INS6_10char_classINS5_3tag9char_codeINSJ_5spaceENS5_13char_encoding8standardEEEEENS4_INS7_INS6_15any_real_parserIdNS6_13real_policiesIdEEEEZ2m2SA_SF_EUldE1_EENS0_4nil_EEEEEEEEENS3_IKSW_EENS6_6detail13fail_functionIN9__gnu_cxx17__normal_iteratorIPcSsEEKNS5_11unused_typeES1A_EEEEbRKT_RKT0_RT1_N4mpl_5bool_ILb0EEE.isra.578
              500000

              _ZN5boost6fusion6detail10linear_anyINS0_13cons_iteratorIKNS0_4consINS_6spirit2qi6actionINS6_14any_int_parserIiLj10ELj1ELin1EEEZ2m2RiRSt14basic_ifstreamIcSt11char_traitsIcEEEUliE_EENS4_INS6_10char_classINS5_3tag9char_codeINSJ_5spaceENS5_13char_encoding8standardEEEEENS4_INS7_IS9_Z2m2SA_SF_EUliE0_EENS4_ISP_NS4_INS7_INS6_15any_real_parserIdNS6_13real_policiesIdEEEEZ2m2SA_SF_EUldE1_EENS0_4nil_EEEEEEEEEEEEENS3_IKSY_EENS6_6detail13fail_functionIN9__gnu_cxx17__normal_iteratorIPcSsEEKNS5_11unused_typeES1E_EEEEbRKT_RKT0_RT1_N4mpl_5bool_ILb0EEE.isra.580
              500000

              _ZN5boost6fusion6detail10linear_anyINS0_13cons_iteratorIKNS0_4consINS_6spirit2qi6actionINS6_14any_int_parserIiLj10ELj1ELin1EEEZ4mainEUliE_EENS4_IS9_NS0_4nil_EEEEEEENS3_IKSC_EENS6_6detail13fail_functionIN9__gnu_cxx17__normal_iteratorIPcSsEEKNS5_11unused_typeESP_EEEEbRKT_RKT0_RT1_N4mpl_5bool_ILb0EEE.isra.532
              2

Generated by: LCOV version 1.13


text:
/*global GIGO, MirrorConfig, jQuery,  window,  alert,  Browser */
/*jslint browser: true */
/*jslint regexp: true */

GIGO.update_ipaddress = function (ipinfo) {
    // ipinfo:  callback({"ip":"69.62.233.151","type":"ipv4","subtype":"","public":1,"filler":""});

    if (ipinfo.type === "ipv4") {
        if (!GIGO.results.ipv4.asn) {
            GIGO.results.ipv4 = ipinfo;
        }
    }
    if (ipinfo.type === "ipv6") {
        if (!GIGO.results.ipv6.asn) {
            GIGO.results.ipv6 = ipinfo;
        }
    }
};

GIGO.test_type_delayed = function (url, id) {

    // We will use this to stagger the start time_ms.
    // Since javascript has no "sleep" the next best
    // thing appears to be to set a timeout, and on timeout,
    // do what we really wanted.
    // We increase the timeout value each time we run this, so
    // that each thread time_ms out at a later time, to prevent
    // all tests from running INSTANTLY.
    // This is principally to work around IE problems
    // with too many jsonP queries initiating at once.
    GIGO.slowcount = GIGO.slowcount + 1;
    setTimeout(function () {
        GIGO.test_type(url, id);
    }, GIGO.slowcount * GIGO.slowcount_delay);
};

GIGO.finish_test = function (id) {
    var total_tests = GIGO.queue.length + GIGO.dequeued.length; // Once for main text, once for fallback image test
    GIGO.tests_finished = GIGO.tests_finished + 1;
    GIGO.update_progress(GIGO);
    GIGO.update_status(id);
    if (GIGO.tests_finished >= total_tests) {
        GIGO.check_results();
    }
    GIGO.next_in_queue(); // Start next test, if available
    GIGO.show_debug();
};

GIGO.test_type_json = function (url, id) {
    // name = dns name to fetch
    // id = which
 to update
    var tests, this_test;

    // Let us also add in some hints for mirror operators
    if (url.search(/\?/) < 0) {
      url = url + "?";
    }
    url = url + "&testdomain=" + GIGO.options.domain;
    url = url + "&testname=" + id;
    if (Browser.opera) {
            url = url + "&random=" + Math.random();
    }

    tests = GIGO.results.tests; // Convenience
    if (!(tests.hasOwnProperty(id))) {
        tests[id] = {};
    }
    this_test = tests[id];

    this_test.start_time = GIGO.getms(); // Will use to find how long we ran
    this_test.url = url; // For later display of test urls
    // Update status to "Started" if we don't have any time for this yet

    if (GIGO.overrides && GIGO.overrides[id]) {
        // oh, we're faking this one.  TODO
        // we can take a lot of short cuts.
        GIGO.override_id(id, url);
        GIGO.finish_test(id);
        GIGO.update_url(id);
        GIGO.show_debug();
        return;
    }

    GIGO.update_url(id);

    // Initiate new query.  Based on pass/fail, update status.
    jQuery.jsonp({
        "url": url,
        "cache": true,
        "pageCache": false,
        "timeout": GIGO.max_time,

        "success": function (ipinfo) {
            // Keep track of IP information we receive
            var delta;

            delete ipinfo.full; // Don't need this polluting anything.
            this_test.ipinfo = ipinfo; // Record the IP address reported from this test
            if (GIGO.override) {
                GIGO.override_id_ip(id);
            }
            GIGO.update_ipaddress(this_test.ipinfo); // Make note of our IPv4 or IPv6 address based on the test
            GIGO.update_ip(id); // callback for presentation
            delta = GIGO.getms() - this_test.start_time;
            if (GIGO.isdef(this_test.time_ms)) {
                if (delta < this_test.time_ms) {
                    this_test.time_ms = delta;
                }
            } else {
                this_test.time_ms = delta;
            }
            this_test.status = (this_test.time_ms < GIGO.slow) ? "ok" : "slow";

            // Look for dual stack
            if (id === "test_ds") {
                // ds4 and ds6 have the same time; but if one is good, the other must be bad,
                // since we can't possibly connect to both with a single DNS name
                if (ipinfo.type === "ipv6") {
                    tests.test_ds6 = {
                        url: this_test.url,
                        time_ms: this_test.time_ms,
                        status: this_test.status
                    };
                    tests.test_ds4 = {
                        url: this_test.url,
                        time_ms: this_test.time_ms,
                        status: "bad"
                    };
                } else {
                    tests.test_ds4 = {
                        url: this_test.url,
                        time_ms: this_test.time_ms,
                        status: this_test.status
                    };
                    tests.test_ds6 = {
                        url: this_test.url,
                        time_ms: this_test.time_ms,
                        status: "bad"
                    };
                }
            }

            GIGO.finish_test(id);

        },
        "error": function (d, msg) {
            var delta;

            delta = GIGO.getms() - this_test.start_time;
            if (GIGO.isdef(this_test.time_ms)) {
                if (delta < this_test.time_ms) {
                    this_test.time_ms = delta;
                }
            } else {
                this_test.time_ms = delta;
            }
            this_test.status = (this_test.time_ms < GIGO.slow) ? "bad" : "timeout";

            // Look for dual stack
            if (id === "test_ds") {
                tests.test_ds6 = {
                    url: this_test.url,
                    time_ms: this_test.time_ms,
                    status: this_test.status
                };
                tests.test_ds4 = {
                    url: this_test.url,
                    time_ms: this_test.time_ms,
                    status: this_test.status
                };

                // Dual stack connection failed. Is it due to buggy DNS?
                // Queue the buggydns1 check!
                GIGO.queue.push(["test_buggydns1", GIGO.options.url.test_buggydns1_img, "test_buggydns1"]);
            }

            // Fallback to image test, if the primary tests fail.  Just in case some filter blocked the script fetches.
            GIGO.finish_test(id);
            GIGO.queue.push(["test_type_img", GIGO.options.url[id + "_img"], id + "_img"]);
        }
    });

    // Perform callback for presentation
    GIGO.update_url(id);
    GIGO.show_debug();

};

GIGO.test_type_json_only = function (url, id) {
    // name = dns name to fetch
    // id = which
 to update
    var tests, this_test;

    if (url.search(/\?/) < 0) {
      url = url + "?";
    }
    url = url + "&testdomain=" + GIGO.options.domain;
    url = url + "&testname=" + id;
    if (Browser.opera) {
            url = url + "&random=" + Math.random();
    }

    tests = GIGO.results.tests; // Convenience
    if (!(tests.hasOwnProperty(id))) {
        tests[id] = {};
    }
    this_test = tests[id];

    this_test.start_time = GIGO.getms(); // Will use to find how long we ran
    this_test.url = url; // For later display of test urls
    // Update status to "Started" if we don't have any time for this yet
    GIGO.update_url(id);

    if ((id === "test_asn4") && (GIGO.isdef(GIGO.CGI.ip4))) {
        if ((GIGO.CGI.ip4) && (GIGO.CGI.ip4.match(/^[0-9abcdef.:]+$/))) {
            url = "/ip/?callback=?&asn=1&testip=" + GIGO.CGI.ip4;
            url = url + "&testdomain=" + GIGO.options.domain;
            url = url + "&testname=" + id;
            this_test.url = url; // For later display of test urls
            GIGO.update_url(id);
        } else {
            this_test.ipinfo = {};
            this_test.status = "bad";
            this_test.time_ms = 1;
            GIGO.finish_test(id);
            GIGO.update_url(id);
            GIGO.show_debug();
            return;
        }
    }
    if ((id === "test_asn6") && (GIGO.isdef(GIGO.CGI.ip6))) {
        if ((GIGO.CGI.ip6) && (GIGO.CGI.ip6.match(/^[0-9abcdef.:]+$/))) {
            url = "/ip/?callback=?&asn=1&testip=" + GIGO.CGI.ip6;
            url = url + "&testdomain=" + GIGO.options.domain;
            url = url + "&testname=" + id;
            this_test.url = url; // For later display of test urls
            GIGO.update_url(id);
        } else {
            this_test.ipinfo = {};
            this_test.status = "bad";
            this_test.time_ms = 1;
            GIGO.finish_test(id);
            GIGO.update_url(id);
            GIGO.show_debug();
            return;
        }
    }

    // Initiate new query.  Based on pass/fail, update status.
    jQuery.jsonp({
        "url": url,
        "cache": true,
        "pageCache": false,
        "timeout": GIGO.max_time,

        "success": function (ipinfo) {
            // Keep track of IP information we receive
            var delta;

            delete ipinfo.full; // Don't need this polluting anything.
            this_test.ipinfo = ipinfo; // Record the IP address reported from this test
            GIGO.update_ipaddress(this_test.ipinfo); // Make note of our IPv4 or IPv6 address based on the test
            GIGO.update_ip(id); // callback for presentation
            delta = GIGO.getms() - this_test.start_time;
            if (GIGO.isdef(this_test.time_ms)) {
                if (delta < this_test.time_ms) {
                    this_test.time_ms = delta;
                }
            } else {
                this_test.time_ms = delta;
            }
            this_test.status = (this_test.time_ms < GIGO.slow) ? "ok" : "slow";

            GIGO.finish_test(id);

        },
        "error": function (d, msg) {
            var delta;

            delta = GIGO.getms() - this_test.start_time;
            if (GIGO.isdef(this_test.time_ms)) {
                if (delta < this_test.time_ms) {
                    this_test.time_ms = delta;
                }
            } else {
                this_test.time_ms = delta;
            }
            this_test.status = (this_test.time_ms < GIGO.slow) ? "bad" : "timeout";

            GIGO.finish_test(id);
        }
    });

    // Perform callback for presentation
    GIGO.update_url(id);
    GIGO.show_debug();
};

GIGO.test_buggydns1 = function (url, id) {
    // name = dns name to fetch
    // id = which
 to update
    var tests, this_test, img, img_pending, max_time;
    jQuery(".optional_buggydns1").show();

    max_time = (GIGO.max_time > 5000) ? 5000 : GIGO.max_time; // Shorten this test.
    if (url.search(/\?/) < 0) {
          url = url + "?";
    }
    url = url + "&testdomain=" + GIGO.options.domain;
    url = url + "&testname=" + id;
    if (Browser.opera) {
            url = url + "&random=" + Math.random();
    }

    tests = GIGO.results.tests; // Convenience
    if (!(tests.hasOwnProperty(id))) {
        tests[id] = {};
    }
    this_test = tests[id];

    this_test.start_time = GIGO.getms(); // Will use to find how long we ran
    this_test.url = url; // For later display of test urls
    // Update status to "Started" if we don't have any time for this yet
    GIGO.update_url(id);

    // Create image.
    // Attach handlers to the image.
    // Create a timer to artificially timeout imgs
    img_pending = 1;

    img = jQuery('');

    // INVERSE LOGIC HERE !!!
    jQuery(img).bind({
        load: function () {
            var delta;
            if (img_pending) {
                img_pending = 0;
                delta = GIGO.getms() - this_test.start_time;
                if (GIGO.isdef(this_test.time_ms)) {
                    if (delta < this_test.time_ms) {
                        this_test.time_ms = delta;
                    }
                } else {
                    this_test.time_ms = delta;
                }
                this_test.image = 1;
                this_test.status = "affected"; // INVERSE LOGIC!
                GIGO.finish_test(id);
            }
        },
        error: function () {
            var delta;
            if (img_pending) {
                img_pending = 0;
                delta = GIGO.getms() - this_test.start_time;
                if (GIGO.isdef(this_test.time_ms)) {
                    if (delta < this_test.time_ms) {
                        this_test.time_ms = delta;
                    }
                } else {
                    this_test.time_ms = delta;
                }
                this_test.image = 1;
                this_test.status = "safe"; // INVERSE LOGIC!
                GIGO.finish_test(id);
            }
        }
    });

    // FAKE IMAGE TIMEOUT HANDLER
    setTimeout(function () {
        var delta;
        if (img_pending) {
            img_pending = 0;
            // replace failing image url with one that should work, so that browser can call this done.
            // we tried setting to "" but safari at minimum treats that as replacing src
            // with the value of document.location (!).
            jQuery(img).attr("src", "/images/knob_red.png");

            delta = GIGO.getms() - this_test.start_time;
            if (GIGO.isdef(this_test.time_ms)) {
                if (delta < this_test.time_ms) {
                    this_test.time_ms = delta;
                }
            } else {
                this_test.time_ms = delta;
            }
            this_test.image = 1;
            this_test.status = "safe"; // INVERSE LOGIC!
            GIGO.finish_test(id);
        }
    }, max_time);

    //jQuery('body').append(img);
    jQuery(img).attr("src", url);

    // Perform callback for presentation
    GIGO.update_url(id);
    GIGO.show_debug();
};

GIGO.test_type_img = function (url, id) {
    // name = dns name to fetch
    // id = which
 to update
    var tests, this_test, img, img_pending;

    if (url.search(/\?/) < 0) {
          url = url + "?";
    }
    url = url + "&testdomain=" + GIGO.options.domain;
    url = url + "&testname=" + id;
    if (Browser.opera) {
            url = url + "&random=" + Math.random();
    }

    tests = GIGO.results.tests; // Convenience
    if (!(tests.hasOwnProperty(id))) {
        tests[id] = {};
    }
    this_test = tests[id];

    this_test.start_time = GIGO.getms(); // Will use to find how long we ran
    this_test.url = url; // For later display of test urls
    // Update status to "Started" if we don't have any time for this yet
    GIGO.update_url(id);

    // Create image.
    // Attach handlers to the image.
    // Create a timer to artificially timeout imgs
    img_pending = 1;

    img = jQuery('');

    jQuery(img).bind({
        load: function () {
            var delta;

            if (img_pending) {
                img_pending = 0;
                delta = GIGO.getms() - this_test.start_time;
                if (GIGO.isdef(this_test.time_ms)) {
                    if (delta < this_test.time_ms) {
                        this_test.time_ms = delta;
                    }
                } else {
                    this_test.time_ms = delta;
                }
                this_test.image = 1;
                this_test.status = (this_test.time_ms < GIGO.slow) ? "ok" : "slow";
                if (this_test.test_ms > GIGO.max_time) {
                    this_test.status = "timeout";
                }
                GIGO.finish_test(id);
            }
        },
        error: function () {
            var delta;
            if (img_pending) {
                img_pending = 0;
                delta = GIGO.getms() - this_test.start_time;
                if (GIGO.isdef(this_test.time_ms)) {
                    if (delta < this_test.time_ms) {
                        this_test.time_ms = delta;
                    }
                } else {
                    this_test.time_ms = delta;
                }
                this_test.image = 1;
                this_test.status = (this_test.time_ms < GIGO.slow) ? "bad" : "timeout";
                GIGO.finish_test(id);
            }
        }
    });

    // FAKE IMAGE TIMEOUT HANDLER
    setTimeout(function () {
        var delta;
        if (img_pending) {
            img_pending = 0;
            // replace failing image url with one that should work, so that browser can call this done.
            // we tried setting to "" but safari at minimum treats that as replacing src
            // with the value of document.location (!).
            jQuery(img).attr("src", "/images/knob_red.png");

            delta = GIGO.getms() - this_test.start_time;
            if (GIGO.isdef(this_test.time_ms)) {
                if (delta < this_test.time_ms) {
                    this_test.time_ms = delta;
                }
            } else {
                this_test.time_ms = delta;
            }
            this_test.image = 1;
            this_test.status = (this_test.time_ms < GIGO.slow) ? "bad" : "timeout";
            GIGO.finish_test(id);
        }
    }, GIGO.max_time);

    //jQuery('body').append(img);
    jQuery(img).attr("src", url);

    // Perform callback for presentation
    GIGO.update_url(id);
    GIGO.show_debug();
};

GIGO.retest = function () {
    window.location.reload();
};

GIGO.next_in_queue = function () {
    var fname, a;
    if (GIGO.queue.length > 0) {
        a = GIGO.queue.shift(); // Dequeue the next test.
        GIGO.dequeued.push(a.slice(0)); // Save a COPY.
        try {
            fname = a.shift(); // Remove first field, the function name (in the GIGO namespace).  This changes array "a".
        } catch (e) {
            alert("ERROR: GIGO.next_in_queue: not an array; value=" + a);
        }

        // fname = function name
        // a = args array to pass.
        GIGO[fname].apply(GIGO, a);

        // If we are permitted parallel execution,
        // set a timer to start the next job.
        if (!GIGO.use_queue) {
            setTimeout(GIGO.next_in_queue, GIGO.slowcount_delay);
        }
    }
    GIGO.update_progress(GIGO);
};

GIGO.start_tests = function () {
    GIGO.browser_tweaks(GIGO); // In case we want to do tweak the document
    GIGO.next_in_queue(); // Get the ball rolling!
};
GIGO.restart_tests = function () {
    var i, l;
    l = GIGO.dequeued.length;
    for (i = 0; i < l; i = i + 1) {
        GIGO.queue.push(GIGO.dequeued[i]);
    }
    GIGO.update_progress(GIGO);
    GIGO.start_tests();
};

GIGO.setup_tests = function () {

    asn_lookup_broken = 0
    if (asn_lookup_broken) {
      jQuery('#sum_test_asn4').parent().parent().hide();
      jQuery('#sum_test_asn6').parent().parent().hide();
      jQuery('#test_asn4').parent().parent().hide();
      jQuery('#test_asn6').parent().parent().hide();
    } else {
      GIGO.queue.push(["test_type_json_only", GIGO.options.url.test_asn4, "test_asn4"]);
      GIGO.queue.push(["test_type_json_only", GIGO.options.url.test_asn6, "test_asn6"]);
    }

    GIGO.queue.push(["test_type_json", GIGO.options.url.test_a, "test_a"]);
    GIGO.queue.push(["test_type_json", GIGO.options.url.test_aaaa, "test_aaaa"]);
    GIGO.queue.push(["test_type_json", GIGO.options.url.test_ds, "test_ds"]);
    GIGO.queue.push(["test_type_json", GIGO.options.url.test_ipv4, "test_ipv4"]);
    GIGO.queue.push(["test_type_json", GIGO.options.url.test_ipv6, "test_ipv6"]);
    GIGO.queue.push(["test_type_json", GIGO.options.url.test_v6mtu, "test_v6mtu"]);
    GIGO.queue.push(["test_type_json", GIGO.options.url.test_v6ns, "test_v6ns"]);
    GIGO.queue.push(["test_type_json", GIGO.options.url.test_dsmtu, "test_dsmtu"]);
    GIGO.show_debug();
    GIGO.prepare_fake();

};

GIGO.fill = function (size, str) {
    var s = "";
    while (s.length < size) {
        s = s + str;
    }
    s = s.substring(0, size);
    return s;
};

GIGO.set_default_options = function (options) {

    options.url = (options.hasOwnProperty("url")) ? options.url : {};

    options.domain = GIGO.mirrorconfig("site", "name", null);
    options.subdomain = GIGO.mirrorconfig("load", "domain", options.domain);
    options.ipv4 = GIGO.mirrorconfig("load", "ipv4", null);
    options.ipv6 = GIGO.mirrorconfig("load", "ipv6", null);
    options.uri = GIGO.mirrorconfig("options", "ip", "/ip/") + "?callback=?";
    options.img_uri = "/images-nc/bg.gif";
    options.img_uri_big = "/images-nc/knob_valid_green.png?&fill=" + GIGO.fill(1600, "x");
    options.img_bad_uri = "/images-nc/knob_cancel.png";

    // Determine if we can use an alternate v6mtu defined by the site config (options -> v6mtu)
    options.v6mtu = GIGO.mirrorconfig("options","v6mtu","ipv6." + options.subdomain);

    // options.uri = "/report-ip.php?callback=?";  // Alternative to mod_ip
    options.url.test_a = "http://ipv4." + options.subdomain + options.uri;
    options.url.test_aaaa = "http://ipv6." + options.subdomain + options.uri;
    options.url.test_ds = "http://ds." + options.subdomain + options.uri;
    options.url.test_ipv4 = "http://" + options.ipv4 + options.uri;
    options.url.test_ipv6 = "http://[" + options.ipv6 + "]:80" + options.uri;
    options.url.test_v6ns = "http://ds.v6ns." + options.subdomain + options.uri;
    options.url.test_v6mtu = "http://" + options.v6mtu + options.uri + "&size=1600&fill=" + GIGO.fill(1600, "x");
    options.url.test_dsmtu = "http://ds." + options.subdomain + options.uri + "&size=1600&fill=" + GIGO.fill(1600, "x");
    options.url.test_buggydns1 = "http://buggydns1." + options.subdomain + options.uri;

    // ASN lookups are corrently broken.
    options.url.test_asn4 = "http://ipv4." + options.subdomain + options.uri + "&asn=1";
    options.url.test_asn6 = "http://ipv6." + options.subdomain + options.uri + "&asn=1";

    options.url.test_a_img = "http://ipv4." + options.subdomain + options.img_uri;
    options.url.test_aaaa_img = "http://ipv6." + options.subdomain + options.img_uri;
    options.url.test_ds_img = "http://ds." + options.subdomain + options.img_uri;
    options.url.test_ipv4_img = "http://" + options.ipv4 + options.img_uri;
    options.url.test_ipv6_img = "http://[" + options.ipv6 + "]:80" + options.img_uri;
    options.url.test_v6ns_img = "http://ds.v6ns." + options.subdomain + options.img_uri;
    options.url.test_v6mtu_img = "http://" + options.v6mtu + options.img_uri_big;
    options.url.test_dsmtu_img = "http://ds." + options.subdomain + options.img_uri_big;
    options.url.test_buggydns1_img = "http://buggydns1." + options.subdomain + options.img_uri;

};

GIGO.fix_comment_form_and_tab = function () {
    if (MirrorConfig.options.comment) {
        jQuery("#tabbutton_mail_link").show();

        var url = MirrorConfig.options.comment;
        if (MirrorConfig.options.userdata) {
            if (GIGO.results.ipv4.ip) {
                url = "http://ipv4." + MirrorConfig.options.userdata + "/comment.php";
            } else if (GIGO.results.ipv6.ip) {
                url = "http://ipv6." + MirrorConfig.options.userdata + "/comment.php";
            } else {
                url = "http://ds." + MirrorConfig.options.userdata + "/comment.php";
            }
        }

        $('#commentform').get(0).setAttribute('action', url);

    } else {
        jQuery("#tabbutton_mail_link").hide();
        jQuery("a.tabbutton_mail").hide();
    }

};

GIGO.test_ipv6_gui = function (options) {
    // Check options
    if (!GIGO.isdef(options)) {
        options = {};
    }
    GIGO.options = options;
    GIGO.set_default_options(options);

    // Start real workload
    jQuery(document).ready(function () {
        // Primitive hack to avoid the web bots from comment spamming
        jQuery("[name=nobots]").val("serious");
        if (GIGO.is_replay()) {
          jQuery("#replay").show();
        }

        // Possibly, kill that tab instead.
        // GIGO.fix_comment_form_and_tab();
        GIGO.start_helpdesk();
        GIGO.setup_tests();
        GIGO.start_tests();
        GIGO.pulse_on();
    });
};

GIGO.redirect = function (page) {
    var newurl, oldpath, newpath;
    newurl = document.location.protocol;
    newurl = newurl + "://";
    newurl = newurl + document.location.hostname;
    if (document.location.port !== 80) {
        newurl = newurl + ":" + document.location.port;
    }

    oldpath = String(document.location.pathname);
    newpath = oldpath.replace(/[^\/]+$/, "");
    newpath = newpath + page;
    newpath = newpath.replace(/\/+/g, "/");

    document.location = newpath;

};


text:
Jonathan Smith

Works at Mosaicpro

            {% if icons !== false %}

            {% endif %}


text:
import argparse
import base64
import json
import os

import kubernetes_asyncio.client
import kubernetes_asyncio.config

from gear import Database, transaction
from hailtop.utils import async_to_blocking

NAMESPACE = os.environ['NAMESPACE']

async def copy_identity_from_default(hail_credentials_secret_name: str) -> str:
    cloud = os.environ['CLOUD']
    await kubernetes_asyncio.config.load_kube_config()
    k8s_client = kubernetes_asyncio.client.CoreV1Api()

    secret = await k8s_client.read_namespaced_secret(hail_credentials_secret_name, 'default')

    await k8s_client.create_namespaced_secret(
        NAMESPACE,
        kubernetes_asyncio.client.V1Secret(
            metadata=kubernetes_asyncio.client.V1ObjectMeta(name=hail_credentials_secret_name),
            data=secret.data,
        ),
    )

    credentials_json = base64.b64decode(secret.data['key.json']).decode()
    credentials = json.loads(credentials_json)

    if cloud == 'gcp':
        return credentials['client_email']
    assert cloud == 'azure'
    return credentials['appObjectId']

async def insert_user_if_not_exists(db, username, login_id, is_developer, is_service_account):
    @transaction(db)
    async def insert(tx):
        row = await db.execute_and_fetchone('SELECT id, state FROM users where username = %s;', (username,))
        if row:
            if row['state'] == 'active':
                return None
            return row['id']

        if NAMESPACE == 'default':
            hail_credentials_secret_name = None
            hail_identity = None
            namespace_name = None
        else:
            hail_credentials_secret_name = f'{username}-gsa-key'
            hail_identity = await copy_identity_from_default(hail_credentials_secret_name)
            namespace_name = NAMESPACE

        return await db.execute_insertone(
            '''
    INSERT INTO users (state, username, login_id, is_developer, is_service_account, hail_identity, hail_credentials_secret_name, namespace_name)
    VALUES (%s, %s, %s, %s, %s, %s, %s, %s);
    ''',
            (
                'creating',
                username,
                login_id,
                is_developer,
                is_service_account,
                hail_identity,
                hail_credentials_secret_name,
                namespace_name,
            ),
        )

    return await insert()

async def main():
    parser = argparse.ArgumentParser(description='Create an initial dev user.')

    parser.add_argument('username', help='The username of the initial user.')
    parser.add_argument('login_id', metavar='login-id', help='The login id of the initial user.')

    args = parser.parse_args()

    db = Database()
    await db.async_init(maxsize=50)

    await insert_user_if_not_exists(db, args.username, args.login_id, True, False)

async_to_blocking(main())


text:
var gulp = require('gulp');
var browserify = require('browserify');
var vueify = require('vueify');
var source = require('vinyl-source-stream');
// var livereload = require('gulp-livereload');

gulp.task('build-js',function () {
	return browserify({
		entries: './vueku.js',
		debug: true
	})
	.transform(vueify)
	.bundle()
	.pipe(source('build.js'))
	.pipe(gulp.dest('./'));
	// .pipe(livereload());
});

gulp.task('dev', function () {
	// livereload.listen();
	gulp.watch(['./*.vue','./vueku.js','./*.html'],['build-js']);
});

gulp.task('default', ['dev']);


text:
package com.psidox.garage.model;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property="id")
public class CarMake {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;
    private String name;

    @JsonIgnore
    @OneToMany(mappedBy = "carMake")
    private List<CarModel> carModels = new ArrayList<CarModel>();

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<CarModel> getCarModels() {
        return carModels;
    }

    public void setCarModels(List<CarModel> carModels) {
        this.carModels = carModels;
    }

}