text:
#pragma once

#include "PolyLogger.h"
#include "PolyGlobals.h"
#include "PolyString.h"

#ifdef _WINDOWS
	#include <windows.h>
#else
	#include <dirent.h>
	#include <sys/types.h>
	#include <sys/stat.h>
#endif

#include <vector>
#include <string>
#include "physfs.h"

using namespace std;
using namespace Polycode;

class _PolyExport OSFileEntry {
	public:
		OSFileEntry() {};
		OSFileEntry(String path, String name, int type);

		String name;
		String extension;
		String nameWithoutExtension;
		String basePath;
		String fullPath;
		int type;

		static const int TYPE_FILE = 0;
		static const int TYPE_FOLDER = 1;
};

class _PolyExport OSFILE {
public:
	OSFILE(){}

	void debugDump();

	int fileType;
	FILE *file;
	PHYSFS_file *physFSFile;
	static const int TYPE_FILE = 0;
	static const int TYPE_ARCHIVE_FILE = 1;
};

class _PolyExport OSBasics {
	public:

		static OSFILE *open(String filename, String opts);
		static int close(OSFILE *file);
		static size_t read( void * ptr, size_t size, size_t count, OSFILE * stream );
		static size_t write( const void * ptr, size_t size, size_t count, OSFILE * stream );
		static int seek(OSFILE * stream, long int offset, int origin );
		static long tell(OSFILE * stream);

		static vector<OSFileEntry> parsePhysFSFolder(String pathString, bool showHidden);
		static vector<OSFileEntry> parseFolder(String pathString, bool showHidden);
		static bool isFolder(String pathString);
		static void createFolder(String pathString);
		static void removeItem(String pathString);

	private:

};

redpajama_set_name: RedPajamaGithub


text:
klout_key = "your_klout_api_key"

from encodings import hex_codec
from encodings import ascii
import httplib,urllib2
import json
import sys
import get_twitter_details

def print_stuff(klout_score):
	name,friends_count,followers_count,ff_ratio,created_at = get_twitter_details.get_details(twitter_handle)

	print "%s:\r\r" % (name)
	print "Follows: %s \r" % (friends_count)
	print "Followers: %s  \r\r--\r\r" % (followers_count)
	print "Klout Score: %s \r" % (klout_score)
	print "Follow vs Followers Ratio: %s \r\r" % (ff_ratio)
	print "Joined Twitter on: %s" % (created_at).strftime('%a, %d %h %Y')

#getting user input
if len(sys.argv) < 2:
    sys.exit(2) #if no argument is provided, exit the program

#Assigning the user input to a variable twitter_handle
twitter_handle = sys.argv[1]

try:
	#Accessing Klout API to get the Klout ID using the Twitter handle
	url = "http://api.klout.com/v2/identity.json/twitter?screenName=%s&key=%s" % (twitter_handle, klout_key)
	json = urllib2.urlopen(url).read()

	# convert to a native python object
	(true,false,null) = (True,False,None)

	#Parsing the json payload
	klout_id_data = eval(json)

	#Retrieving klout_id from the payload
	klout_id = klout_id_data ['id']

	#Accessing Klout API to get the Klout score using the KloutID
	url = "http://api.klout.com/v2/user.json/%s?key=%s" % (klout_id, klout_key)
	json = urllib2.urlopen(url).read()

	# convert to a native python object
	(true,false,null) = (True,False,None)
	klout_score_data = eval(json)

	#Retrieving klout_id from the payload
	klout_score = klout_score_data ['score']['score']

	klout_score = str(round(klout_score))
	print_stuff(klout_score)

except urllib2.URLError, e:
    if hasattr(e, 'reason'):
        print 'We failed to reach a server.\r'
        print 'Reason: ', e.reason
    elif hasattr(e, 'code'):
        print 'Sorry! Looks like Klout doesn\'t have info on that soldier!\r'
        print 'Error code: ', e.code


text:
package cockroach

import (
	"encoding/json"
	"fmt"

	"github.com/jmoiron/sqlx"
	_ "github.com/lib/pq"

	"github.com/go-kit/kit/log"
	"github.com/go-kit/kit/log/level"

	"github.com/yiv/yivgame/usercenter/center"
)

const (
	DefalutCoins int64 = 100000
	DefaultGems  int32 = 500
)

type DbRepo struct {
	Conn   *sqlx.DB
	logger log.Logger
}

func NewDbUserRepo(dataSourceName string, logger log.Logger) (center.DBRepository, error) {
	conn, err := sqlx.Open("postgres", dataSourceName)
	if err != nil {
		return nil, err
	}
	dbRepo := new(DbRepo)
	dbRepo.Conn = conn
	dbRepo.logger = logger
	return dbRepo, nil
}

