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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>knife raw — chef-client Man Pages</title>

    <link rel="stylesheet" href="_static/guide.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="_static/chef.ico"/>

knife raw¶

The knife raw subcommand is used to send a REST request to a specified path using the Chef Server API.

Syntax¶

This argument has the following syntax:

$ knife raw REQUEST_PATH (options)

Options¶

Note

Review the list of common options available to this (and all) Knife subcommands and plugins.

This subcommand has the following options:

<tt class="docutils literal">-i FILE</tt>, <tt class="docutils literal">--input FILE</tt>

The name of a file to be used with the <tt class="docutils literal">PUT</tt> or a <tt class="docutils literal">POST</tt> request.

<tt class="docutils literal">--[no-]pretty</tt>

Use <tt class="docutils literal">--no-pretty</tt> to disable pretty-print output for JSON. Default: <tt class="docutils literal">--pretty</tt>.

<tt class="docutils literal">-m METHOD</tt>, <tt class="docutils literal">--method METHOD</tt>

The request method: <tt class="docutils literal">DELETE</tt>, <tt class="docutils literal">GET</tt>, <tt class="docutils literal">POST</tt>, or <tt class="docutils literal">PUT</tt>. Default value: <tt class="docutils literal">GET</tt>.

Examples¶

The following examples show how to use this Knife subcommand:

View a client

To view information about a client:

knife raw /clients/<client_name>

View a node

To view information about a node:

knife raw /nodes/<node_name>

Delete a data bag

To delete a data bag, enter a command similar to:

$ knife raw -m DELETE /data/foo

to return something similar to:

{
  "name":"foo",
  "json_class":"Chef::DataBag",
  "chef_type":"data_bag"
}


text:
const Merge = require('webpack-merge');
const common = require('./webpack.common.js');
var path = require('path');
var buildPath = path.resolve(__dirname, 'dist');

module.exports = Merge(common, {
	devtool: 'eval',
	devServer: {
		contentBase: buildPath,
		hot: true
	}
});

redpajama_set_name: RedPajamaGithub


text:
package org.apache.hadoop.tools.mapred;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter;
import org.apache.hadoop.tools.*;
import org.apache.hadoop.tools.DistCpOptions.FileAttribute;
import org.apache.hadoop.tools.util.DistCpUtils;

import java.io.IOException;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;

/**
 * The CopyCommitter class is DistCp's OutputCommitter implementation. It is
 * responsible for handling the completion/cleanup of the DistCp run.
 * Specifically, it does the following:
 *  1. Cleanup of the meta-folder (where DistCp maintains its file-list, etc.)
 *  2. Preservation of user/group/replication-factor on any directories that
 *     have been copied. (Files are taken care of in their map-tasks.)
 *  3. Atomic-move of data from the temporary work-folder to the final path
 *     (if atomic-commit was opted for).
 *  4. Deletion of files from the target that are missing at source (if opted for).
 *  5. Cleanup of any partially copied files, from previous, failed attempts.
 */
public class CopyCommitter extends FileOutputCommitter {
  private static final Log LOG = LogFactory.getLog(CopyCommitter.class);

  private final TaskAttemptContext taskAttemptContext;

  /**
   * Create a output committer
   *
   * @param outputPath the job's output path
   * @param context    the task's context
   * @throws IOException - Exception if any
   */
  public CopyCommitter(Path outputPath, TaskAttemptContext context) throws IOException {
    super(outputPath, context);
    this.taskAttemptContext = context;
  }