func (repo *DbRepo) FindUserById(uid int64) (user *center.User, err error) {
	user = new(center.User)
	err = repo.Conn.Get(user, "select accounts.id,accounts.uid, accounts.unionid, accounts.uuid , "+
		"accounts.username, accounts.password, accounts.nick, accounts.gender, accounts.addr , accounts.avatar, "+
		"accounts.isguest, accounts.condays, accounts.signdate, accounts.vipsigndate ,accounts.status, accounts.mtime, "+
		"accounts.ctime, accounts.bankpwd , accounts.forbid, accounts.imsi, accounts.imei, accounts.mac, "+
		"accounts.did , accounts.psystem, accounts.pmodel, account_info.coin, account_info.gem, account_info.bank, "+
		"account_info.growth, account_info.level,account_info.viptype, account_info.vipexpiry,account_info.voucher, account_info.token,"+
		"account_info.online from accounts inner join account_info on accounts.uid = account_info.accounts_uid "+
		"where accounts.uid = $1", uid)
	if err != nil {
		level.Error(repo.logger).Log("err", err.Error(), "uid", uid)
		return nil, err
	}
	type StringField struct {
		Others  string
		Props   string
		Gifts   string
		Friends string
		Records string
		Tags    string
		Medals  string
	}
	s := new(StringField)
	err = repo.Conn.Get(s, "select accounts.others,account_info.props,account_info.gifts, account_info.friends, account_info.records, "+
		"account_info.tags,account_info.medals from accounts inner join account_info on accounts.uid = account_info.accounts_uid where accounts.uid= $1", uid)
	if err != nil {
		level.Error(repo.logger).Log("err", err.Error(), "uid", uid)
		return nil, err
	}
	err = json.Unmarshal([]byte(s.Others), &user.Others)
	if err != nil {
		level.Error(repo.logger).Log("err", err.Error(), "Others", s.Others, "msg", "Unmarshal Others")
		return nil, fmt.Errorf("Props json decode err : %s", err.Error())
	}
	err = json.Unmarshal([]byte(s.Props), &user.Props)
	if err != nil {
		level.Error(repo.logger).Log("err", err.Error(), "Props", s.Props, "msg", "Unmarshal Props")
		return nil, fmt.Errorf("Props json decode err : %s", err.Error())
	}
	err = json.Unmarshal([]byte(s.Gifts), &user.Gifts)
	if err != nil {
		level.Error(repo.logger).Log("err", err.Error(), "Gifts", s.Gifts, "msg", "Unmarshal Gifts")
		return nil, fmt.Errorf("Gifts json decode err : %s", err.Error())
	}
	err = json.Unmarshal([]byte(s.Friends), &user.Friends)
	if err != nil {
		level.Error(repo.logger).Log("err", err.Error(), "Friends", s.Friends, "msg", "Unmarshal Friends")
		return nil, fmt.Errorf("Friends json decode err : %s", err.Error())
	}
	err = json.Unmarshal([]byte(s.Records), &user.Records)
	if err != nil {
		level.Error(repo.logger).Log("err", err.Error(), "Records", s.Records, "msg", "Unmarshal Records")
		return nil, fmt.Errorf("Records json decode err : %s", err.Error())
	}
	err = json.Unmarshal([]byte(s.Tags), &user.Tags)
	if err != nil {
		level.Error(repo.logger).Log("err", err.Error(), "Tags", s.Tags, "msg", "Unmarshal Tags")
		return nil, fmt.Errorf("Tags json decode err : %s", err.Error())
	}
	err = json.Unmarshal([]byte(s.Medals), &user.Medals)
	if err != nil {
		level.Error(repo.logger).Log("err", err.Error(), "Medals", s.Medals, "msg", "Unmarshal Medals")
		return nil, fmt.Errorf("Medals json decode err : %s", err.Error())
	}
	return user, nil
}


text:
<?php

namespace frontend\controllers;

use Yii;
use app\models\TravellerHelp;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use \app\models\TravellerDescription;
use app\models\TravellersProfile;

/**
 * TravellerhelpController implements the CRUD actions for TravellerHelp model.
 */
class TravellerhelpController extends Controller {

    public function behaviors() {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all TravellerHelp models.
     * @return mixed
     */
    public function actionIndex() {
        $dataProvider = new ActiveDataProvider([
            'query' => TravellerHelp::find(),
        ]);

        return $this->render('index', [
                    'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single TravellerHelp model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id) {
        return $this->render('view', [
                    'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new TravellerHelp model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate() {
        $model = new TravellerHelp();
        $traveller_id = isset($_GET['traveller_id']) ? $_GET['traveller_id'] : 0;
        $descriptionmodel = TravellerDescription::find()->where(['traveller_id' => $traveller_id])->one();
        $profilemodel = TravellersProfile::find()->where(['traveller_id' => $traveller_id])->one();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            if (count($profilemodel) > 0) {
                return $this->redirect(['travellersprofile/update', 'id' => $profilemodel->id]);
            } else {
                return $this->redirect(['travellersprofile/create', 'traveller_id' => $model->traveller_id]);
            }
        } else {
            return $this->render('create', [
                        'model' => $model,
                        'traveller_id' => $traveller_id,
                        'descriptionmodel' => $descriptionmodel,
                        'profilemodel' => $profilemodel,
            ]);
        }
    }

    /**
     * Updates an existing TravellerHelp model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id) {
        $model = $this->findModel($id);
        $descriptionmodel = TravellerDescription::find()->where(['traveller_id' => $model->traveller_id])->one();
        $profilemodel = TravellersProfile::find()->where(['traveller_id' => $model->traveller_id])->one();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            if (count($profilemodel) > 0) {
                return $this->redirect(['travellersprofile/update', 'id' => $profilemodel->id]);
            } else {
                return $this->redirect(['travellersprofile/create', 'traveller_id' => $model->traveller_id]);
            }
        } else {
            return $this->render('update', [
                        'model' => $model,
                        'traveller_id' => $model->traveller_id,
                        'descriptionmodel' => $descriptionmodel,
                        'profilemodel' => $profilemodel,
            ]);
        }
    }

    /**
     * Deletes an existing TravellerHelp model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id) {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the TravellerHelp model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return TravellerHelp the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id) {
        if (($model = TravellerHelp::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

}


text:
define([
  'lib/glMatrix',
  'misc/Utils',
  'math3d/Geometry',
  'editor/tools/SculptBase',
  'editor/tools/Rotate'
], function (glm, Utils, Geometry, SculptBase, Rotate) {

  'use strict';

  var vec3 = glm.vec3;
  var mat4 = glm.mat4;

  var Scale = function (main) {
    SculptBase.call(this, main);
    this._matrixInv = mat4.create();
    this._preTranslate = mat4.create();
    this._postTranslate = mat4.create();
    this._refMX = 0.0;
    this._refMY = 0.0;
  };

  Scale.prototype = {
    end: Rotate.prototype.endTransform,
    applyEditMatrix: Rotate.prototype.applyEditMatrix,
    startSculpt: (function () {
      var tmp = [0.0, 0.0, 0.0];
      return function () {
        var matrix = this._mesh.getMatrix();
        mat4.invert(this._matrixInv, matrix);
        vec3.transformMat4(tmp, this._mesh.getCenter(), matrix);
        mat4.translate(this._preTranslate, mat4.identity(this._preTranslate), tmp);
        mat4.translate(this._postTranslate, mat4.identity(this._postTranslate), vec3.negate(tmp, tmp));

        var main = this._main;
        this._refMX = main._mouseX;
        this._refMY = main._mouseY;
      };
    })(),
    update: (function () {
      var tmp = [0.0, 0.0, 0.0];
      return function () {
        var main = this._main;
        tmp[0] = tmp[1] = tmp[2] = 1.0 + (main._mouseX - this._refMX + main._mouseY - this._refMY) / 400;
        var mEdit = this._mesh.getEditMatrix();
        mat4.identity(mEdit);
        mat4.scale(mEdit, mEdit, tmp);

        mat4.mul(mEdit, this._preTranslate, mEdit);
        mat4.mul(mEdit, mEdit, this._postTranslate);

        mat4.mul(mEdit, this._matrixInv, mEdit);
        mat4.mul(mEdit, mEdit, this._mesh.getMatrix());

        main.render();
        main.getCanvas().style.cursor = 'default';
      };
    })()
  };

  Utils.makeProxy(SculptBase, Scale);

  return Scale;
});


text:
<?php echo Form::open(array("class"=>"form-horizontal")); ?>

	<fieldset>

			<?php echo Form::label('M trap id', 'm_trap_id', array('class'=>'control-label')); ?>

				<?php echo Form::input('m_trap_id', Input::post('m_trap_id', isset($m_trap) ? $m_trap->m_trap_id : ''), array('class' => 'col-md-4 form-control', 'placeholder'=>'M trap id')); ?>

			<?php echo Form::label('Trap type', 'trap_type', array('class'=>'control-label')); ?>

				<?php echo Form::input('trap_type', Input::post('trap_type', isset($m_trap) ? $m_trap->trap_type : ''), array('class' => 'col-md-4 form-control', 'placeholder'=>'Trap type')); ?>

			<?php echo Form::label('Effect rate', 'effect_rate', array('class'=>'control-label')); ?>

				<?php echo Form::input('effect_rate', Input::post('effect_rate', isset($m_trap) ? $m_trap->effect_rate : ''), array('class' => 'col-md-4 form-control', 'placeholder'=>'Effect rate')); ?>

			<?php echo Form::label('Effect val', 'effect_val', array('class'=>'control-label')); ?>

				<?php echo Form::input('effect_val', Input::post('effect_val', isset($m_trap) ? $m_trap->effect_val : ''), array('class' => 'col-md-4 form-control', 'placeholder'=>'Effect val')); ?>

			<?php echo Form::submit('submit', 'Save', array('class' => 'btn btn-primary')); ?>

	</fieldset>
<?php echo Form::close(); ?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
    <type>org.netbeans.modules.j2ee.ejbjarproject</type>
    <configuration>
        <data xmlns="http://www.netbeans.org/ns/j2ee-ejbjarproject/3">
            <name>ejb-money-03</name>
            <minimum-ant-version>1.6.5</minimum-ant-version>
            <included-library dirs="200">reference.algo.jar</included-library>
            <source-roots>
                <root id="src.dir" name="Source Packages"/>
            </source-roots>
            <test-roots>
                <root id="test.src.dir" name="Test Packages"/>
            </test-roots>
        </data>
        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
            <reference>
                <foreign-project>algo</foreign-project>
                <artifact-type>jar</artifact-type>
                <script>build.xml</script>
                <target>jar</target>
                <clean-target>clean</clean-target>
                <id>jar</id>
            </reference>
        </references>
    </configuration>
</project>


text:
/* global expect, jest */

import {
  shallow, mount
} from 'enzyme';
import React from 'react';
import $ from 'jquery';
import {
  EditDocument, mapStateToProps
} from '../../../components/document/EditDocument.jsx';
import client from '../../../utils/client';
import { documents } from '../../__mocks__/helpers/fixtures';

const mockFn = jest.fn();
global.$ = $;
global.jQuery = $;

$.prototype.sideNav = () => {};

global.CKEDITOR = {
  replace: () => {},
  instances:{
    content: {
      getData: () => {}
    }
  }
};

jest.mock('react-router', () => ({
  browserHistory: {
    push(url) {
      mockFn(url);
    }
  }
}));

let wrapper;
const mockSaveEditedDoc = jest.fn(() => {
  return Promise.resolve({
    message: 'update successful'
  });
});

const user = {
  currentUser: {
    id: 1,
    firstName: 'Ifiok',
    lastName: 'Eyo',
    username: 'sage',
    email: 'eyo@gmail.com',
    roleId: 1
  }
};

const category = 'privateDocuments';

client.get = jest.fn((url, param) =>
  Promise.resolve());

describe('<EditDocument />', () => {

  wrapper = shallow(<EditDocument
    document={documents.privateDocuments.rows[0]}
    saveEditedDoc={mockSaveEditedDoc}
    user={user.currentUser}
    category={category}
  />);

  it('renders the required props for the title Input element', () => {
    const title = wrapper.find('#title');
    expect(title.props().value).toEqual(documents.privateDocuments.rows[0].title);
  });

  it('renders the required props for the access Input element', () => {
    const title = wrapper.find('#access');
    expect(title.props().value).toEqual(documents.privateDocuments.rows[0].access);
  });

  it('renders the required props for the content Input element', () => {
    const title = wrapper.find('#content');
    expect(title.props().value).toEqual(documents.privateDocuments.rows[0].content);
  });

  describe('handle click events', () => {

    wrapper = mount(<EditDocument
      document={documents.privateDocuments.rows[0]}
      saveEditedDoc={mockSaveEditedDoc}
      user={user.currentUser}
      category={category}
    />);

    it('calls saveEditedDoc action creator', () => {
      const saveBtn = wrapper.find('.docify-save-edit');

      saveBtn.simulate('click');

      expect(mockSaveEditedDoc).toHaveBeenCalled();
    });

    it('redirects to dashbaord', () => {
      const backBtn = wrapper.find('.btn-flat');

      backBtn.simulate('click');

      expect(mockFn).toHaveBeenCalledWith('/dashboard');
    });

    it('changes the title to the value of the form input element', () => {
      const Input = wrapper.find('#title');

      const mockEvent = {
        target: {
          id: 'title',
          value: 'My new value'
        }
      };

      Input.simulate('change', mockEvent);

      expect(wrapper.state('document').title).toBe(mockEvent.target.value);
    });
  });

  describe('mapStateToProps', () => {
    wrapper = mount(<EditDocument
      document={documents.privateDocuments.rows[0]}
      saveEditedDoc={mockSaveEditedDoc}
      user={user.currentUser}
      category={category}
    />);

    it('should receive the required props from mapStateToProps', () => {
      const { document, id, category, user: currentUser }
      = mapStateToProps({
        documents,
        user
      },
        {
          params: {
            id: 1,
            category: 'privateDocuments'
          }
        });
      expect(document).toMatchObject(documents.privateDocuments.rows[0]);
      expect(id).toBe(1);
      expect(category).toBe('privateDocuments');
      expect(currentUser).toBe(user.currentUser);
    });
  });
});


text:
<!DOCTYPE html>

<title>Vidstan</title>
<meta charset='utf-8'>
   <link type="text/css" rel="stylesheet" href="css/materialize.css"  media="screen,projection"/>

<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0" />

       menu


text:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="UTF-8" indent="yes" />

    <xsl:template match="/">
        <file>
            <xsl:apply-templates />
        </file>
    </xsl:template>

    <xsl:template match="*">
        <xsl:message terminate="no">
            WARNING: Unmatched element: <xsl:value-of select="name()"/>
        </xsl:message>
        <xsl:apply-templates/>
    </xsl:template>

</xsl:stylesheet>


text:
package org.kaaproject.kaa.server.common.dao.impl;

import java.nio.ByteBuffer;
import java.util.List;

import org.kaaproject.kaa.common.dto.EndpointProfileBodyDto;
import org.kaaproject.kaa.common.dto.EndpointProfileDto;
import org.kaaproject.kaa.common.dto.EndpointProfilesBodyDto;
import org.kaaproject.kaa.common.dto.EndpointProfilesPageDto;
import org.kaaproject.kaa.common.dto.PageLinkDto;
import org.kaaproject.kaa.server.common.dao.model.EndpointProfile;

/**
 * The interface Endpoint profile dao.
 *
 * @param <T> the type parameter
 */
public interface EndpointProfileDao<T extends EndpointProfile> extends Dao<T, ByteBuffer> {

    /**
     * Saves the given endpoint profiles.
     *
     * @param dto The endpoint profile to save
     *
     * @return The endpoint profile saved
     */
    T save(EndpointProfileDto dto);

    /**
     * Find endpoint profile by key hash.
     *
     * @param endpointKeyHash the endpoint key hash
     * @return the endpoint profile object
     */
    T findByKeyHash(byte[] endpointKeyHash);

    /**
     * Find endpoint profile by endpoint group id.
     *
     * @param pageLink the page link dto
     * @return the endpoint profiles page dto
     */
    EndpointProfilesPageDto findByEndpointGroupId(PageLinkDto pageLink);

    /**
     * Find endpoint profile body by endpoint group id.
     *
     * @param pageLink the page link dto
     * @return the endpoint profiles page dto
     */
    EndpointProfilesBodyDto findBodyByEndpointGroupId(PageLinkDto pageLink);

    /**
     * Find endpoint profile body by endpoint key hash.
     *
     * @param endpointKeyHash the endpoint key hash
     * @return the endpoint profile body dto
     */
    EndpointProfileBodyDto findBodyByKeyHash(byte[] endpointKeyHash);

    /**
     * Gets the count of endpoint profile by key hash.
     *
     * @param endpointKeyHash the endpoint key hash
     * @return the count of endpoint profile
     */
    T findEndpointIdByKeyHash(byte[] endpointKeyHash);

    /**
     * Remove endpoint profile by key hash.
     *
     * @param endpointKeyHash the endpoint key hash
     */
    void removeByKeyHash(byte[] endpointKeyHash);

    /**
     * This method remove endpoint profile by application id.
     *
     * @param appId application id
     */
    void removeByAppId(String appId);

    /**
     * Find endpoint profile by endpointAccessToken.
     *
     * @param endpointAccessToken the endpoint access token
     * @return the endpoint profile object
     */
    T findByAccessToken(String endpointAccessToken);

    /**
     * Find endpoint profiles by endpoint user id.
     *
     * @param endpointUserId the endpoint user id
     * @return the list of endpoint profiles
     */
    List<T> findByEndpointUserId(String endpointUserId);

    /**
     * Checks whether there are any endpoint profiles with the given SDK token.
     *
     * @param   sdkToken An SDK token
     *
     * @return  true if there is at least one endpoint profile with
     *          the given SDK token, false otherwise
     */
    boolean checkSdkToken(String sdkToken);

    /**
     * Update endpoint profile with given keyHash, server profile schema version and given server profile.
     *
     * @param keyHash       the endpoint profile key hash.
     * @param version      the given server profile schema version.
     * @param serverProfile the given server profile data.
     * @return the updated endpoint profile with.
     */
    T updateServerProfile(byte[] keyHash, int version, String serverProfile);
}


text:
<tool id="evolmap_output_exclude" name="EvolMAP Output Species Exclude">
	<description>Modifies EvolMAP Output to exclude specific species.</description>
	<command interpreter="perl">evolmap_output_exclude.pl $input $speciesList</command>
	<inputs>
		<param name="input" type="data" format="txt" label="EvolMAP Output generated file" />
		<param name="speciesList" type="text" area="true" size="4x25" label="Species to exclude separated by commas with no space -- example: VolvoxCarteriFNagariensis,CoccomyxaSpC169" />
	</inputs>

	<outputs>
		<data from_work_dir="output.txt" format="txt" />
	</outputs>

	<help>
		http://labs.eemb.ucsb.edu/oakley/todd/

		Takes the output file of EvolMAP Output tool as input and deletes the user defined species from this file and is ouputted to a new text file.

		Input format:
			Text (txt)

		Output format:
			Text (txt)
	</help>
</tool>


text:
#pragma checksum "..\..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "93C41AD3FC5CD5514CDF2A97E175F616"
//------------------------------------------------------------------------------
// <auto-generated>
//     Dieser Code wurde von einem Tool generiert.
//     Laufzeitversion:4.0.30319.42000
//
//     Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
//     der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using codeDesc.StyleableWindow;

namespace codeDesc {

    /// <summary>
    /// App
    /// </summary>
    public partial class App : System.Windows.Application {

        private bool _contentLoaded;

        /// <summary>
        /// InitializeComponent
        /// </summary>
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
        public void InitializeComponent() {
            if (_contentLoaded) {
                return;
            }
            _contentLoaded = true;

            #line 5 "..\..\..\App.xaml"
            this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);

            #line default
            #line hidden
            System.Uri resourceLocater = new System.Uri("/codeDesc;component/app.xaml", System.UriKind.Relative);

            #line 1 "..\..\..\App.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }

        /// <summary>
        /// Application Entry Point.
        /// </summary>
        [System.STAThreadAttribute()]
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
        public static void Main() {
            codeDesc.App app = new codeDesc.App();
            app.InitializeComponent();
            app.Run();
        }
    }
}


text:
class FreeSemiringTest : public CppUnit::TestFixture
{
	CPPUNIT_TEST_SUITE(FreeSemiringTest);
        CPPUNIT_TEST(testSemiring);
	CPPUNIT_TEST(testAddition);
	CPPUNIT_TEST(testMultiplication);
	CPPUNIT_TEST(testStar);
	CPPUNIT_TEST_SUITE_END();

public:
	void setUp();
	void tearDown();

protected:
  void testSemiring();
	void testAddition();
	void testMultiplication();
	void testStar();

private:
	FreeSemiring *a, *b, *c;
};

#endif


text:
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'

module Google
  module Apis
    module DeploymentmanagerV2
      # Google Cloud Deployment Manager API
      #
      # Declares, configures, and deploys complex solutions on Google Cloud Platform.
      #
      # @example
      #    require 'google/apis/deploymentmanager_v2'
      #
      #    Deploymentmanager = Google::Apis::DeploymentmanagerV2 # Alias the module
      #    service = Deploymentmanager::DeploymentManagerService.new
      #
      # @see https://cloud.google.com/deployment-manager/
      class DeploymentManagerService < Google::Apis::Core::BaseService
        # @return [String]
        #  API key. Your API key identifies your project and provides you with API access,
        #  quota, and reports. Required unless you provide an OAuth 2.0 token.
        attr_accessor :key

        # @return [String]
        #  Available to use for quota purposes for server-side applications. Can be any
        #  arbitrary string assigned to a user, but should not exceed 40 characters.
        #  Overrides userIp if both are provided.
        attr_accessor :quota_user

        # @return [String]
        #  IP address of the site where the request originates. Use this if you want to
        #  enforce per-user limits.
        attr_accessor :user_ip

        def initialize
          super('https://www.googleapis.com/', 'deploymentmanager/v2/projects/')
          @batch_path = 'batch'
        end

        # Cancels and removes the preview currently associated with the deployment.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] deployment
        #   The name of the deployment for this request.
        # @param [Google::Apis::DeploymentmanagerV2::DeploymentsCancelPreviewRequest] deployments_cancel_preview_request_object
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Operation]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def cancel_deployment_preview(project, deployment, deployments_cancel_preview_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:post, '{project}/global/deployments/{deployment}/cancelPreview', options)
          command.request_representation = Google::Apis::DeploymentmanagerV2::DeploymentsCancelPreviewRequest::Representation
          command.request_object = deployments_cancel_preview_request_object
          command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Operation
          command.params['project'] = project unless project.nil?
          command.params['deployment'] = deployment unless deployment.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Deletes a deployment and all of the resources in the deployment.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] deployment
        #   The name of the deployment for this request.
        # @param [String] delete_policy
        #   Sets the policy to use for deleting resources.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Operation]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def delete_deployment(project, deployment, delete_policy: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:delete, '{project}/global/deployments/{deployment}', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Operation
          command.params['project'] = project unless project.nil?
          command.params['deployment'] = deployment unless deployment.nil?
          command.query['deletePolicy'] = delete_policy unless delete_policy.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Gets information about a specific deployment.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] deployment
        #   The name of the deployment for this request.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Deployment] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Deployment]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def get_deployment(project, deployment, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:get, '{project}/global/deployments/{deployment}', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::Deployment::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Deployment
          command.params['project'] = project unless project.nil?
          command.params['deployment'] = deployment unless deployment.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Gets the access control policy for a resource. May be empty if no such policy
        # or resource exists.
        # @param [String] project
        #   Project ID for this request.
        # @param [String] resource
        #   Name of the resource for this request.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Policy] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Policy]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def get_deployment_iam_policy(project, resource, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:get, '{project}/global/deployments/{resource}/getIamPolicy', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::Policy::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Policy
          command.params['project'] = project unless project.nil?
          command.params['resource'] = resource unless resource.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Creates a deployment and all of the resources described by the deployment
        # manifest.
        # @param [String] project
        #   The project ID for this request.
        # @param [Google::Apis::DeploymentmanagerV2::Deployment] deployment_object
        # @param [Boolean] preview
        #   If set to true, creates a deployment and creates "shell" resources but does
        #   not actually instantiate these resources. This allows you to preview what your
        #   deployment looks like. After previewing a deployment, you can deploy your
        #   resources by making a request with the update() method or you can use the
        #   cancelPreview() method to cancel the preview altogether. Note that the
        #   deployment will still exist after you cancel the preview and you must
        #   separately delete this deployment if you want to remove it.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Operation]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def insert_deployment(project, deployment_object = nil, preview: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:post, '{project}/global/deployments', options)
          command.request_representation = Google::Apis::DeploymentmanagerV2::Deployment::Representation
          command.request_object = deployment_object
          command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Operation
          command.params['project'] = project unless project.nil?
          command.query['preview'] = preview unless preview.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Lists all deployments for a given project.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] filter
        #   Sets a filter expression for filtering listed resources, in the form filter=`
        #   expression`. Your `expression` must be in the format: field_name
        #   comparison_string literal_string.
        #   The field_name is the name of the field you want to compare. Only atomic field
        #   types are supported (string, number, boolean). The comparison_string must be
        #   either eq (equals) or ne (not equals). The literal_string is the string value
        #   to filter to. The literal value must be valid for the type of field you are
        #   filtering by (string, number, boolean). For string fields, the literal value
        #   is interpreted as a regular expression using RE2 syntax. The literal value
        #   must match the entire field.
        #   For example, to filter for instances that do not have a name of example-
        #   instance, you would use filter=name ne example-instance.
        #   You can filter on nested fields. For example, you could filter on instances
        #   that have set the scheduling.automaticRestart field to true. Use filtering on
        #   nested fields to take advantage of labels to organize and search for results
        #   based on label values.
        #   To filter on multiple expressions, provide each separate expression within
        #   parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-
        #   central1-f). Multiple expressions are treated as AND expressions, meaning that
        #   resources must match all expressions to pass the filters.
        # @param [Fixnum] max_results
        #   The maximum number of results per page that should be returned. If the number
        #   of available results is larger than maxResults, Compute Engine returns a
        #   nextPageToken that can be used to get the next page of results in subsequent
        #   list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
        # @param [String] order_by
        #   Sorts list results by a certain order. By default, results are returned in
        #   alphanumerical order based on the resource name.
        #   You can also sort results in descending order based on the creation timestamp
        #   using orderBy="creationTimestamp desc". This sorts results based on the
        #   creationTimestamp field in reverse chronological order (newest result first).
        #   Use this to sort resources like operations so that the newest operation is
        #   returned first.
        #   Currently, only sorting by name or creationTimestamp desc is supported.
        # @param [String] page_token
        #   Specifies a page token to use. Set pageToken to the nextPageToken returned by
        #   a previous list request to get the next page of results.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::ListDeploymentsResponse] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::ListDeploymentsResponse]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def list_deployments(project, filter: nil, max_results: nil, order_by: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:get, '{project}/global/deployments', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::ListDeploymentsResponse::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::ListDeploymentsResponse
          command.params['project'] = project unless project.nil?
          command.query['filter'] = filter unless filter.nil?
          command.query['maxResults'] = max_results unless max_results.nil?
          command.query['orderBy'] = order_by unless order_by.nil?
          command.query['pageToken'] = page_token unless page_token.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Updates a deployment and all of the resources described by the deployment
        # manifest. This method supports patch semantics.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] deployment
        #   The name of the deployment for this request.
        # @param [Google::Apis::DeploymentmanagerV2::Deployment] deployment_object
        # @param [String] create_policy
        #   Sets the policy to use for creating new resources.
        # @param [String] delete_policy
        #   Sets the policy to use for deleting resources.
        # @param [Boolean] preview
        #   If set to true, updates the deployment and creates and updates the "shell"
        #   resources but does not actually alter or instantiate these resources. This
        #   allows you to preview what your deployment will look like. You can use this
        #   intent to preview how an update would affect your deployment. You must provide
        #   a target.config with a configuration if this is set to true. After previewing
        #   a deployment, you can deploy your resources by making a request with the
        #   update() or you can cancelPreview() to remove the preview altogether. Note
        #   that the deployment will still exist after you cancel the preview and you must
        #   separately delete this deployment if you want to remove it.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Operation]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def patch_deployment(project, deployment, deployment_object = nil, create_policy: nil, delete_policy: nil, preview: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:patch, '{project}/global/deployments/{deployment}', options)
          command.request_representation = Google::Apis::DeploymentmanagerV2::Deployment::Representation
          command.request_object = deployment_object
          command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Operation
          command.params['project'] = project unless project.nil?
          command.params['deployment'] = deployment unless deployment.nil?
          command.query['createPolicy'] = create_policy unless create_policy.nil?
          command.query['deletePolicy'] = delete_policy unless delete_policy.nil?
          command.query['preview'] = preview unless preview.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Sets the access control policy on the specified resource. Replaces any
        # existing policy.
        # @param [String] project
        #   Project ID for this request.
        # @param [String] resource
        #   Name of the resource for this request.
        # @param [Google::Apis::DeploymentmanagerV2::Policy] policy_object
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Policy] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Policy]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def set_deployment_iam_policy(project, resource, policy_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:post, '{project}/global/deployments/{resource}/setIamPolicy', options)
          command.request_representation = Google::Apis::DeploymentmanagerV2::Policy::Representation
          command.request_object = policy_object
          command.response_representation = Google::Apis::DeploymentmanagerV2::Policy::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Policy
          command.params['project'] = project unless project.nil?
          command.params['resource'] = resource unless resource.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Stops an ongoing operation. This does not roll back any work that has already
        # been completed, but prevents any new work from being started.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] deployment
        #   The name of the deployment for this request.
        # @param [Google::Apis::DeploymentmanagerV2::DeploymentsStopRequest] deployments_stop_request_object
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Operation]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def stop_deployment(project, deployment, deployments_stop_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:post, '{project}/global/deployments/{deployment}/stop', options)
          command.request_representation = Google::Apis::DeploymentmanagerV2::DeploymentsStopRequest::Representation
          command.request_object = deployments_stop_request_object
          command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Operation
          command.params['project'] = project unless project.nil?
          command.params['deployment'] = deployment unless deployment.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Returns permissions that a caller has on the specified resource.
        # @param [String] project
        #   Project ID for this request.
        # @param [String] resource
        #   Name of the resource for this request.
        # @param [Google::Apis::DeploymentmanagerV2::TestPermissionsRequest] test_permissions_request_object
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::TestPermissionsResponse] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::TestPermissionsResponse]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def test_deployment_iam_permissions(project, resource, test_permissions_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:post, '{project}/global/deployments/{resource}/testIamPermissions', options)
          command.request_representation = Google::Apis::DeploymentmanagerV2::TestPermissionsRequest::Representation
          command.request_object = test_permissions_request_object
          command.response_representation = Google::Apis::DeploymentmanagerV2::TestPermissionsResponse::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::TestPermissionsResponse
          command.params['project'] = project unless project.nil?
          command.params['resource'] = resource unless resource.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Updates a deployment and all of the resources described by the deployment
        # manifest.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] deployment
        #   The name of the deployment for this request.
        # @param [Google::Apis::DeploymentmanagerV2::Deployment] deployment_object
        # @param [String] create_policy
        #   Sets the policy to use for creating new resources.
        # @param [String] delete_policy
        #   Sets the policy to use for deleting resources.
        # @param [Boolean] preview
        #   If set to true, updates the deployment and creates and updates the "shell"
        #   resources but does not actually alter or instantiate these resources. This
        #   allows you to preview what your deployment will look like. You can use this
        #   intent to preview how an update would affect your deployment. You must provide
        #   a target.config with a configuration if this is set to true. After previewing
        #   a deployment, you can deploy your resources by making a request with the
        #   update() or you can cancelPreview() to remove the preview altogether. Note
        #   that the deployment will still exist after you cancel the preview and you must
        #   separately delete this deployment if you want to remove it.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Operation]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def update_deployment(project, deployment, deployment_object = nil, create_policy: nil, delete_policy: nil, preview: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:put, '{project}/global/deployments/{deployment}', options)
          command.request_representation = Google::Apis::DeploymentmanagerV2::Deployment::Representation
          command.request_object = deployment_object
          command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Operation
          command.params['project'] = project unless project.nil?
          command.params['deployment'] = deployment unless deployment.nil?
          command.query['createPolicy'] = create_policy unless create_policy.nil?
          command.query['deletePolicy'] = delete_policy unless delete_policy.nil?
          command.query['preview'] = preview unless preview.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Gets information about a specific manifest.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] deployment
        #   The name of the deployment for this request.
        # @param [String] manifest
        #   The name of the manifest for this request.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Manifest] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Manifest]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def get_manifest(project, deployment, manifest, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:get, '{project}/global/deployments/{deployment}/manifests/{manifest}', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::Manifest::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Manifest
          command.params['project'] = project unless project.nil?
          command.params['deployment'] = deployment unless deployment.nil?
          command.params['manifest'] = manifest unless manifest.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Lists all manifests for a given deployment.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] deployment
        #   The name of the deployment for this request.
        # @param [String] filter
        #   Sets a filter expression for filtering listed resources, in the form filter=`
        #   expression`. Your `expression` must be in the format: field_name
        #   comparison_string literal_string.
        #   The field_name is the name of the field you want to compare. Only atomic field
        #   types are supported (string, number, boolean). The comparison_string must be
        #   either eq (equals) or ne (not equals). The literal_string is the string value
        #   to filter to. The literal value must be valid for the type of field you are
        #   filtering by (string, number, boolean). For string fields, the literal value
        #   is interpreted as a regular expression using RE2 syntax. The literal value
        #   must match the entire field.
        #   For example, to filter for instances that do not have a name of example-
        #   instance, you would use filter=name ne example-instance.
        #   You can filter on nested fields. For example, you could filter on instances
        #   that have set the scheduling.automaticRestart field to true. Use filtering on
        #   nested fields to take advantage of labels to organize and search for results
        #   based on label values.
        #   To filter on multiple expressions, provide each separate expression within
        #   parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-
        #   central1-f). Multiple expressions are treated as AND expressions, meaning that
        #   resources must match all expressions to pass the filters.
        # @param [Fixnum] max_results
        #   The maximum number of results per page that should be returned. If the number
        #   of available results is larger than maxResults, Compute Engine returns a
        #   nextPageToken that can be used to get the next page of results in subsequent
        #   list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
        # @param [String] order_by
        #   Sorts list results by a certain order. By default, results are returned in
        #   alphanumerical order based on the resource name.
        #   You can also sort results in descending order based on the creation timestamp
        #   using orderBy="creationTimestamp desc". This sorts results based on the
        #   creationTimestamp field in reverse chronological order (newest result first).
        #   Use this to sort resources like operations so that the newest operation is
        #   returned first.
        #   Currently, only sorting by name or creationTimestamp desc is supported.
        # @param [String] page_token
        #   Specifies a page token to use. Set pageToken to the nextPageToken returned by
        #   a previous list request to get the next page of results.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::ListManifestsResponse] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::ListManifestsResponse]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def list_manifests(project, deployment, filter: nil, max_results: nil, order_by: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:get, '{project}/global/deployments/{deployment}/manifests', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::ListManifestsResponse::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::ListManifestsResponse
          command.params['project'] = project unless project.nil?
          command.params['deployment'] = deployment unless deployment.nil?
          command.query['filter'] = filter unless filter.nil?
          command.query['maxResults'] = max_results unless max_results.nil?
          command.query['orderBy'] = order_by unless order_by.nil?
          command.query['pageToken'] = page_token unless page_token.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Gets information about a specific operation.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] operation
        #   The name of the operation for this request.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Operation]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def get_operation(project, operation, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:get, '{project}/global/operations/{operation}', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Operation
          command.params['project'] = project unless project.nil?
          command.params['operation'] = operation unless operation.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Lists all operations for a project.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] filter
        #   Sets a filter expression for filtering listed resources, in the form filter=`
        #   expression`. Your `expression` must be in the format: field_name
        #   comparison_string literal_string.
        #   The field_name is the name of the field you want to compare. Only atomic field
        #   types are supported (string, number, boolean). The comparison_string must be
        #   either eq (equals) or ne (not equals). The literal_string is the string value
        #   to filter to. The literal value must be valid for the type of field you are
        #   filtering by (string, number, boolean). For string fields, the literal value
        #   is interpreted as a regular expression using RE2 syntax. The literal value
        #   must match the entire field.
        #   For example, to filter for instances that do not have a name of example-
        #   instance, you would use filter=name ne example-instance.
        #   You can filter on nested fields. For example, you could filter on instances
        #   that have set the scheduling.automaticRestart field to true. Use filtering on
        #   nested fields to take advantage of labels to organize and search for results
        #   based on label values.
        #   To filter on multiple expressions, provide each separate expression within
        #   parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-
        #   central1-f). Multiple expressions are treated as AND expressions, meaning that
        #   resources must match all expressions to pass the filters.
        # @param [Fixnum] max_results
        #   The maximum number of results per page that should be returned. If the number
        #   of available results is larger than maxResults, Compute Engine returns a
        #   nextPageToken that can be used to get the next page of results in subsequent
        #   list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
        # @param [String] order_by
        #   Sorts list results by a certain order. By default, results are returned in
        #   alphanumerical order based on the resource name.
        #   You can also sort results in descending order based on the creation timestamp
        #   using orderBy="creationTimestamp desc". This sorts results based on the
        #   creationTimestamp field in reverse chronological order (newest result first).
        #   Use this to sort resources like operations so that the newest operation is
        #   returned first.
        #   Currently, only sorting by name or creationTimestamp desc is supported.
        # @param [String] page_token
        #   Specifies a page token to use. Set pageToken to the nextPageToken returned by
        #   a previous list request to get the next page of results.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::ListOperationsResponse] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::ListOperationsResponse]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def list_operations(project, filter: nil, max_results: nil, order_by: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:get, '{project}/global/operations', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::ListOperationsResponse::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::ListOperationsResponse
          command.params['project'] = project unless project.nil?
          command.query['filter'] = filter unless filter.nil?
          command.query['maxResults'] = max_results unless max_results.nil?
          command.query['orderBy'] = order_by unless order_by.nil?
          command.query['pageToken'] = page_token unless page_token.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Gets information about a single resource.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] deployment
        #   The name of the deployment for this request.
        # @param [String] resource
        #   The name of the resource for this request.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::Resource] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::Resource]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def get_resource(project, deployment, resource, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:get, '{project}/global/deployments/{deployment}/resources/{resource}', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::Resource::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::Resource
          command.params['project'] = project unless project.nil?
          command.params['deployment'] = deployment unless deployment.nil?
          command.params['resource'] = resource unless resource.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Lists all resources in a given deployment.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] deployment
        #   The name of the deployment for this request.
        # @param [String] filter
        #   Sets a filter expression for filtering listed resources, in the form filter=`
        #   expression`. Your `expression` must be in the format: field_name
        #   comparison_string literal_string.
        #   The field_name is the name of the field you want to compare. Only atomic field
        #   types are supported (string, number, boolean). The comparison_string must be
        #   either eq (equals) or ne (not equals). The literal_string is the string value
        #   to filter to. The literal value must be valid for the type of field you are
        #   filtering by (string, number, boolean). For string fields, the literal value
        #   is interpreted as a regular expression using RE2 syntax. The literal value
        #   must match the entire field.
        #   For example, to filter for instances that do not have a name of example-
        #   instance, you would use filter=name ne example-instance.
        #   You can filter on nested fields. For example, you could filter on instances
        #   that have set the scheduling.automaticRestart field to true. Use filtering on
        #   nested fields to take advantage of labels to organize and search for results
        #   based on label values.
        #   To filter on multiple expressions, provide each separate expression within
        #   parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-
        #   central1-f). Multiple expressions are treated as AND expressions, meaning that
        #   resources must match all expressions to pass the filters.
        # @param [Fixnum] max_results
        #   The maximum number of results per page that should be returned. If the number
        #   of available results is larger than maxResults, Compute Engine returns a
        #   nextPageToken that can be used to get the next page of results in subsequent
        #   list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
        # @param [String] order_by
        #   Sorts list results by a certain order. By default, results are returned in
        #   alphanumerical order based on the resource name.
        #   You can also sort results in descending order based on the creation timestamp
        #   using orderBy="creationTimestamp desc". This sorts results based on the
        #   creationTimestamp field in reverse chronological order (newest result first).
        #   Use this to sort resources like operations so that the newest operation is
        #   returned first.
        #   Currently, only sorting by name or creationTimestamp desc is supported.
        # @param [String] page_token
        #   Specifies a page token to use. Set pageToken to the nextPageToken returned by
        #   a previous list request to get the next page of results.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::ListResourcesResponse] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::ListResourcesResponse]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def list_resources(project, deployment, filter: nil, max_results: nil, order_by: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:get, '{project}/global/deployments/{deployment}/resources', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::ListResourcesResponse::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::ListResourcesResponse
          command.params['project'] = project unless project.nil?
          command.params['deployment'] = deployment unless deployment.nil?
          command.query['filter'] = filter unless filter.nil?
          command.query['maxResults'] = max_results unless max_results.nil?
          command.query['orderBy'] = order_by unless order_by.nil?
          command.query['pageToken'] = page_token unless page_token.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        # Lists all resource types for Deployment Manager.
        # @param [String] project
        #   The project ID for this request.
        # @param [String] filter
        #   Sets a filter expression for filtering listed resources, in the form filter=`
        #   expression`. Your `expression` must be in the format: field_name
        #   comparison_string literal_string.
        #   The field_name is the name of the field you want to compare. Only atomic field
        #   types are supported (string, number, boolean). The comparison_string must be
        #   either eq (equals) or ne (not equals). The literal_string is the string value
        #   to filter to. The literal value must be valid for the type of field you are
        #   filtering by (string, number, boolean). For string fields, the literal value
        #   is interpreted as a regular expression using RE2 syntax. The literal value
        #   must match the entire field.
        #   For example, to filter for instances that do not have a name of example-
        #   instance, you would use filter=name ne example-instance.
        #   You can filter on nested fields. For example, you could filter on instances
        #   that have set the scheduling.automaticRestart field to true. Use filtering on
        #   nested fields to take advantage of labels to organize and search for results
        #   based on label values.
        #   To filter on multiple expressions, provide each separate expression within
        #   parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-
        #   central1-f). Multiple expressions are treated as AND expressions, meaning that
        #   resources must match all expressions to pass the filters.
        # @param [Fixnum] max_results
        #   The maximum number of results per page that should be returned. If the number
        #   of available results is larger than maxResults, Compute Engine returns a
        #   nextPageToken that can be used to get the next page of results in subsequent
        #   list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
        # @param [String] order_by
        #   Sorts list results by a certain order. By default, results are returned in
        #   alphanumerical order based on the resource name.
        #   You can also sort results in descending order based on the creation timestamp
        #   using orderBy="creationTimestamp desc". This sorts results based on the
        #   creationTimestamp field in reverse chronological order (newest result first).
        #   Use this to sort resources like operations so that the newest operation is
        #   returned first.
        #   Currently, only sorting by name or creationTimestamp desc is supported.
        # @param [String] page_token
        #   Specifies a page token to use. Set pageToken to the nextPageToken returned by
        #   a previous list request to get the next page of results.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        #   Overrides userIp if both are provided.
        # @param [String] user_ip
        #   IP address of the site where the request originates. Use this if you want to
        #   enforce per-user limits.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::DeploymentmanagerV2::ListTypesResponse] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::DeploymentmanagerV2::ListTypesResponse]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def list_types(project, filter: nil, max_results: nil, order_by: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
          command =  make_simple_command(:get, '{project}/global/types', options)
          command.response_representation = Google::Apis::DeploymentmanagerV2::ListTypesResponse::Representation
          command.response_class = Google::Apis::DeploymentmanagerV2::ListTypesResponse
          command.params['project'] = project unless project.nil?
          command.query['filter'] = filter unless filter.nil?
          command.query['maxResults'] = max_results unless max_results.nil?
          command.query['orderBy'] = order_by unless order_by.nil?
          command.query['pageToken'] = page_token unless page_token.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
          execute_or_queue_command(command, &block)
        end

        protected

        def apply_command_defaults(command)
          command.query['key'] = key unless key.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          command.query['userIp'] = user_ip unless user_ip.nil?
        end
      end
    end
  end