  /** @inheritDoc */
  @Override
  public void commitJob(JobContext jobContext) throws IOException {
    Configuration conf = jobContext.getConfiguration();
    super.commitJob(jobContext);

    cleanupTempFiles(jobContext);

    String attributes = conf.get(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
    if (attributes != null && !attributes.isEmpty()) {
      preserveFileAttributesForDirectories(conf);
    }

    try {
      if (conf.getBoolean(DistCpConstants.CONF_LABEL_DELETE_MISSING, false)) {
        deleteMissing(conf);
      } else if (conf.getBoolean(DistCpConstants.CONF_LABEL_ATOMIC_COPY, false)) {
        commitData(conf);
      }
      taskAttemptContext.setStatus("Commit Successful");
    }
    finally {
      cleanup(conf);
    }
  }

  /** @inheritDoc */
  @Override
  public void abortJob(JobContext jobContext,
                       JobStatus.State state) throws IOException {
    try {
      super.abortJob(jobContext, state);
    } finally {
      cleanupTempFiles(jobContext);
      cleanup(jobContext.getConfiguration());
    }
  }

  private void cleanupTempFiles(JobContext context) {
    try {
      Configuration conf = context.getConfiguration();

      Path targetWorkPath = new Path(conf.get(DistCpConstants.CONF_LABEL_TARGET_WORK_PATH));
      FileSystem targetFS = targetWorkPath.getFileSystem(conf);

      String jobId = context.getJobID().toString();
      deleteAttemptTempFiles(targetWorkPath, targetFS, jobId);
      deleteAttemptTempFiles(targetWorkPath.getParent(), targetFS, jobId);
    } catch (Throwable t) {
      LOG.warn("Unable to cleanup temp files", t);
    }
  }

  private void deleteAttemptTempFiles(Path targetWorkPath,
                                      FileSystem targetFS,
                                      String jobId) throws IOException {

    FileStatus[] tempFiles = targetFS.globStatus(
        new Path(targetWorkPath, ".distcp.tmp." + jobId.replaceAll("job","attempt") + "*"));

    if (tempFiles != null && tempFiles.length > 0) {
      for (FileStatus file : tempFiles) {
        LOG.info("Cleaning up " + file.getPath());
        targetFS.delete(file.getPath(), false);
      }
    }
  }

  /**
   * Cleanup meta folder and other temporary files
   *
   * @param conf - Job Configuration
   */
  private void cleanup(Configuration conf) {
    Path metaFolder = new Path(conf.get(DistCpConstants.CONF_LABEL_META_FOLDER));
    try {
      FileSystem fs = metaFolder.getFileSystem(conf);
      LOG.info("Cleaning up temporary work folder: " + metaFolder);
      fs.delete(metaFolder, true);
    } catch (IOException ignore) {
      LOG.error("Exception encountered ", ignore);
    }
  }

  // This method changes the target-directories' file-attributes (owner,
  // user/group permissions, etc.) based on the corresponding source directories.
  private void preserveFileAttributesForDirectories(Configuration conf) throws IOException {
    String attrSymbols = conf.get(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
    LOG.info("About to preserve attributes: " + attrSymbols);

    EnumSet<FileAttribute> attributes = DistCpUtils.unpackAttributes(attrSymbols);

    Path sourceListing = new Path(conf.get(DistCpConstants.CONF_LABEL_LISTING_FILE_PATH));
    FileSystem clusterFS = sourceListing.getFileSystem(conf);
    SequenceFile.Reader sourceReader = new SequenceFile.Reader(conf,
                                      SequenceFile.Reader.file(sourceListing));
    long totalLen = clusterFS.getFileStatus(sourceListing).getLen();

    Path targetRoot = new Path(conf.get(DistCpConstants.CONF_LABEL_TARGET_WORK_PATH));

    long preservedEntries = 0;
    try {
      FileStatus srcFileStatus = new FileStatus();
      Text srcRelPath = new Text();

      // Iterate over every source path that was copied.
      while (sourceReader.next(srcRelPath, srcFileStatus)) {
        // File-attributes for files are set at the time of copy,
        // in the map-task.
        if (! srcFileStatus.isDirectory()) continue;

        Path targetFile = new Path(targetRoot.toString() + "/" + srcRelPath);

        // Skip the root folder.
        // Status can't be preserved on root-folder. (E.g. multiple paths may
        // be copied to a single target folder. Which source-attributes to use
        // on the target is undefined.)
        if (targetRoot.equals(targetFile)) continue;

        FileSystem targetFS = targetFile.getFileSystem(conf);
        DistCpUtils.preserve(targetFS, targetFile, srcFileStatus,  attributes);

        taskAttemptContext.progress();
        taskAttemptContext.setStatus("Preserving status on directory entries. [" +
            sourceReader.getPosition() * 100 / totalLen + "%]");
      }
    } finally {
      IOUtils.closeStream(sourceReader);
    }
    LOG.info("Preserved status on " + preservedEntries + " dir entries on target");
  }

  // This method deletes "extra" files from the target, if they're not
  // available at the source.
  private void deleteMissing(Configuration conf) throws IOException {
    LOG.info("-delete option is enabled. About to remove entries from " +
        "target that are missing in source");

    // Sort the source-file listing alphabetically.
    Path sourceListing = new Path(conf.get(DistCpConstants.CONF_LABEL_LISTING_FILE_PATH));
    FileSystem clusterFS = sourceListing.getFileSystem(conf);
    Path sortedSourceListing = DistCpUtils.sortListing(clusterFS, conf, sourceListing);

    // Similarly, create the listing of target-files. Sort alphabetically.
    Path targetListing = new Path(sourceListing.getParent(), "targetListing.seq");
    CopyListing target = new GlobbedCopyListing(new Configuration(conf), null);

    List<Path> targets = new ArrayList<Path>(1);
    Path targetFinalPath = new Path(conf.get(DistCpConstants.CONF_LABEL_TARGET_FINAL_PATH));
    targets.add(targetFinalPath);
    DistCpOptions options = new DistCpOptions(targets, new Path("/NONE"));

    target.buildListing(targetListing, options);
    Path sortedTargetListing = DistCpUtils.sortListing(clusterFS, conf, targetListing);
    long totalLen = clusterFS.getFileStatus(sortedTargetListing).getLen();

    SequenceFile.Reader sourceReader = new SequenceFile.Reader(conf,
                                 SequenceFile.Reader.file(sortedSourceListing));
    SequenceFile.Reader targetReader = new SequenceFile.Reader(conf,
                                 SequenceFile.Reader.file(sortedTargetListing));

    // Walk both source and target file listings.
    // Delete all from target that doesn't also exist on source.
    long deletedEntries = 0;
    try {
      FileStatus srcFileStatus = new FileStatus();
      Text srcRelPath = new Text();
      FileStatus trgtFileStatus = new FileStatus();
      Text trgtRelPath = new Text();

      FileSystem targetFS = targetFinalPath.getFileSystem(conf);
      boolean srcAvailable = sourceReader.next(srcRelPath, srcFileStatus);
      while (targetReader.next(trgtRelPath, trgtFileStatus)) {
        // Skip sources that don't exist on target.
        while (srcAvailable && trgtRelPath.compareTo(srcRelPath) > 0) {
          srcAvailable = sourceReader.next(srcRelPath, srcFileStatus);
        }

        if (srcAvailable && trgtRelPath.equals(srcRelPath)) continue;

        // Target doesn't exist at source. Delete.
        boolean result = (!targetFS.exists(trgtFileStatus.getPath()) ||
            targetFS.delete(trgtFileStatus.getPath(), true));
        if (result) {
          LOG.info("Deleted " + trgtFileStatus.getPath() + " - Missing at source");
          deletedEntries++;
        } else {
          throw new IOException("Unable to delete " + trgtFileStatus.getPath());
        }
        taskAttemptContext.progress();
        taskAttemptContext.setStatus("Deleting missing files from target. [" +
            targetReader.getPosition() * 100 / totalLen + "%]");
      }
    } finally {
      IOUtils.closeStream(sourceReader);
      IOUtils.closeStream(targetReader);
    }
    LOG.info("Deleted " + deletedEntries + " from target: " + targets.get(0));
  }

  private void commitData(Configuration conf) throws IOException {

    Path workDir = new Path(conf.get(DistCpConstants.CONF_LABEL_TARGET_WORK_PATH));
    Path finalDir = new Path(conf.get(DistCpConstants.CONF_LABEL_TARGET_FINAL_PATH));
    FileSystem targetFS = workDir.getFileSystem(conf);

    LOG.info("Atomic commit enabled. Moving " + workDir + " to " + finalDir);
    if (targetFS.exists(finalDir) && targetFS.exists(workDir)) {
      LOG.error("Pre-existing final-path found at: " + finalDir);
      throw new IOException("Target-path can't be committed to because it " +
          "exists at " + finalDir + ". Copied data is in temp-dir: " + workDir + ". ");
    }

    boolean result = targetFS.rename(workDir, finalDir);
    if (!result) {
      LOG.warn("Rename failed. Perhaps data already moved. Verifying...");
      result = targetFS.exists(finalDir) && !targetFS.exists(workDir);
    }
    if (result) {
      LOG.info("Data committed successfully to " + finalDir);
      taskAttemptContext.setStatus("Data committed successfully to " + finalDir);
    } else {
      LOG.error("Unable to commit data to " + finalDir);
      throw new IOException("Atomic commit failed. Temporary data in " + workDir +
        ", Unable to move to " + finalDir);
    }
  }
}


text:
(function (site, $) {
    'use strict';
    var wkndheader = $(site + " .wknd-header"),
        scroll,
        mobileBreakpoint = 992;

    if($(window).scrollTop() > 0 && $(window).width() > mobileBreakpoint) {
        wkndheader.addClass("navbar-sticky");
    }

    $(window).scroll(function(){

         scroll = $(window).scrollTop();
    if(scroll > 0 && $(window).width() > mobileBreakpoint) {
        wkndheader.addClass("navbar-sticky");
    } else {
        wkndheader.removeClass("navbar-sticky");
    }
});
}('.root',jQuery));


text:
import React from 'react'
import DataList from '../components/DataList'
import { insertSession, updateSession, removeSession } from '../../api/data/methods'

class SessionList extends React.Component {
  state = {
    key: (new Date()).getTime(),
  }

  refresh = () => {
    this.setState({ key: (new Date()).getTime() })
  }

  render() {
    return (
      <DataList
        key={this.state.key}
        dataType='上课时间'
        items={this.props.items}
        refresh={this.refresh}
        insertItem={insertSession}
        updateItem={updateSession}
        removeItem={removeSession}
      />
    )
  }
}

SessionList.propTypes = {
  items: React.PropTypes.array,
}

export default SessionList


text:
class Event < ActiveRecord::Base

  def self.attributes_from(model, key, old_val, new_val)
    return if old_val.blank? && new_val.blank? # not something we need to track.
    eventable_options = model.class.eventable_options
    return if Array(eventable_options[:exclude]).include?(key.to_sym)

    events       = eventable_options[:events]
    attr_options = events[key.to_sym] if events
    reference    = key.ends_with?("_id") ? key[0..-4].to_sym : key.to_sym
    association  = model.class.reflect_on_association(reference)

    message = if attr_options && attr_options[new_val]
      attr_options[new_val]
    elsif attr_options && msg_proc = attr_options[:message]
      association ? msg_proc.call(model.send(reference).to_s) : msg_proc.call(new_val)
    elsif association
      "#{key.humanize} changed to #{model.send(reference).to_s}"
    else
      "#{key.humanize} changed to #{new_val}"
    end
    {:field_name => key, :message => message, :whodunnit => Trackable.whodunnit}
  end

  def eventable
    (self.eventable_type.constantize).find(self.eventable_id) rescue nil
  end

end


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <title>JQVMap - Ukraine Map</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">

    <link href="../dist/jqvmap.css" media="screen" rel="stylesheet" type="text/css"/>


text:
include_recipe 'omnibus::_bash'

#
# On FreeBSD the Ruby install's SSL points at `/etc/ssl/cert.pem` as the
# default root CA cert. This is actually the location of an optional symlink
# that the `ca_root_nss` port creates. We can't gurantee this optional
# symlink will exist so we'll just point `SSL_CERT_FILE` at the actual
# location of the root CA cert.
#
if freebsd?
  cacert_path = '/usr/local/share/certs/ca-root-nss.crt'

  omnibus_env['SSL_CERT_FILE'] << cacert_path

  file File.join(build_user_home, '.bashrc.d', 'cacerts.sh') do
    owner   node['omnibus']['build_user']
    group   node['omnibus']['build_user_group']
    mode    '0755'
    content <<-EOH.gsub(/^ {6}/, '')
      # This file is written by Chef for #{node['fqdn']}.
      # Do NOT modify this file by hand.

      export SSL_CERT_FILE=#{cacert_path}

    EOH
  end

  link '/etc/ssl/cert.pem' do
    to '/usr/local/share/certs/ca-root-nss.crt'
  end
end


text:
using System;
using System.Collections.Generic;
using System.Data;

namespace OpenTNF.Library.Model
{
    public interface ITnfSecondaryLrs
    {
        string Oid { get; }
        string Name { get; }
        int Type { get; }
        int CatalogueOid { get; }
        string PropertyObjectTypeOid { get; }
        int AssocReferentPropertyObjectTypeOid { get; }
        string Measure1PropertyTypeOid { get; }
        string Measure2PropertyTypeOid { get; }
        string WhereClause { get; }
        string SequencePropertyTypeOid { get; }
        bool OrderDescending { get; }
    }

    public class TnfSecondaryLrs : ITnfSecondaryLrs
    {
        public string Oid { get; set; }
        public string Name { get; set; }
        public int Type { get; set; }
        public int CatalogueOid { get; set; }
        public string PropertyObjectTypeOid { get; set; }
        public int AssocReferentPropertyObjectTypeOid { get; set; }
        public string Measure1PropertyTypeOid { get; set; }
        public string Measure2PropertyTypeOid { get; set; }
        public string WhereClause { get; set; }
        public string SequencePropertyTypeOid { get; set; }
        public bool OrderDescending { get; set; }

        public override bool Equals(object obj)
        {
            if (obj is TnfSecondaryLrs)
            {
                var v = obj as TnfSecondaryLrs;

                if (Oid == v.Oid &&
                    Name == v.Name &&
                    Type == v.Type &&
                    CatalogueOid == v.CatalogueOid &&
                    PropertyObjectTypeOid == v.PropertyObjectTypeOid &&
                    AssocReferentPropertyObjectTypeOid == v.AssocReferentPropertyObjectTypeOid &&
                    Measure1PropertyTypeOid == v.Measure1PropertyTypeOid &&
                    Measure2PropertyTypeOid == v.Measure2PropertyTypeOid &&
                    WhereClause == v.WhereClause &&
                    SequencePropertyTypeOid == v.SequencePropertyTypeOid &&
                    OrderDescending == v.OrderDescending)
                {
                    return true;
                }
            }

            return false;
        }

        public override int GetHashCode()
        {
            return Hashing.RsHash(
                Oid,
                Name,
                Type,
                CatalogueOid,
                PropertyObjectTypeOid,
                AssocReferentPropertyObjectTypeOid,
                Measure1PropertyTypeOid,
                Measure2PropertyTypeOid,
                WhereClause,
                SequencePropertyTypeOid,
                OrderDescending);
        }

        public override string ToString()
        {
            return
                string.Format(
                    "TnfSecondaryLrs: Oid = {0}, Name = {1}, Type = {2}, CatalogueOid = {3}, PropertyObjectTypeOid = {4}, " +
                    "AssocReferentPropertyObjectTypeOid = {5}, Measure1PropertyTypeOid = {6}, Measure2PropertyTypeOid = {7}, " +
                    "WhereClause = {8}, SequencePropertyTypeOid = {9}, OrderDescending = {10}",
                    Oid,
                    Name,
                    Type,
                    CatalogueOid,
                    PropertyObjectTypeOid,
                    AssocReferentPropertyObjectTypeOid,
                    Measure1PropertyTypeOid,
                    Measure2PropertyTypeOid,
                    WhereClause,
                    SequencePropertyTypeOid,
                    OrderDescending);
        }
    }

    public class TnfSecondaryLrsManager : TableManager
    {
        public static string TnfSecondaryLrsTableName = "tnf_secondary_lrs";

        public TnfSecondaryLrsManager(GeoPackageDatabase db) : base(db, TnfSecondaryLrsTableName, GetColumnInfos())
        {
        }

        protected override string[] Constraints()
        {
            return new[]
                {
                    String.Format("CONSTRAINT fk_tsl_co FOREIGN KEY (catalogue_oid) REFERENCES {0}(oid)",TnfCatalogueManager.TnfCatalogueTableName)
                };
        }

        private static ColumnInfo[] GetColumnInfos()
        {
            return new[]
            {
                new ColumnInfo
                {
                    Name = "oid",
                    SqlType = "TEXT NOT NULL",
                    DataType = Type.GetType("System.String")
                },
                new ColumnInfo
                {
                    Name = "name",
                    SqlType = "TEXT NOT NULL",
                    DataType = Type.GetType("System.String")
                },
                new ColumnInfo
                {
                    Name = "type",
                    SqlType = "INTEGER NOT NULL",
                    DataType = Type.GetType("System.Int32")
                },
                new ColumnInfo
                {
                    Name = "catalogue_oid",
                    SqlType = "TEXT NOT NULL",
                    DataType = Type.GetType("System.String")
                },
                new ColumnInfo
                {
                    Name = "property_object_type_oid",
                    SqlType = "TEXT NOT NULL",
                    DataType = Type.GetType("System.String")
                },
                new ColumnInfo
                {
                    Name = "assoc_referent_property_object_type_oid",
                    SqlType = "TEXT",
                    DataType = Type.GetType("System.String")
                },
                new ColumnInfo
                {
                    Name = "measure1_property_type_oid",
                    SqlType = "TEXT",
                    DataType = Type.GetType("System.String")
                },
                new ColumnInfo
                {
                    Name = "measure2_property_type_oid",
                    SqlType = "TEXT",
                    DataType = Type.GetType("System.String")
                },
                new ColumnInfo
                {
                    Name = "where_clause",
                    SqlType = "TEXT",
                    DataType = Type.GetType("System.String")
                },
                new ColumnInfo
                {
                    Name = "sequence_property_type_oid",
                    SqlType = "TEXT",
                    DataType = Type.GetType("System.String")
                },
                new ColumnInfo
                {
                    Name = "order_descending",
                    SqlType = "INTEGER",
                    DataType = Type.GetType("System.Boolean")
                },
            };
        }

        public void Add(TnfSecondaryLrs tnfSecondaryLrs)
        {
            Add(new object[]
                {
                    tnfSecondaryLrs.Oid,
                    tnfSecondaryLrs.Name,
                    tnfSecondaryLrs.Type,
                    tnfSecondaryLrs.CatalogueOid,
                    tnfSecondaryLrs.PropertyObjectTypeOid,
                    tnfSecondaryLrs.AssocReferentPropertyObjectTypeOid,
                    tnfSecondaryLrs.Measure1PropertyTypeOid,
                    tnfSecondaryLrs.Measure2PropertyTypeOid,
                    tnfSecondaryLrs.WhereClause,
                    tnfSecondaryLrs.SequencePropertyTypeOid,
                    tnfSecondaryLrs.OrderDescending
                });
        }

        public TnfSecondaryLrs GetByOid(string oid)
        {
            return Get(ReadObject, new object[] { oid });
        }

        public List<TnfSecondaryLrs> GetMany(int maxResults)
        {
            return Get(ReadObject, maxResults);
        }

        public int Update(TnfSecondaryLrs tnfSecondaryLrs)
        {
            return Update(new object[]
                {
                    tnfSecondaryLrs.Oid,
                    tnfSecondaryLrs.Name,
                    tnfSecondaryLrs.Type,
                    tnfSecondaryLrs.CatalogueOid,
                    tnfSecondaryLrs.PropertyObjectTypeOid,
                    tnfSecondaryLrs.AssocReferentPropertyObjectTypeOid,
                    tnfSecondaryLrs.Measure1PropertyTypeOid,
                    tnfSecondaryLrs.Measure2PropertyTypeOid,
                    tnfSecondaryLrs.WhereClause,
                    tnfSecondaryLrs.SequencePropertyTypeOid,
                    tnfSecondaryLrs.OrderDescending
                });
        }

        public int Delete(string oid)
        {
            return Delete(new object[] { oid });
        }

        private static TnfSecondaryLrs ReadObject(IDataRecord reader)
        {
            var tnfSecondaryLrs = new TnfSecondaryLrs();

            tnfSecondaryLrs.Oid = reader["oid"].FromDbString();
            tnfSecondaryLrs.Name = reader["name"].FromDbString();
            tnfSecondaryLrs.Type =  reader["type"].ToInt();
            tnfSecondaryLrs.CatalogueOid = reader["catalogue_oid"].ToInt();
            tnfSecondaryLrs.PropertyObjectTypeOid = reader["property_object_type_oid"].FromDbString();
            tnfSecondaryLrs.AssocReferentPropertyObjectTypeOid = reader["assoc_referent_property_object_type_oid"].ToInt();
            tnfSecondaryLrs.Measure1PropertyTypeOid = reader["measure1_property_type_oid"].FromDbString();
            tnfSecondaryLrs.Measure2PropertyTypeOid = reader["measure2_property_type_oid"].FromDbString();
            tnfSecondaryLrs.WhereClause = reader["where_clause"].FromDbString();
            tnfSecondaryLrs.SequencePropertyTypeOid = reader["sequence_property_type_oid"].FromDbString();
            tnfSecondaryLrs.OrderDescending = reader["order_descending"].ToInt() > 0;
            return tnfSecondaryLrs;
        }

    }
}


text:
package com.blackboxgaming.engine.input;

import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.bullet.collision.Collision;
import com.badlogic.gdx.physics.bullet.collision.btCollisionObject;
import com.blackboxgaming.engine.Engine;
import com.blackboxgaming.engine.Entity;
import com.blackboxgaming.engine.systems.conway.ConwayUtil;
import com.blackboxgaming.engine.components.Cell;
import com.blackboxgaming.engine.components.HUDItem;
import com.blackboxgaming.engine.components.Health;
import com.blackboxgaming.engine.components.MinimapModel;
import com.blackboxgaming.engine.components.Model;
import com.blackboxgaming.engine.components.Name;
import com.blackboxgaming.engine.components.OrbitCameraFocus;
import com.blackboxgaming.engine.components.Parent;
import com.blackboxgaming.engine.components.Physics;
import com.blackboxgaming.engine.components.Physics2D;
import com.blackboxgaming.engine.components.Puppet;
import com.blackboxgaming.engine.components.Speed;
import com.blackboxgaming.engine.components.Transform;
import com.blackboxgaming.engine.components.Velocity;
import com.blackboxgaming.engine.components.ai.Follow;
import com.blackboxgaming.engine.factories.CollisionShapeFactory;
import com.blackboxgaming.engine.factories.CollisionShapeFactory2D;
import com.blackboxgaming.engine.factories.ModelFactory;
import com.blackboxgaming.engine.factories.WeaponFactory;
import com.blackboxgaming.engine.global.constants.Constants;
import com.blackboxgaming.engine.systems.AbyssSystem;
import com.blackboxgaming.engine.systems.ConwaySystem;
import com.blackboxgaming.engine.systems.render.HealthBarRendererSystem;
import com.blackboxgaming.engine.systems.HealthSystem;
import com.blackboxgaming.engine.systems.ParentChildSystem;
import com.blackboxgaming.engine.systems.PhysicsSystem;
import com.blackboxgaming.engine.systems.PhysicsSystem2D;
import com.blackboxgaming.engine.systems.TimedDeathSystem;
import com.blackboxgaming.engine.systems.VelocitySystem;
import com.blackboxgaming.engine.systems.WeaponSystem;
import com.blackboxgaming.engine.systems.ai.FollowSystem;
import com.blackboxgaming.engine.systems.render.HUDMessageRendererSystem;
import com.blackboxgaming.engine.systems.render.ModelRendererSystem;
import com.blackboxgaming.engine.util.Global;
import com.blackboxgaming.engine.util.Randomizer;
import com.blackboxgaming.engine.util.OldButNotThatOldWorldSetup;
import static com.blackboxgaming.engine.util.OldButNotThatOldWorldSetup.createWeapon;
import com.blackboxgaming.engine.util.WorldUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Adrian
 */
public class DemoKeyListener implements InputProcessor {

    @Override
    public boolean keyDown(int key) {
        switch (key) {
            case Keys.NUM_1:
                System.out.println("Adding ConwaySystem");
                if (!Engine.systemManager.has(ConwaySystem.class)) {
                    Engine.systemManager.add(new ConwaySystem(ConwaySystem.life5766, 250));
                    System.out.println("Adding premordial soup");
                    ConwayUtil.createPremordialSoup(20, 4);
                    Entity hudItem = new Entity();
                    hudItem.add(new HUDItem("Generation"));
                    Engine.entityManager.add(hudItem);
                    HUDMessageRendererSystem.addTemporaryMessage("Added cells");
                } else {
                    System.out.println("Removing ConwaySystem");
                    Engine.systemManager.get(ConwaySystem.class).clearUniverse();
                    Engine.systemManager.get(ConwaySystem.class).dispose();
                    Engine.systemManager.remove(ConwaySystem.class);
                }
                break;
            case Keys.NUM_2:
                System.out.println("Toggle Conway System");
                if (Engine.systemManager.has(ConwaySystem.class)) {
                    boolean toggle = Engine.systemManager.get(ConwaySystem.class).manualBreak;
                    Engine.systemManager.get(ConwaySystem.class).manualBreak = !toggle;
                    if (toggle == true) {
                        HUDMessageRendererSystem.addTemporaryMessage("Started ConwaySystem");
                    } else {
                        HUDMessageRendererSystem.addTemporaryMessage("Stopped ConwaySystem");
                    }
                }
                break;
            case Keys.G:
                System.out.println("Adding Glidder");
                if (!Engine.systemManager.has(ConwaySystem.class)) {
                    Engine.systemManager.add(new ConwaySystem(ConwaySystem.life5766, 200));
                    System.out.println("Adding premordial soup");
                    ConwayUtil.createGlider();
                    Entity hudItem = new Entity();
                    hudItem.add(new HUDItem("Generation"));
                    Engine.entityManager.add(hudItem);
                } else {
                    System.out.println("Removing ConwaySystem");
                    Engine.systemManager.get(ConwaySystem.class).clearUniverse();
                    Engine.systemManager.get(ConwaySystem.class).dispose();
                    Engine.systemManager.remove(ConwaySystem.class);
                }
                break;
            case Keys.NUM_3:
                System.out.println("Adding physics and abys systems");
                Engine.systemManager.addAfter(new PhysicsSystem(), VelocitySystem.class);
                Engine.systemManager.addAfter(new PhysicsSystem2D(), PhysicsSystem.class);
                Engine.systemManager.addAfter(new AbyssSystem(), PhysicsSystem2D.class);

                System.out.println("Adding ground");
                Entity grid = new Entity();
                grid.add(new Transform(0, 0, 0));
                grid.add(new Model(ModelFactory.getGridModel((int) 50)));
                grid.add(new Physics(CollisionShapeFactory.getBoxShape(50, 1, 50, new Vector3(0, -0.5f, 0)), 0, btCollisionObject.CollisionFlags.CF_KINEMATIC_OBJECT, Constants.GROUND_FLAG, (short) 0, Collision.DISABLE_DEACTIVATION));
                grid.add(new MinimapModel(Color.LIGHT_GRAY));
                Engine.entityManager.add(grid);
                HUDMessageRendererSystem.addTemporaryMessage("Added ground");
                break;
            case Keys.NUM_4:
                System.out.println("Adding physics to cells");
                if (Engine.systemManager.has(ConwaySystem.class)) {
                    for (Map.Entry<Cell, Entity> entrySet : Engine.systemManager.get(ConwaySystem.class).universe.entrySet()) {
                        Entity entity = entrySet.getValue();
                        entity.add(new Physics(CollisionShapeFactory.getCubeShape(1), 25, btCollisionObject.CollisionFlags.CF_CUSTOM_MATERIAL_CALLBACK, Constants.OBJECT_FLAG, Constants.ALL_FLAG, Collision.ACTIVE_TAG));
                        entity.add(new Physics2D(CollisionShapeFactory2D.getBoxShape(0.5f, 0.5f), BodyDef.BodyType.DynamicBody, 1, entity.get(Transform.class).transform, false));
//                        physicsSystem.add(entity);
                        Engine.entityManager.update(entity);
                    }
                    System.out.println("Removing conway system");
                    Engine.systemManager.remove(ConwaySystem.class);
                }
                HUDMessageRendererSystem.addTemporaryMessage("Added physics to cells");
                break;
            case Keys.NUM_5:
                System.out.println("Adding follower system");
                Engine.systemManager.add(new FollowSystem());
                List<Entity> entities = Engine.entityManager.get(Cell.class);
                for (Entity enemy : entities) {
                    if (entities.size() > 1) {
                        Entity newTarget;
                        do {
                            newTarget = entities.get(Randomizer.getRandomInteger(entities.size()));
                        } while (newTarget.equals(enemy)); // so it won't select itself

//                    enemy.add(new Enemy());
                        enemy.add(new Follow(newTarget, 2));
                        enemy.add(new Velocity(4f, 0, 0));
                        Engine.entityManager.update(enemy);
                    }
                }
                break;
            case Keys.NUM_6:
                System.out.println("Giving all cells health and adding weapon system");
                Engine.systemManager.addAfter(new ParentChildSystem(), VelocitySystem.class);
                Engine.systemManager.add(new WeaponSystem());
                Engine.systemManager.add(new TimedDeathSystem());
                Engine.systemManager.add(new HealthSystem());
                Engine.systemManager.addAfter(new HealthBarRendererSystem(), ModelRendererSystem.class);

                System.out.println("Making all cells into enemies");
                List<Entity> entities2 = Engine.entityManager.get(Cell.class);
                for (Entity enemy : entities2) {
                    enemy.add(new Health(100));

                    Parent parent = new Parent(true);
                    parent.add(OldButNotThatOldWorldSetup.createWeapon(enemy, WeaponFactory.WEAPON_MELEE, new Vector3(0, 0, 0.5f)));
                    enemy.add(parent);

                    Engine.entityManager.update(enemy);
                }
                HUDMessageRendererSystem.addTemporaryMessage("Added health and weapon to cells");
                break;
            case Keys.NUM_7:
                System.out.println("Adding weapon to player");
                WorldUtil.addKeyText();
                for (Entity e : Engine.entityManager.get()) {
                    if (e.has(OrbitCameraFocus.class)) {
                        System.out.println("Adding weapon to player x");

//                        e.add(new Health(100));
                        e.add(new Model(ModelFactory.getCubeModel(1), Color.GREEN));
                        e.add(new Physics(CollisionShapeFactory.getCubeShape(1), 25, btCollisionObject.CollisionFlags.CF_CUSTOM_MATERIAL_CALLBACK, Constants.OBJECT_FLAG, Constants.ALL_FLAG, Collision.ACTIVE_TAG));
                        e.add(new Physics2D(CollisionShapeFactory2D.getBoxShape(0.5f, 0.5f), BodyDef.BodyType.DynamicBody, 1, e.get(Transform.class).transform, false));
                        Parent parent = new Parent(true);
                        parent.add(createWeapon(e, WeaponFactory.WEAPON_PLASMA, new Vector3(0, 0, 0.5f)));
                        parent.add(createWeapon(e, WeaponFactory.WEAPON_PLASMA, new Vector3(0, 0, -0.5f)));
                        e.add(parent);
                        Engine.entityManager.update(e);
                    }
                }
                HUDMessageRendererSystem.addTemporaryMessage("Added weapon to player");
                break;
            case Keys.NUM_8:
                System.out.println("Adding boss enemies");
                OldButNotThatOldWorldSetup.addBossEnemies(25, 10);
                HUDMessageRendererSystem.addTemporaryMessage("Added 10 boss enemies");
                break;
            case Keys.NUM_9:
                System.out.println("Adding dragon");
                Engine.assetManager.init();
                Engine.assetManager.loadModel("dragon/dragon.g3db");
                Entity dragon = new Entity();
                dragon.add(new Transform());
                dragon.add(new Model(Engine.assetManager.getModel("dragon/dragon.g3db")));
                Engine.entityManager.add(dragon);
                break;
            case Keys.H:
                Global.demoHelpMessage = !Global.demoHelpMessage;
                if (Global.demoHelpMessage) {
                    // add demo help message
                    WorldUtil.addDemoText();
                } else {
                    // remove demo help message
                    for (Entity namedEntity : Engine.entityManager.get(Name.class)) {
                        if (namedEntity.get(Name.class).value.equals("Demo help message")) {
                            Engine.garbageManager.markForDeletion(namedEntity);
                            break;
                        }
                    }
                }
                break;
        }
        return false;
    }

    @Override
    public boolean keyUp(int i
    ) {
        return false;
    }

    @Override
    public boolean keyTyped(char c
    ) {
        return false;
    }

    @Override
    public boolean touchDown(int i, int i1, int i2, int i3
    ) {
        return false;
    }

    @Override
    public boolean touchUp(int i, int i1, int i2, int i3
    ) {
        return false;
    }

    @Override
    public boolean touchDragged(int i, int i1, int i2
    ) {
        return false;
    }

    @Override
    public boolean mouseMoved(int i, int i1
    ) {
        return false;
    }

    @Override
    public boolean scrolled(int i
    ) {
        return false;
    }

}


text:
{% extends "govuk_template.html" %}

{% block head %}
  {% include "includes/head.html" %}
{% endblock %}

{% block proposition_header %}
  {% include "includes/propositional_navigation.html" %}
{% endblock %}

{% block header_class %}
  with-proposition
{% endblock %}

{% block page_title %}
  Borrower reference
{% endblock %}

{% block content %}

	{% include "includes/phase_banner_beta.html" %}

What is your borrower reference?

		<form class="form">

					Borrower reference

For example, 2eb47c

				<input type="text" class="form-control" id="borrowerid" name="borrowerid" >

				Continue

		</form>

				I don't have a borrower reference

If you don't have a reference your should contact your conveyancer.

{% endblock %}

{% block body_end %}
  {% include "includes/scripts.html" %}

{% endblock %}


text:
module Chat
  module Model
    class Message

      attr_reader :user, :time
      attr_accessor :text
      def initialize(user, text = nil)
        @user, @text = user, text
      end

      def valid?
        @text.present?
      end

      def time!
        @time = Time.now
      end

    end

  end
end


text:
import semver, { type SemVer } from "semver";
import { logPlugin } from "./debug";
import getOptionSpecificExcludesFor from "./get-option-specific-excludes";
import {
  addProposalSyntaxPlugins,
  removeUnnecessaryItems,
  removeUnsupportedItems,
} from "./filter-items";
import moduleTransformations from "./module-transformations";
import normalizeOptions from "./normalize-options";
import {
  pluginSyntaxMap,
  proposalPlugins,
  proposalSyntaxPlugins,
} from "./shipped-proposals";
import {
  plugins as pluginsList,
  pluginsBugfixes as pluginsBugfixesList,
  overlappingPlugins,
} from "./plugins-compat-data";

import removeRegeneratorEntryPlugin from "./polyfills/regenerator";
import legacyBabelPolyfillPlugin from "./polyfills/babel-polyfill";

import type { CallerMetadata } from "@babel/core";

import _pluginCoreJS2 from "babel-plugin-polyfill-corejs2";
import _pluginCoreJS3 from "babel-plugin-polyfill-corejs3";
import _pluginRegenerator from "babel-plugin-polyfill-regenerator";
const pluginCoreJS2 = _pluginCoreJS2.default || _pluginCoreJS2;
const pluginCoreJS3 = _pluginCoreJS3.default || _pluginCoreJS3;
const pluginRegenerator = _pluginRegenerator.default || _pluginRegenerator;

import getTargets, {
  prettifyTargets,
  filterItems,
  isRequired,
} from "@babel/helper-compilation-targets";
import type { Targets, InputTargets } from "@babel/helper-compilation-targets";
import availablePlugins from "./available-plugins";
import { declarePreset } from "@babel/helper-plugin-utils";

type ModuleTransformationsType =
  typeof import("./module-transformations").default;
import type { BuiltInsOption, ModuleOption, Options } from "./types";

// TODO: Remove in Babel 8
export function isPluginRequired(targets: Targets, support: Targets) {
  return isRequired("fake-name", targets, {
    compatData: { "fake-name": support },
  });
}

function filterStageFromList(
  list: { [feature: string]: Targets },
  stageList: Set<string>,
) {
  return Object.keys(list).reduce((result, item) => {
    if (!stageList.has(item)) {
      // @ts-expect-error todo: refine result types
      result[item] = list[item];
    }

    return result;
  }, {});
}

const pluginLists = {
  withProposals: {
    withoutBugfixes: pluginsList,
    withBugfixes: Object.assign({}, pluginsList, pluginsBugfixesList),
  },
  withoutProposals: {
    withoutBugfixes: filterStageFromList(pluginsList, proposalPlugins),
    withBugfixes: filterStageFromList(
      Object.assign({}, pluginsList, pluginsBugfixesList),
      proposalPlugins,
    ),
  },
};

function getPluginList(proposals: boolean, bugfixes: boolean) {
  if (proposals) {
    if (bugfixes) return pluginLists.withProposals.withBugfixes;
    else return pluginLists.withProposals.withoutBugfixes;
  } else {
    if (bugfixes) return pluginLists.withoutProposals.withBugfixes;
    else return pluginLists.withoutProposals.withoutBugfixes;
  }
}

const getPlugin = (pluginName: string) => {
  const plugin =
    // @ts-expect-error plugin name is constructed from available plugin list
    availablePlugins[pluginName]();

  if (!plugin) {
    throw new Error(
      `Could not find plugin "${pluginName}". Ensure there is an entry in ./available-plugins.js for it.`,
    );
  }

  return plugin;
};

export const transformIncludesAndExcludes = (opts: Array<string>): any => {
  return opts.reduce(
    (result, opt) => {
      const target = opt.match(/^(es|es6|es7|esnext|web)\./)
        ? "builtIns"
        : "plugins";
      result[target].add(opt);
      return result;
    },
    {
      all: opts,
      plugins: new Set(),
      builtIns: new Set(),
    },
  );
};

export const getModulesPluginNames = ({
  modules,
  transformations,
  shouldTransformESM,
  shouldTransformDynamicImport,
  shouldTransformExportNamespaceFrom,
  shouldParseTopLevelAwait,
}: {
  modules: ModuleOption;
  transformations: ModuleTransformationsType;
  shouldTransformESM: boolean;
  shouldTransformDynamicImport: boolean;
  shouldTransformExportNamespaceFrom: boolean;
  shouldParseTopLevelAwait: boolean;
}) => {
  const modulesPluginNames = [];
  if (modules !== false && transformations[modules]) {
    if (shouldTransformESM) {
      modulesPluginNames.push(transformations[modules]);
    }

    if (
      shouldTransformDynamicImport &&
      shouldTransformESM &&
      modules !== "umd"
    ) {
      modulesPluginNames.push("transform-dynamic-import");
    } else {
      if (shouldTransformDynamicImport) {
        console.warn(
          "Dynamic import can only be supported when transforming ES modules" +
            " to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.",
        );
      }
      modulesPluginNames.push("syntax-dynamic-import");
    }
  } else {
    modulesPluginNames.push("syntax-dynamic-import");
  }

  if (shouldTransformExportNamespaceFrom) {
    modulesPluginNames.push("transform-export-namespace-from");
  } else {
    modulesPluginNames.push("syntax-export-namespace-from");
  }

  if (shouldParseTopLevelAwait) {
    modulesPluginNames.push("syntax-top-level-await");
  }

  return modulesPluginNames;
};

export const getPolyfillPlugins = ({
  useBuiltIns,
  corejs,
  polyfillTargets,
  include,
  exclude,
  proposals,
  shippedProposals,
  regenerator,
  debug,
}: {
  useBuiltIns: BuiltInsOption;
  corejs: SemVer | null | false;
  polyfillTargets: Targets;
  include: Set<string>;
  exclude: Set<string>;
  proposals: boolean;
  shippedProposals: boolean;
  regenerator: boolean;
  debug: boolean;
}) => {
  const polyfillPlugins = [];
  if (useBuiltIns === "usage" || useBuiltIns === "entry") {
    const pluginOptions = {
      method: `${useBuiltIns}-global`,
      version: corejs ? corejs.toString() : undefined,
      targets: polyfillTargets,
      include,
      exclude,
      proposals,
      shippedProposals,
      debug,
    };

    if (corejs) {
      if (useBuiltIns === "usage") {
        if (corejs.major === 2) {
          polyfillPlugins.push(
            [pluginCoreJS2, pluginOptions],
            [legacyBabelPolyfillPlugin, { usage: true }],
          );
        } else {
          polyfillPlugins.push(
            [pluginCoreJS3, pluginOptions],
            [legacyBabelPolyfillPlugin, { usage: true, deprecated: true }],
          );
        }
        if (regenerator) {
          polyfillPlugins.push([
            pluginRegenerator,
            { method: "usage-global", debug },
          ]);
        }
      } else {
        if (corejs.major === 2) {
          polyfillPlugins.push(
            [legacyBabelPolyfillPlugin, { regenerator }],
            [pluginCoreJS2, pluginOptions],
          );
        } else {
          polyfillPlugins.push(
            [pluginCoreJS3, pluginOptions],
            [legacyBabelPolyfillPlugin, { deprecated: true }],
          );
          if (!regenerator) {
            polyfillPlugins.push([removeRegeneratorEntryPlugin, pluginOptions]);
          }
        }
      }
    }
  }
  return polyfillPlugins;
};

function getLocalTargets(
  optionsTargets: Options["targets"],
  ignoreBrowserslistConfig: boolean,
  configPath: string,
  browserslistEnv: string,
) {
  if (optionsTargets?.esmodules && optionsTargets.browsers) {
    console.warn(`
@babel/preset-env: esmodules and browsers targets have been specified together.
\`browsers\` target, \`${optionsTargets.browsers.toString()}\` will be ignored.
`);
  }

  return getTargets(optionsTargets as InputTargets, {
    ignoreBrowserslistConfig,
    configPath,
    browserslistEnv,
  });
}

function supportsStaticESM(caller: CallerMetadata | undefined) {
  // @ts-expect-error supportsStaticESM is not defined in CallerMetadata
  return !!caller?.supportsStaticESM;
}

function supportsDynamicImport(caller: CallerMetadata | undefined) {
  // @ts-expect-error supportsDynamicImport is not defined in CallerMetadata
  return !!caller?.supportsDynamicImport;
}

function supportsExportNamespaceFrom(caller: CallerMetadata | undefined) {
  // @ts-expect-error supportsExportNamespaceFrom is not defined in CallerMetadata
  return !!caller?.supportsExportNamespaceFrom;
}

function supportsTopLevelAwait(caller: CallerMetadata | undefined) {
  // @ts-expect-error supportsTopLevelAwait is not defined in CallerMetadata
  return !!caller?.supportsTopLevelAwait;
}

export default declarePreset((api, opts: Options) => {
  api.assertVersion(7);

  const babelTargets = api.targets();

  const {
    bugfixes,
    configPath,
    debug,
    exclude: optionsExclude,
    forceAllTransforms,
    ignoreBrowserslistConfig,
    include: optionsInclude,
    loose,
    modules,
    shippedProposals,
    spec,
    targets: optionsTargets,
    useBuiltIns,
    corejs: { version: corejs, proposals },
    browserslistEnv,
  } = normalizeOptions(opts);

  let targets = babelTargets;

  if (
    // @babel/core < 7.13.0 doesn't load targets (api.targets() always
    // returns {} thanks to @babel/helper-plugin-utils), so we always want
    // to fallback to the old targets behavior in this case.
    semver.lt(api.version, "7.13.0") ||
    // If any browserslist-related option is specified, fallback to the old
    // behavior of not using the targets specified in the top-level options.
    opts.targets ||
    opts.configPath ||
    opts.browserslistEnv ||
    opts.ignoreBrowserslistConfig
  ) {
    if (!process.env.BABEL_8_BREAKING) {
      // eslint-disable-next-line no-var
      var hasUglifyTarget = false;

      if (optionsTargets?.uglify) {
        hasUglifyTarget = true;
        delete optionsTargets.uglify;

        console.warn(`
The uglify target has been deprecated. Set the top level
option \`forceAllTransforms: true\` instead.
`);
      }
    }

    targets = getLocalTargets(
      optionsTargets,
      ignoreBrowserslistConfig,
      configPath,
      browserslistEnv,
    );
  }

  const transformTargets = (
    process.env.BABEL_8_BREAKING
      ? forceAllTransforms
      : forceAllTransforms || hasUglifyTarget
  )
    ? ({} as Targets)
    : targets;

  const include = transformIncludesAndExcludes(optionsInclude);
  const exclude = transformIncludesAndExcludes(optionsExclude);

  const compatData = getPluginList(shippedProposals, bugfixes);
  const shouldSkipExportNamespaceFrom =
    (modules === "auto" && api.caller?.(supportsExportNamespaceFrom)) ||
    (modules === false &&
      !isRequired("transform-export-namespace-from", transformTargets, {
        compatData,
        includes: include.plugins,
        excludes: exclude.plugins,
      }));
  const modulesPluginNames = getModulesPluginNames({
    modules,
    transformations: moduleTransformations,
    // TODO: Remove the 'api.caller' check eventually. Just here to prevent
    // unnecessary breakage in the short term for users on older betas/RCs.
    shouldTransformESM: modules !== "auto" || !api.caller?.(supportsStaticESM),
    shouldTransformDynamicImport:
      modules !== "auto" || !api.caller?.(supportsDynamicImport),
    shouldTransformExportNamespaceFrom: !shouldSkipExportNamespaceFrom,
    shouldParseTopLevelAwait:
      !api.caller || (api.caller(supportsTopLevelAwait) as boolean),
  });

  const pluginNames = filterItems(
    compatData,
    include.plugins,
    exclude.plugins,
    transformTargets,
    modulesPluginNames,
    getOptionSpecificExcludesFor({ loose }),
    pluginSyntaxMap,
  );
  removeUnnecessaryItems(pluginNames, overlappingPlugins);
  removeUnsupportedItems(pluginNames, api.version);
  if (shippedProposals) {
    addProposalSyntaxPlugins(pluginNames, proposalSyntaxPlugins);
  }

  const polyfillPlugins = getPolyfillPlugins({
    useBuiltIns,
    corejs,
    polyfillTargets: targets,
    include: include.builtIns,
    exclude: exclude.builtIns,
    proposals,
    shippedProposals,
    regenerator: pluginNames.has("transform-regenerator"),
    debug,
  });

  const pluginUseBuiltIns = useBuiltIns !== false;
  const plugins = Array.from(pluginNames)
    .map(pluginName => {
      if (
        pluginName === "transform-class-properties" ||
        pluginName === "transform-private-methods" ||
        pluginName === "transform-private-property-in-object"
      ) {
        return [
          getPlugin(pluginName),
          {
            loose: loose
              ? "#__internal__@babel/preset-env__prefer-true-but-false-is-ok-if-it-prevents-an-error"
              : "#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error",
          },
        ];
      }
      return [
        getPlugin(pluginName),
        { spec, loose, useBuiltIns: pluginUseBuiltIns },
      ];
    })
    .concat(polyfillPlugins);

  if (debug) {
    console.log("@babel/preset-env: `DEBUG` option");
    console.log("\nUsing targets:");
    console.log(JSON.stringify(prettifyTargets(targets), null, 2));
    console.log(`\nUsing modules transform: ${modules.toString()}`);
    console.log("\nUsing plugins:");
    pluginNames.forEach(pluginName => {
      logPlugin(pluginName, targets, compatData);
    });

    if (!useBuiltIns) {
      console.log(
        "\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.",
      );
    }
  }

  return { plugins };
});


text:
{-# LANGUAGE FlexibleContexts, RecordWildCards, CPP #-}
module AWS.CloudWatch.Alarm
    ( describeAlarms
    , describeAlarmsForMetric
    , putMetricAlarm
    , deleteAlarms
    , describeAlarmHistory
    , enableAlarmActions
    , disableAlarmActions
    , setAlarmState
    ) where

import Control.Applicative
#if MIN_VERSION_conduit(1,1,0)
import Control.Monad.Trans.Resource (MonadThrow, MonadResource, MonadBaseControl)
#endif
import Data.Conduit
import Data.Text (Text)
import Data.Time (UTCTime)
import Data.XML.Types (Event)

import AWS.CloudWatch.Internal
import AWS.CloudWatch.Types
import AWS.Lib.Parser (getT, getT_, members, text)
import AWS.Lib.Query
import AWS.Util (toText, boolToText, timeToText)

describeAlarms
    :: (MonadBaseControl IO m, MonadResource m)
    => Maybe Text -- ^ The action name prefix.
    -> AlarmNameSpec -- ^ The alarm name prefix or a list of alarm names to retrieve information for.
    -> Maybe Int -- ^ The maximum number of alarm descriptions to retrieve.
    -> Maybe Text -- ^ The token returned by a previous call to indicate that there is more data available.
    -> Maybe StateValue -- ^ The state value to be used in matching alarms.
    -> CloudWatch m ([MetricAlarm], Maybe Text) -- ^ A list of information for the specified alarms and NextToken.
describeAlarms prefix spec maxRecords nextToken state =
    cloudWatchQuery "DescribeAlarms" params $
        (,) <$> members "MetricAlarms" sinkMetricAlarm <*> getT "NextToken"
  where
    params =
        [ "ActionPrefix" |=? prefix
        , specParam spec
        , "MaxRecords" |=? toText <$> maxRecords
        , "NextToken" |=? nextToken
        , "StateValue" |=? stringifyStateValue <$> state
        ]
    specParam AlarmSpecNothing = nothingParam
    specParam (AlarmSpecNamePrefix p) = "AlarmNamePrefix" |= p
    specParam (AlarmSpecNames ns) = "AlarmNames.member" |.#= ns

stringifyStateValue :: StateValue -> Text
stringifyStateValue StateValueOk = "OK"
stringifyStateValue StateValueAlarm = "ALARM"
stringifyStateValue StateValueInsufficientData = "INSUFFICIENT_DATA"

sinkMetricAlarm :: MonadThrow m => Consumer Event m MetricAlarm
sinkMetricAlarm =
    MetricAlarm
    <$> getT "AlarmDescription"
    <*> getT "StateUpdatedTimestamp"
    <*> members "InsufficientDataActions" text
    <*> getT "StateReasonData"
    <*> getT "AlarmArn"
    <*> getT "AlarmConfigurationUpdatedTimestamp"
    <*> getT "AlarmName"
    <*> getT "StateValue"
    <*> getT "Period"
    <*> members "OKActions" text
    <*> getT "ActionsEnabled"
    <*> getT "Namespace"
    <*> getT "Threshold"
    <*> getT "EvaluationPeriods"
    <*> getT "Statistic"
    <*> members "AlarmActions" text
    <*> getT "Unit"
    <*> getT "StateReason"
    <*> members "Dimensions" sinkDimension
    <*> getT "ComparisonOperator"
    <*> getT "MetricName"

describeAlarmsForMetric
    :: (MonadBaseControl IO m, MonadResource m)
    => [Dimension] -- ^ The list of dimensions associated with the metric.
    -> Text -- ^ The name of the metric.
    -> Text -- ^ The namespace of the metric.
    -> Int -- ^ The period in seconds over which the statistic is applied.
    -> Statistic -- ^ The statistic for the metric.
    -> Maybe Text -- ^  The unit for the metric.
    -> CloudWatch m [MetricAlarm]
describeAlarmsForMetric dims name ns period stat unit =
    cloudWatchQuery "DescribeAlarmsForMetric" params $ members "MetricAlarms" sinkMetricAlarm
  where
    params =
        [ "Dimensions.member" |.#. map fromDimension dims
        , "MetricName" |= name
        , "Namespace" |= ns
        , "Period" |= toText period
        , "Statistic" |= stringifyStatistic stat
        , "Unit" |=? unit
        ]

putMetricAlarm
    :: (MonadBaseControl IO m, MonadResource m)
    => PutMetricAlarmRequest
    -> CloudWatch m ()
putMetricAlarm PutMetricAlarmRequest{..} =
    cloudWatchQuery "PutMetricAlarm" params $ getT_ "PutMetricAlarmResult"
  where
    params =
        [ "ActionsEnabled" |=? boolToText <$> putMetricAlarmActionsEnabled
        , "AlarmActions.member" |.#= putMetricAlarmAlarmActions
        , "AlarmDescription" |=? putMetricAlarmAlarmDescription
        , "AlarmName" |= putMetricAlarmAlarmName
        , "ComparisonOperator" |= toText putMetricAlarmComparisonOperator
        , "Dimensions.member" |.#. map fromDimension putMetricAlarmDimensions
        , "EvaluationPeriods" |= toText putMetricAlarmEvaluationPeriods
        , "InsufficientDataActions.member" |.#= putMetricAlarmInsufficientDataActions
        , "MetricName" |= putMetricAlarmMetricName
        , "Namespace" |= putMetricAlarmNamespace
        , "OKActions.member" |.#= putMetricAlarmOKActions
        , "Period" |= toText putMetricAlarmPeriod
        , "Statistic" |= stringifyStatistic putMetricAlarmStatistic
        , "Threshold" |= toText putMetricAlarmThreshold
        , "Unit" |=? putMetricAlarmUnit
        ]

deleteAlarms
    :: (MonadBaseControl IO m, MonadResource m)
    => [Text] -- ^ A list of alarms to be deleted.
    -> CloudWatch m ()
deleteAlarms names = cloudWatchQuery "DeleteAlarms" ["AlarmNames.member" |.#= names] $ return ()

describeAlarmHistory
    :: (MonadBaseControl IO m, MonadResource m)
    => Maybe Text -- ^ The name of the alarm.
    -> Maybe UTCTime -- ^ The ending date to retrieve alarm history.
    -> Maybe HistoryType -- ^ The type of alarm histories to retrieve.
    -> Maybe Int -- ^ The maximum number of alarm history records to retrieve.
    -> Maybe Text -- ^ The token returned by a previous call to indicate that there is more data available.
    -> Maybe UTCTime -- ^ The starting date to retrieve alarm history.
    -> CloudWatch m ([AlarmHistory], Maybe Text)
describeAlarmHistory alarm endDate type_ maxRecords nextToken startDate =
    cloudWatchQuery "DescribeAlarmHistory" params $
        (,) <$> members "AlarmHistoryItems" sinkAlarmHistory <*> getT "NextToken"
  where
    params =
        [ "AlarmName" |=? alarm
        , "EndDate" |=? timeToText <$> endDate
        , "HistoryItemType" |=? stringifyHistoryType <$> type_
        , "MaxRecords" |=? toText <$> maxRecords
        , "NextToken" |=? nextToken
        , "StartDate" |=? timeToText <$> startDate
        ]

stringifyHistoryType :: HistoryType -> Text
stringifyHistoryType HistoryTypeConfigurationUpdate = "ConfigurationUpdate"
stringifyHistoryType HistoryTypeStateUpdate = "StateUpdate"
stringifyHistoryType HistoryTypeAction = "Action"

sinkAlarmHistory :: MonadThrow m => Consumer Event m AlarmHistory
sinkAlarmHistory =
    AlarmHistory
    <$> getT "Timestamp"
    <*> getT "HistoryItemType"
    <*> getT "AlarmName"
    <*> getT "HistoryData"
    <*> getT "HistorySummary"

enableAlarmActions
    :: (MonadBaseControl IO m, MonadResource m)
    => [Text] -- ^ The names of the alarms to enable actions for.
    -> CloudWatch m ()
enableAlarmActions alarms =
    cloudWatchQuery "EnableAlarmActions" ["AlarmNames.member" |.#= alarms] $ return ()

disableAlarmActions
    :: (MonadBaseControl IO m, MonadResource m)
    => [Text] -- ^ The names of the alarms to enable actions for.
    -> CloudWatch m ()
disableAlarmActions alarms =
    cloudWatchQuery "DisableAlarmActions" ["AlarmNames.member" |.#= alarms] $ return ()

setAlarmState
    :: (MonadBaseControl IO m, MonadResource m)
    => Text -- ^ The name for the alarm.
    -> Text -- ^ The reason that this alarm is set to this specific state (in human-readable text format)
    -> Text -- ^ The reason that this alarm is set to this specific state (in machine-readable JSON format)
    -> StateValue -- ^ The value of the state.
    -> CloudWatch m ()
setAlarmState alarm reason dat state =
    cloudWatchQuery "SetAlarmState" params $ return ()
  where
    params =
        [ "AlarmName" |= alarm
        , "StateReason" |= reason
        , "StateReasonData" |= dat
        , "StateValue" |= stringifyStateValue state
        ]


text:
- Fail if orientation event is relative
- Use absolute device orientation event if available

## 2.0.0

- Require node 6
- Switch to eslint and update to ES6
- Update Sinon to v5
- Use Studio Changes for releases
- Fix orientation for newer Safari versions
- Pass `--allow-chrome-as-root` to mochify on travis
- Update node versions in travis config
- Upgrade mochify and ajust tests

## 1.0.3

- Don't require alpha to be an own property of the event

## 1.0.2

- Invert alpha and don't emit undefined or null values

## 1.0.1

- Don't modify message of error since browsers might consider it readonly

## 1.0.0

- Initial release


text:
package integration

import (
	"io"
	"testing"

	"github.com/hyperhq/hyperd/lib/promise"
	"github.com/hyperhq/hyperd/types"
	. "gopkg.in/check.v1"
)

const (
	server = "127.0.0.1:22318"
)

// Hook up gocheck into the "go test" runner.
func Test(t *testing.T) { TestingT(t) }

type TestSuite struct {
	client *HyperClient
}

var _ = Suite(&TestSuite{})

func (s *TestSuite) SetUpSuite(c *C) {
	cl, err := NewHyperClient(server)
	c.Assert(err, IsNil)
	if err != nil {
		c.Skip("hyperd is down")
	}
	s.client = cl
}

func (s *TestSuite) TestGetPodList(c *C) {
	podList, err := s.client.GetPodList()
	c.Assert(err, IsNil)
	c.Logf("Got PodList %v", podList)
}

func (s *TestSuite) TestGetVMList(c *C) {
	vmList, err := s.client.GetVMList()
	c.Assert(err, IsNil)
	c.Logf("Got VMList %v", vmList)
}

func (s *TestSuite) TestGetContainerList(c *C) {
	containerList, err := s.client.GetContainerList()
	c.Assert(err, IsNil)
	c.Logf("Got ContainerList %v", containerList)
}

func (s *TestSuite) TestGetImageList(c *C) {
	imageList, err := s.client.GetImageList()
	c.Assert(err, IsNil)
	c.Logf("Got ImageList %v", imageList)
}

func (s *TestSuite) TestGetContainerInfo(c *C) {
	containerList, err := s.client.GetContainerList()
	c.Assert(err, IsNil)
	c.Logf("Got ContainerList %v", containerList)

	if len(containerList) == 0 {
		return
	}

	info, err := s.client.GetContainerInfo(containerList[0].ContainerID)
	c.Assert(err, IsNil)
	c.Logf("Got ContainerInfo %v", info)
}

func (s *TestSuite) TestGetContainerLogs(c *C) {
	containerList, err := s.client.GetContainerList()
	c.Assert(err, IsNil)
	c.Logf("Got ContainerList %v", containerList)

	if len(containerList) == 0 {
		return
	}

	logs, err := s.client.GetContainerLogs(containerList[0].ContainerID)
	c.Assert(err, IsNil)
	c.Logf("Got ContainerLogs %v", logs)
}

func (s *TestSuite) TestPostAttach(c *C) {
	err := s.client.PullImage("hyperhq/busybox", "latest", nil)
	c.Assert(err, IsNil)

	spec := types.UserPod{
		Containers: []*types.UserContainer{
			{
				Image: "hyperhq/busybox",
			},
		},
	}

	pod, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)
	c.Logf("Pod created: %s", pod)
	defer s.client.RemovePod(pod)

	err = s.client.StartPod(pod)
	c.Assert(err, IsNil)

	podInfo, err := s.client.GetPodInfo(pod)
	c.Assert(err, IsNil)

	err = s.client.PostAttach(podInfo.Status.ContainerStatus[0].ContainerID, false)
	c.Assert(err, IsNil)
}

func (s *TestSuite) TestGetPodInfo(c *C) {
	podList, err := s.client.GetPodList()
	c.Assert(err, IsNil)
	c.Logf("Got PodList %v", podList)

	if len(podList) == 0 {
		return
	}

	info, err := s.client.GetPodInfo(podList[0].PodID)
	c.Assert(err, IsNil)
	c.Logf("Got PodInfo %v", info)
}

func (s *TestSuite) TestCreateAndStartPod(c *C) {
	err := s.client.PullImage("busybox", "latest", nil)
	c.Assert(err, IsNil)

	spec := types.UserPod{
		Id: "busybox",
		Containers: []*types.UserContainer{
			{
				Image: "hyperhq/busybox",
			},
		},
	}

	pod, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)
	c.Logf("Pod created: %s", pod)

	podList, err := s.client.GetPodList()
	c.Assert(err, IsNil)
	c.Logf("Got PodList %v", podList)

	var found = false
	for _, p := range podList {
		if p.PodID == pod {
			found = true
			break
		}
	}
	if !found {
		c.Errorf("Can't found pod %s", pod)
	}

	err = s.client.StartPod(pod)
	c.Assert(err, IsNil)

	podInfo, err := s.client.GetPodInfo(pod)
	c.Assert(err, IsNil)
	c.Assert(podInfo.Status.Phase, Equals, "Running")

	err = s.client.RemovePod(pod)
	c.Assert(err, IsNil)
}

func (s *TestSuite) TestCreateContainer(c *C) {
	err := s.client.PullImage("hyperhq/busybox", "latest", nil)
	c.Assert(err, IsNil)

	spec := types.UserPod{}
	pod, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)
	c.Logf("Pod created: %s", pod)

	container, err := s.client.CreateContainer(pod, &types.UserContainer{
		Image: "hyperhq/busybox",
	})
	c.Assert(err, IsNil)
	c.Logf("Container created: %s", container)

	info, err := s.client.GetContainerInfo(container)
	c.Assert(err, IsNil)
	c.Assert(info.PodID, Equals, pod)

	err = s.client.RemovePod(pod)
	c.Assert(err, IsNil)
}

func (s *TestSuite) TestRenameContainer(c *C) {
	err := s.client.PullImage("hyperhq/busybox", "latest", nil)
	c.Assert(err, IsNil)

	spec := types.UserPod{}
	pod, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)
	c.Logf("Pod created: %s", pod)

	container, err := s.client.CreateContainer(pod, &types.UserContainer{
		Image: "hyperhq/busybox",
	})
	c.Assert(err, IsNil)
	c.Logf("Container created: %s", container)

	info, err := s.client.GetContainerInfo(container)
	c.Assert(err, IsNil)

	oldName := info.Container.Name[1:]
	newName := "busybox0123456789"
	err = s.client.RenameContainer(oldName, newName)
	c.Assert(err, IsNil)

	info, err = s.client.GetContainerInfo(container)
	c.Assert(err, IsNil)
	c.Assert(info.Container.Name[1:], Equals, newName)

	err = s.client.RemovePod(pod)
	c.Assert(err, IsNil)
}

func (s *TestSuite) TestPullImage(c *C) {
	err := s.client.PullImage("alpine", "latest", nil)
	c.Assert(err, IsNil)

	list, err := s.client.GetImageList()
	c.Assert(err, IsNil)
	found := false
	for _, img := range list {
		for _, repo := range img.RepoTags {
			if repo == "alpine:latest" {
				found = true
				break
			}
		}
	}
	c.Assert(found, Equals, true)

	err = s.client.RemoveImage("alpine")
	c.Assert(err, IsNil)
	list, err = s.client.GetImageList()
	c.Assert(err, IsNil)

	found = false
	for _, img := range list {
		for _, repo := range img.RepoTags {
			if repo == "alpine:latest" {
				found = true
				break
			}
		}
	}
	c.Assert(found, Equals, false)
}

func (s *TestSuite) TestAddListDeleteService(c *C) {
	spec := types.UserPod{
		Containers: []*types.UserContainer{
			{
				Image:   "hyperhq/busybox",
				Command: []string{"sleep", "10000"},
			},
			{
				Image:   "hyperhq/busybox",
				Command: []string{"sleep", "10000"},
			},
		},
		Services: []*types.UserService{
			{
				ServiceIP:   "10.10.0.24",
				ServicePort: 2834,
				Protocol:    "TCP",
				Hosts: []*types.UserServiceBackend{
					{
						HostIP:   "127.0.0.1",
						HostPort: 2345,
					},
				},
			},
		},
	}

	c.Log("begin ===> create pod")

	pod, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)

	// clear the test pod
	defer func() {
		err = s.client.RemovePod(pod)
		c.Assert(err, IsNil)
	}()

	c.Log("    2 ===> create pod")

	err = s.client.StartPod(pod)
	c.Assert(err, IsNil)

	updateService := []*types.UserService{
		{
			ServiceIP:   "10.10.0.100",
			ServicePort: 80,
			Protocol:    "TCP",
			Hosts: []*types.UserServiceBackend{
				{
					HostIP:   "192.168.23.2",
					HostPort: 8080,
				},
			},
		},
	}

	c.Log("    3 ===> update service")
	err = s.client.UpdateService(pod, updateService)
	c.Assert(err, IsNil)

	c.Log("    4 ===> list service")
	svcList, err := s.client.ListService(pod)
	c.Assert(err, IsNil)
	c.Assert(len(svcList), Equals, 1)
	c.Assert(svcList[0].ServiceIP, Equals, "10.10.0.100")

	addService := []*types.UserService{
		{
			ServiceIP:   "10.10.0.22",
			ServicePort: 80,
			Protocol:    "TCP",
			Hosts: []*types.UserServiceBackend{
				{
					HostIP:   "192.168.23.2",
					HostPort: 8080,
				},
			},
		},
	}

	c.Log("    5 ===> add service")
	err = s.client.AddService(pod, addService)
	c.Assert(err, IsNil)
	c.Log("    6 ===> list service")
	svcList, err = s.client.ListService(pod)
	c.Assert(err, IsNil)
	c.Assert(len(svcList), Equals, 2)

	c.Log("    7 ===> delete service")
	err = s.client.DeleteService(pod, addService)
	c.Assert(err, IsNil)
	c.Log("    8 ===> list service")
	svcList, err = s.client.ListService(pod)
	c.Assert(len(svcList), Equals, 1)
	c.Log("last  ===> done")
}

func (s *TestSuite) TestStartAndStopPod(c *C) {
	spec := types.UserPod{
		Id: "busybox",
		Containers: []*types.UserContainer{
			{
				Image: "hyperhq/busybox",
			},
		},
	}

	pod, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)
	c.Logf("Pod created: %s", pod)