end


text:
title: Tune TiFlash Performance
summary: Learn how to tune the performance of TiFlash.
aliases: ['/docs/dev/tiflash/tune-tiflash-performance/','/docs/dev/reference/tiflash/tune-performance/']
---

# Tune TiFlash Performance

This document introduces how to tune the performance of TiFlash, including planning machine resources and tuning TiDB parameters.

## Plan resources

If you want to save machine resources and have no requirement on isolation, you can use the method that combines the deployment of both TiKV and TiFlash. It is recommended that you save enough resources for TiKV and TiFlash respectively, and do not share disks.

## Tune TiDB parameters

1. For the TiDB node dedicated to OLAP/TiFlash, it is recommended that you increase the value of the [`tidb_distsql_scan_concurrency`](/system-variables.md#tidb_distsql_scan_concurrency) configuration item for this node to `80`:

    {{< copyable "sql" >}}

    ```sql
    set @@tidb_distsql_scan_concurrency = 80;
    ```

2. Enable the super batch feature:

    You can use the [`tidb_allow_batch_cop`](/system-variables.md#tidb_allow_batch_cop-new-in-v40) variable to set whether to merge Region requests when reading from TiFlash.

    When the number of Regions involved in the query is relatively large, try to set this variable to `1` (effective for coprocessor requests with `aggregation` operators that are pushed down to TiFlash), or set this variable to `2` (effective for all coprocessor requests that are pushed down to TiFlash).

    {{< copyable "sql" >}}

    ```sql
    set @@tidb_allow_batch_cop = 1;
    ```

3. Enable the optimization of pushing down aggregate functions before TiDB operators such as `JOIN` or `UNION`:

    You can use the [`tidb_opt_agg_push_down`](/system-variables.md#tidb_opt_agg_push_down) variable to control the optimizer to execute this optimization. When the aggregate operations are quite slow in the query, try to set this variable to `1`.

    {{< copyable "sql" >}}

    ```sql
    set @@tidb_opt_agg_push_down = 1;
    ```

4. Enable the optimization of pushing down aggregate functions with `Distinct` before TiDB operators such as `JOIN` or `UNION`:

    You can use the [`tidb_opt_distinct_agg_push_down`](/system-variables.md#tidb_opt_distinct_agg_push_down) variable to control the optimizer to execute this optimization. When the aggregate operations with `Distinct` are quite slow in the query, try to set this variable to `1`.

    {{< copyable "sql" >}}

    ```sql
    set @@tidb_opt_distinct_agg_push_down = 1;
    ```