	err = s.client.StartPod(pod)
	c.Assert(err, IsNil)

	podInfo, err := s.client.GetPodInfo(pod)
	c.Assert(err, IsNil)
	c.Assert(podInfo.Status.Phase, Equals, "Running")

	_, _, err = s.client.StopPod(pod)
	c.Assert(err, IsNil)

	podInfo, err = s.client.GetPodInfo(pod)
	c.Assert(err, IsNil)

	err = s.client.RemovePod(pod)
	c.Assert(err, IsNil)

	c.Assert(podInfo.Status.Phase, Equals, "Failed")
}

func (s *TestSuite) TestSetPodLabels(c *C) {
	spec := types.UserPod{
		Id: "busybox",
		Containers: []*types.UserContainer{
			{
				Image: "hyperhq/busybox",
			},
		},
	}

	podID, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)
	c.Logf("Pod created: %s", podID)

	err = s.client.SetPodLabels(podID, true, map[string]string{"foo": "bar"})
	c.Assert(err, IsNil)

	info, err := s.client.GetPodInfo(podID)
	c.Assert(err, IsNil)

	if value, ok := info.Spec.Labels["foo"]; !ok || value != "bar" {
		c.Errorf("Expect labels: %v, but got: %v", map[string]string{"foo": "bar"}, info.Spec.Labels)
	}

	err = s.client.RemovePod(podID)
	c.Assert(err, IsNil)
}

func (s *TestSuite) TestPauseAndUnpausePod(c *C) {
	spec := types.UserPod{
		Id: "busybox",
		Containers: []*types.UserContainer{
			{
				Image: "hyperhq/busybox",
			},
		},
	}

	pod, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)
	c.Logf("Pod created: %s", pod)

	err = s.client.StartPod(pod)
	c.Assert(err, IsNil)

	podInfo, err := s.client.GetPodInfo(pod)
	c.Assert(err, IsNil)
	c.Assert(podInfo.Status.Phase, Equals, "Running")

	err = s.client.PausePod(pod)
	c.Assert(err, IsNil)

	podInfo, err = s.client.GetPodInfo(pod)
	c.Assert(err, IsNil)
	c.Assert(podInfo.Status.Phase, Equals, "Paused")

	err = s.client.UnpausePod(pod)
	c.Assert(err, IsNil)

	podInfo, err = s.client.GetPodInfo(pod)
	c.Assert(err, IsNil)
	c.Assert(podInfo.Status.Phase, Equals, "Running")

	err = s.client.RemovePod(pod)
	c.Assert(err, IsNil)
}

func (s *TestSuite) TestGetPodStats(c *C) {
	info, err := s.client.Info()
	c.Assert(err, IsNil)

	// pod stats only working for libvirt.
	if info.ExecutionDriver != "libvirt" {
		c.Skip("Pod stats test is skipped because execdriver is not libvirt")
	}

	spec := types.UserPod{
		Id: "busybox",
		Containers: []*types.UserContainer{
			{
				Image: "hyperhq/busybox",
			},
		},
	}
	podID, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)

	defer func() {
		err = s.client.RemovePod(podID)
		c.Assert(err, IsNil)
	}()

	err = s.client.StartPod(podID)
	c.Assert(err, IsNil)

	stats, err := s.client.GetPodStats(podID)
	c.Assert(err, IsNil)
	c.Logf("Got Pod Stats %+v", stats)
	c.Assert(stats.Cpu, NotNil)
	c.Assert(stats.Timestamp, NotNil)
}

func (s *TestSuite) TestPing(c *C) {
	resp, err := s.client.Ping()
	c.Assert(err, IsNil)
	c.Logf("Got HyperdStats %v", resp)
}

func (s *TestSuite) TestSendContainerSignal(c *C) {
	sigKill := int64(9)
	spec := types.UserPod{
		Id: "busybox",
	}

	pod, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)
	c.Logf("Pod created: %s", pod)

	defer func() {
		err = s.client.RemovePod(pod)
		c.Assert(err, IsNil)
	}()

	container, err := s.client.CreateContainer(pod, &types.UserContainer{Image: "hyperhq/busybox"})
	c.Assert(err, IsNil)
	c.Logf("Container created: %s", container)

	err = s.client.StartPod(pod)
	c.Assert(err, IsNil)

	containerInfo, err := s.client.GetContainerInfo(container)
	c.Assert(err, IsNil)
	c.Assert(containerInfo.Status.Phase, Equals, "running")

	err = s.client.ContainerSignal(pod, container, sigKill)
	c.Assert(err, IsNil)

	exitCode, err := s.client.Wait(container, "", false)
	c.Assert(err, IsNil)
	c.Assert(exitCode, Equals, int32(137))

	containerInfo, err = s.client.GetContainerInfo(container)
	c.Assert(err, IsNil)
	c.Assert(containerInfo.Status.Phase, Equals, "failed")
}

func (s *TestSuite) TestSendExecSignal(c *C) {
	sigKill := int64(9)
	cName := "test-exec-signal"
	spec := types.UserPod{
		Id: "busybox",
		Containers: []*types.UserContainer{
			{
				Name:  cName,
				Image: "hyperhq/busybox",
			},
		},
	}
	podID, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)

	defer func() {
		err = s.client.RemovePod(podID)
		c.Assert(err, IsNil)
	}()

	err = s.client.StartPod(podID)
	c.Assert(err, IsNil)

	execId, err := s.client.ContainerExecCreate(cName, []string{"sh", "-c", "top"}, false)
	c.Assert(err, IsNil)

	outReader, outWriter := io.Pipe()
	errC := promise.Go(func() error {
		return s.client.ContainerExecStart(cName, execId, nil, outWriter, nil, false)
	})

	// make sure process has been started.
	readC := make(chan struct{})
	go func() {
		buf := make([]byte, 32)
		for {
			n, err := outReader.Read(buf)
			if err == nil && n > 0 {
				readC <- struct{}{}
				break
			} else if err != nil && err != io.EOF {
				errC <- err
				break
			}
		}
	}()

	select {
	case err = <-errC:
		c.Assert(err, IsNil)
	case <-readC:
	}

	err = s.client.ContainerExecSignal(cName, execId, sigKill)
	c.Assert(err, IsNil)

	exitCode, err := s.client.Wait(cName, execId, false)
	c.Assert(err, IsNil)
	c.Assert(exitCode, Equals, int32(0))
}

func (s *TestSuite) TestTTYResize(c *C) {
	cName := "test-tty-resize"
	spec := types.UserPod{
		Id: "busybox",
		Containers: []*types.UserContainer{
			{
				Name:  cName,
				Image: "hyperhq/busybox",
				Tty:   true,
			},
		},
	}
	podID, err := s.client.CreatePod(&spec)
	c.Assert(err, IsNil)

	defer func() {
		err = s.client.RemovePod(podID)
		c.Assert(err, IsNil)
	}()

	err = s.client.StartPod(podID)
	c.Assert(err, IsNil)

	err = s.client.TTYResize(cName, "", 400, 600)
	c.Assert(err, IsNil)

	//TODO: add a user process test when ListProcess is ready.
}


text:
using UnityEngine;
using System.Collections;

public class PowerClockBomb3 : MasterBehaviour
{
	//---------------------------------------------------------------------------------------------------------------
	// Propriedades da Classe

	public GameObject spawnavel = null;

	//---------------------------------------------------------------------------------------------------------------
	// Método do comportamento da Bomba

	public override void Behaviour ()
	{
		Vector2 position = Camera.main.ScreenToWorldPoint (Input.mousePosition);
		RaycastHit2D hit = Physics2D.Raycast (position, Vector2.zero);
		if (hit.collider != null)													// Se atingiu um colisor, sai da função
			return;

		if (!hit) // é estranho, mas com raycast null = true
		{
			GameObject.Instantiate (spawnavel, position, Quaternion.identity);
			MouseManager.masterPower = null;										// Desativa a habilidade no MouseManager
			//PowersManager.UpdateResource(PowersManager.ConstPowerList.ClockBomb1);
		}
	}

	//---------------------------------------------------------------------------------------------------------------
}


text:
//
//  UIToolbar+TKCategory.m
//  Created by Devin Ross on 11/24/10.
//

#import "UIToolbar+TKCategory.h"

@implementation UIToolbar (TKCategory)

- (void) TKdrawRect:(CGRect)rect{

	[UIView drawGradientInRect:rect withColors:[NSArray arrayWithObjects:
												[UIColor colorWithRed:176/255.0 green:188/255.0 blue:204/255.0 alpha:1],
												[UIColor colorWithRed:109/255.0 green:132/255.0 blue:162/255.0 alpha:1],nil]];

	[[UIColor colorWithRed:45/255.0 green:54/255.0 blue:66/255.0 alpha:1] set];
	CGContextFillRect(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, rect.size.width, 1));

	[[UIColor colorWithRed:205/255.0 green:213/255.0 blue:223/255.0 alpha:1] set];
	CGContextFillRect(UIGraphicsGetCurrentContext(), CGRectMake(0, 1, rect.size.width, 1));

}

@end


text:
class MerbMonkey::Main < MerbMonkey::Application
  provides :json

  def index
    render
  end

  def autocomplete
    MerbMonkey.autocomplete(self).to_json
  rescue => e
    p e.message
    e.backtrace.each { |l| p l }
    json_error(e.message)
  end

  def init
    MerbMonkey.init_for_controller(self).to_json
  rescue => e
    p e.message
    e.backtrace.each { |l| p l }
    json_error(e.message)
  end

  def list
    MerbMonkey.list(self).to_json
  rescue => e
    p e.message
    e.backtrace.each { |l| p l }
    json_error(e.message)
  end

  def create
    MerbMonkey.create(self).to_json
  rescue => e
    p e.message
    e.backtrace.each { |l| p l }
    json_error(e.message)
  end

  def update
    MerbMonkey.update(self).to_json
  rescue => e
    p e.message
    e.backtrace.each { |l| p l }
    json_error(e.message)
  end

  def update_all
    MerbMonkey.update_all(self).to_json
  rescue => e
    p e.message
    e.backtrace.each { |l| p l }
    json_error(e.message)
  end

  def delete
    MerbMonkey.delete(self).to_json
  rescue => e
    p e.message
    e.backtrace.each { |l| p l }
    json_error(e.message)
  end

  def delete_all
    MerbMonkey.delete_all(self).to_json
  rescue => e
    p e.message
    e.backtrace.each { |l| p l }
    json_error(e.message)
  end

  def excel
    MerbMonkey.excel(self)
  rescue => e
    p e.message
    e.backtrace.each { |l| p l }
    json_error(e.message)
  end

  def upload
    MerbMonkey.upload(self).to_json
  rescue => e
    p e.message
    e.backtrace.each { |l| p l }
    json_error(e.message)
  end

  private
  def model_name_and_class
    model_name = MerbMonkey.models.each { |name, model| break name if name == params[:model] }
    [model_name, MerbMonkey.const_get(model_name)]
  end

  def json_error(msg)
    { :error => msg }.to_json.gsub("null", "\"\"")
  end

end


text:
@interface _DDVariableExpression : DDExpression {

	NSString * variable;
}

- (id) initWithVariable:(NSString *)v;

@end


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S15.11.4.3_A2;
 * @section: 15.11.4.3, 16;
 * @assertion: The initial value of Error.prototype.message is "";
 * @description: Checking value of Error.prototype.message;
*/

//////////////////////////////////////////////////////////////////////////////
// CHECK#1
if (Error.prototype.message!=="") {
	$ERROR('#1: Error.prototype.message==="". Actual: '+Error.prototype.message);
}
//
//////////////////////////////////////////////////////////////////////////////


text:
console.log ("hello 3.3");
export default = function methodInFoo3_3() { console.log ("yuh huh"); }
export function internalMethodInFoo3_3() { console.log ("nuh uh"); }


text:
#ifndef _IAS_QS_Lang_DB_ModuleProxy_H_
#define _IAS_QS_Lang_DB_ModuleProxy_H_

#include <lang/interpreter/extern/ModuleProxy.h>

namespace IAS {
namespace QS {
namespace Lang {
namespace DB {

/*************************************************************************/
/** The ModuleProxy class.
 *
 */
class ModuleProxy : public ::IAS::Lang::Interpreter::Extern::ModuleProxy {
public:

	virtual ~ModuleProxy() throw();

	static ModuleProxy* Create();

protected:
	ModuleProxy();

	virtual void setupImpl();
	virtual void cleanUpImpl();
	friend class ::IAS::Factory<ModuleProxy>;
};
/*************************************************************************/
}
}
}
}

/*************************************************************************/
extern "C"{
void* ias_qs_lang_db_proxy();
}
/*************************************************************************/
#endif /* _IAS_QS_Lang_DB_ModuleProxy_H_ */


text:
package testclasses;

import de.unifreiburg.cs.proglang.jgs.support.DynamicLabel;

/**
 * Class to test the basics of NSU policy
 * @author Nicolas Müller
 *
 */
public class NSUPolicy {

	public static void main(String[] args) {
		int y = 5;
		int secret = 42;

		//y = DynamicLabel.makeLow(5);		// just for clarity
		secret = DynamicLabel.makeHigh(5);

		if (secret > 0) {
			y += 1;						// NSU IFCError, Illegal
										// flow to int_i0
		}

		/**
		 * This is necessary, because otherwise the compiler will just
		 * throw away the updates of y inside the if, which will circumvent the
		 * IFCError
		 */
		@SuppressWarnings("unused")
		int x = 3 + y;

	}

}


text:
package com.plugin.commons.ui.askgov;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.Toast;

import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnLastItemVisibleListener;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.plugin.R;
import com.plugin.commons.CoreContants;
import com.plugin.commons.adapter.AskHotListAdapter;
import com.plugin.commons.helper.ComUtil;
import com.plugin.commons.helper.DialogUtil;
import com.plugin.commons.helper.DingLog;
import com.plugin.commons.helper.SituoHttpAjax;
import com.plugin.commons.helper.SituoHttpAjax.SituoAjaxCallBack;
import com.plugin.commons.model.AskMsgModel;
import com.plugin.commons.model.RspResultModel;
import com.plugin.commons.service.AskGovService;
import com.plugin.commons.service.AskGovServiceImpl;
import com.zq.types.StBaseType;

public class AskTrendsFragment extends Fragment {
	public DingLog log = new DingLog(AskTrendsFragment.class);
	private static final String TAG = "AskTrendsFragment";
	private Activity mActivity;
	private String mMsgName;
	private PullToRefreshListView lv_news;
	private List<AskMsgModel> dataList = new ArrayList<AskMsgModel>();
	private AskHotListAdapter mAdapter;
	AskGovService askSvc;
	boolean hasLoad ;

	public void setMsgName(String msgName) {
		this.mMsgName = msgName;
	}

	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		this.mActivity = activity;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.listview_pullrefresh, container, false);
		this.mActivity = this.getActivity();
		askSvc = new AskGovServiceImpl();
		return view;
	}

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		log.info("onViewCreated");
		initViews(view);
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		log.info("onActivityCreated");
	}

	@Override
	 public void onHiddenChanged(boolean hidden) {
	       super.onHiddenChanged(hidden);
	       if (!hidden&&!hasLoad) {//如果显示,并且没有加载过,则加载数据
	    	    initDisplay();
	   			hasLoad = true;
	   			doRefresh(true);
	       }
	}

	private void initViews(View view) {
		lv_news = (PullToRefreshListView) view.findViewById(R.id.lv_news);
		mAdapter = new AskHotListAdapter(mActivity,dataList);
		lv_news.setAdapter(mAdapter);
		lv_news.setOnRefreshListener(new OnRefreshListener<ListView>() {
			@Override
			public void onRefresh(PullToRefreshBase<ListView> refreshView) {
				String label = DateUtils.formatDateTime(mActivity, System.currentTimeMillis(),
						DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL);

				// Update the LastUpdatedLabel
				refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(label);
				doRefresh(false);
			}
		});

		lv_news.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {

			@Override
			public void onLastItemVisible() {
				Toast.makeText(mActivity, "已无更多加载", Toast.LENGTH_SHORT).show();
			}
		});
		lv_news.setOnItemClickListener(new OnItemClickListener(){

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(mActivity,AskDetailActivity.class);
				intent.putExtra(CoreContants.PARAMS_MSG,dataList.get(arg2-1));
				mActivity.startActivity(intent);
			}

		});

	}

	private void initDisplay() {
		//mMsgTv.setText("暂无新闻");
		RspResultModel rsp  = askSvc.getAskList(true, "0", "20","0");
		if(rsp!=null&&rsp.getMsg_list()!=null){
			dataList = rsp.getMsg_list();
		}

		mAdapter.setDataList(dataList);
		lv_news.setAdapter(mAdapter);
		mAdapter.notifyDataSetChanged();
		//doRefresh();
		//lv_news.setRefreshing(false);
	}

	private void doRefresh(boolean show)
	{
		// Do work to refresh the list here.
		if(show){
			lv_news.setRefreshing(false);
		}
		SituoHttpAjax.ajax(new SituoAjaxCallBack(){
			@Override
			public StBaseType requestApi() {
				RspResultModel rsp  = askSvc.getAskList(false, "0", "20","0");
				return rsp;
			}

			@Override
			public void callBack(StBaseType baseType) {
				log.info("返回...");
				DialogUtil.closeProgress(mActivity);
				RspResultModel result = (RspResultModel)baseType;
				if(ComUtil.checkRsp(mActivity, result)){
					dataList = result.getMsg_list();
					mAdapter.setDataList(dataList);
				}
				mAdapter.notifyDataSetChanged();
				lv_news.onRefreshComplete();
			}

		});

	}

}