text:
<!DOCTYPE html>

	<title>

            PolarData -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta content="width=device-width,initial-scale=1" name="viewport">

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      PolarData Inc.

Legal Name:

PolarData Inc.

Operating Name:

PolarData

http://www.polardata.com

contact@polardata.com

Mailing Address:

              	<address class="mrgn-bttm-md">

                   105-500 Claridge Dr

                    NEPEAN,

                    Ontario

                  K2J 3G5

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   105-500 Claridge Dr

                    NEPEAN,

                    Ontario

                  K2J 3G5

                         </address>

Tel.:
		      (613) 491-1404

Fax:
		      (613) 491-4115

Logo

Company Profile

            PolarData Computing Services is an Ottawa-based firm of IT Consultants and Technical Support specialists providing consulting, support and proactive advice and services to individuals, businesses, and not-for-profit organizations.

Since 2001, our team of experienced and skilled professionals has provided expertise in assisting clients with every aspect of the ever changing IT world.  PolarData provides network assessments, detailed consulting recommendations, next step business cycle planning as well as ongoing proactive technical support and monitoring.

Our sales team recommends the products and solutions that we know will perform. We recommend products that we use in our own business. We understand that leveraging technology can save our clients time and money and this can be a significant component in our client's success in business.

At PolarData the quality of our service and our client's satisfaction is mission critical.  Working with our organization means dealing with professionals who have not only the technical skills to apply strategies and implement technical solutions but professionals that have excellent communication skills.

We are a proactive technical IT company that keeps our clients best needs in mind at all times.  We are continuously implementing professional development and research into our business partner's solutions to ensure that we are knowledgeable and efficient with product implementation and support

				Full profile

				Full profile

				Contact information

                Paul
                Young

                  Title:

                President

                  Telephone:

                (613) 491-1404

                  Facsimile:

                (613) 491-4115

                    Email:

                  pyoung@polardata.com

  top of page

				Company description

            Exporting:

              No

                Primary Industry (NAICS):

				541510 - Computer Systems Design and Related Services

            Primary Business Activity:

            Services

				Product / Service / Licensing

                              Service Name:

                            Professional Services

                            PolarData provides End-To-End IT Design, Implementation and  Management Solutions. We will provide best in class technical support and solutions to our customers satisfaction. We are developing in house tools for the Data Management and Reporting.

              FSC Code:

              AJ00-General Science and Technology

              D000-Information Processing and Related Telecommunications Services

              D301-ADP Facility Operation and Maintenance Services

              D302-ADP Systems Development Services

              D303-ADP Data Entry Services

              D304-ADP Telecommunications and Transmission Services

              D305-ADP Teleprocessing and Timesharing Services

              D306-ADP Systems Analysis Services

              D307-Automated Information System Design and Integration Services

              D308-Programming Services

              D309-Information and Data Broadcasting or Data Distribution Services

              D310-ADP Backup and Security Services

              D311-ADP Data Conversion Services

              D312-ADP Optical Scanning Services

              D313-Computer Aided Design/Computer Aided Manufacturing (CAD/CAM) Services

              D314-ADP System Acquisition Support Services (Includes preparation of statement of work, benchmarks, specifications, etc.)

              D315-Digitizing Services (Includes cartographic and geographic information)

              D316-Telecommunications Network Management Services

              D317-Automated News Services, Data Services, or Other Information Services.  Buying data (the electronic equivalent of books, periodicals, newspapers, etc.

              D399-Other ADP and Telecommunications Services (incl. data storage on tapes, Compact Disk (CD), etc.

              H000-Technical Representative Services

              H200-Equipment and Materials Testing

              R000-Professional, Administrative and Management Support Services

              R002-Technology Sharing/Utilization Services

              R005-Technical Assistance

              R006-Technical Writing Services

              R007-Systems Engineering Services

              R016-Personal Services Contracts

              U000-Educational and Training Services

              U006-Vocational/Technical

              U009-Informatics Training

              U099-Other Education and Training Services

  top of page

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                Paul
                Young

                  Title:

                President

                  Telephone:

                (613) 491-1404

                  Facsimile:

                (613) 491-4115

                    Email:

                  pyoung@polardata.com

				Description

				Company description

            Exporting:

              No

                Primary Industry (NAICS):

				541510 - Computer Systems Design and Related Services

            Primary Business Activity:

            Services

				Products, services and licensing

				Product / Service / Licensing

                              Service Name:

                            Professional Services

                            PolarData provides End-To-End IT Design, Implementation and  Management Solutions. We will provide best in class technical support and solutions to our customers satisfaction. We are developing in house tools for the Data Management and Reporting.

              FSC Code:

              AJ00-General Science and Technology

              D000-Information Processing and Related Telecommunications Services

              D301-ADP Facility Operation and Maintenance Services

              D302-ADP Systems Development Services

              D303-ADP Data Entry Services

              D304-ADP Telecommunications and Transmission Services

              D305-ADP Teleprocessing and Timesharing Services

              D306-ADP Systems Analysis Services

              D307-Automated Information System Design and Integration Services

              D308-Programming Services

              D309-Information and Data Broadcasting or Data Distribution Services

              D310-ADP Backup and Security Services

              D311-ADP Data Conversion Services

              D312-ADP Optical Scanning Services

              D313-Computer Aided Design/Computer Aided Manufacturing (CAD/CAM) Services

              D314-ADP System Acquisition Support Services (Includes preparation of statement of work, benchmarks, specifications, etc.)

              D315-Digitizing Services (Includes cartographic and geographic information)

              D316-Telecommunications Network Management Services

              D317-Automated News Services, Data Services, or Other Information Services.  Buying data (the electronic equivalent of books, periodicals, newspapers, etc.

              D399-Other ADP and Telecommunications Services (incl. data storage on tapes, Compact Disk (CD), etc.

              H000-Technical Representative Services

              H200-Equipment and Materials Testing

              R000-Professional, Administrative and Management Support Services

              R002-Technology Sharing/Utilization Services

              R005-Technical Assistance

              R006-Technical Writing Services

              R007-Systems Engineering Services

              R016-Personal Services Contracts

              U000-Educational and Training Services

              U006-Vocational/Technical

              U009-Informatics Training

              U099-Other Education and Training Services

    Last Update Date 2015-10-28

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>


text:
package com.javaeye.lonlysky.lforum.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.hibernate.SessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.orm.hibernate.SimpleHibernateTemplate;

import com.javaeye.lonlysky.lforum.comm.utils.Utils;
import com.javaeye.lonlysky.lforum.entity.forum.Bonuslog;
import com.javaeye.lonlysky.lforum.entity.forum.Postid;
import com.javaeye.lonlysky.lforum.entity.forum.Topics;
import com.javaeye.lonlysky.lforum.entity.forum.Users;

/**
 * 悬赏操作类
 *
 * @author 黄磊
 *
 */
@Service
@Transactional
public class BonuManager {

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

	private SimpleHibernateTemplate<Bonuslog, Integer> bonuslogDAO;

	@Autowired
	public void setSessionFactory(SessionFactory sessionFactory) {
		bonuslogDAO = new SimpleHibernateTemplate<Bonuslog, Integer>(sessionFactory, Bonuslog.class);
	}

	@Autowired
	private ScoresetManager scoresetManager;

	@Autowired
	private TopicManager topicManager;

	@Autowired
	private UserManager userManager;

	/**
	 * 添加悬赏日志
	 * @param topics 主题
	 * @param author 悬赏者
	 * @param winer 获奖者
	 * @param winnerName 获奖者用户名
	 * @param post 帖子
	 * @param bonus 奖励积分
	 * @param isbest 是否是最佳答案,0=不是,1=是较好的答案,2=最佳答案
	 */
	public void addLog(Topics topics, Users author, Users winer, String winnerName, Postid post, int bonus, int isbest) {
		Bonuslog bonuslog = new Bonuslog();
		bonuslog.setAnswername("");
		bonuslog.setBonus(bonus);
		bonuslog.setExtid(scoresetManager.getCreditsTrans());
		bonuslog.setIsbest(isbest);
		bonuslog.setPostid(post);
		bonuslog.setDateline(Utils.getNowTime());
		bonuslog.setTopics(topics);
		bonuslog.setUsersByAuthorid(author);

		bonuslogDAO.save(bonuslog);
		if (logger.isDebugEnabled()) {
			logger.debug("添加悬赏日志{}成功", bonuslog.getId());
		}
	}

	/**
	 * 结束悬赏并给分
	 * @param topicinfo 主题信息
	 * @param userid 当前执行此操作的用户Id
	 * @param postIdArray 帖子Id数组
	 * @param winerIdArray 获奖者Id数组
	 * @param winnerNameArray 获奖者的用户名数组
	 * @param costBonusArray 奖励积分数组
	 * @param valuableAnswerArray 有价值答案的pid数组
	 * @param bestAnswer 最佳答案的pid
	 */
	public void closeBonus(Topics topicinfo, int userid, int[] postIdArray, int[] winerIdArray,
			String[] winnerNameArray, String[] costBonusArray, String[] valuableAnswerArray, int bestAnswer) {
		topicinfo.setSpecial(3);
		topicManager.updateTopic(topicinfo);//更新标志位为已结帖状态

		//开始给分和记录
		int winerId = 0, isbest = 0, postid = 0, bonus = 0;
		String winnerName = "";
		for (int i = 0; i < winerIdArray.length; i++) {
			winerId = winerIdArray[i];
			bonus = Utils.null2Int(costBonusArray[i], 0);
			winnerName = winnerNameArray[i];
			postid = postIdArray[i];

			if (winerId > 0 && bonus > 0) {
				userManager.updateUserExtCredits(winerId, scoresetManager.getCreditsTrans(), bonus);
			}
			if (Utils.inArray(postid + "", valuableAnswerArray)) {
				isbest = 1;
			}
			if (postid == bestAnswer) {
				isbest = 2;
			}
			Users users = new Users();
			users.setUid(winerId);

			Postid pid = new Postid();
			pid.setPid(postid);
			addLog(topicinfo, topicinfo.getUsersByPosterid(), users, winnerName, pid, bonus, isbest);
		}
	}

	/**
	 * 获取指定主题的给分记录
	 * @param tid 主题ID
	 * @return 悬赏日志集合
	 */
	@SuppressWarnings("unchecked")
	public List<Bonuslog> getLogs(int tid) {
		List<Object[]> objlist = bonuslogDAO
				.find(
						"select topics.tid,usersByAuthorid.uid,usersByAnswerid.uid,answername,extid,sum(bonus) as bonus form Bonuslog where topics.tid=? group by usersByAnswerid.uid,usersByAuthorid.uid,tid,answername,extid",
						tid);
		List<Bonuslog> bonuslogList = new ArrayList<Bonuslog>();

		for (Object[] objs : objlist) {
			// 封装日志对象
			Topics topics = new Topics();
			topics.setTid(Utils.null2Int(objs[0], 0));

			Users usersByAuthorid = new Users();
			usersByAuthorid.setUid(Utils.null2Int(objs[1], 0));

			Users usersByAnswerid = new Users();
			usersByAnswerid.setUid(Utils.null2Int(objs[2], 0));

			Bonuslog bonuslog = new Bonuslog();
			bonuslog.setTopics(topics);
			bonuslog.setUsersByAuthorid(usersByAuthorid);
			bonuslog.setUsersByAnswerid(usersByAnswerid);
			bonuslog.setAnswername(Utils.null2String(objs[3]));
			bonuslog.setExtid(Utils.null2Int(objs[4]));
			bonuslog.setBonus(Utils.null2Int(objs[5], 0));

			bonuslogList.add(bonuslog);
		}
		return bonuslogList;
	}

	/**
	 * 获取指定主题的给分记录
	 * @param tid 主题Id
	 * @return 指定主题的给分记录
	 */
	public Map<Integer, Bonuslog> getLogsForEachPost(int tid) {
		List<Bonuslog> bList = bonuslogDAO.findByProperty("topics.tid", tid);
		Map<Integer, Bonuslog> blis = new HashMap<Integer, Bonuslog>();
		for (Bonuslog blog : bList) {
			blis.put(blog.getPostid().getPid(), blog);
		}
		return blis;
	}
}

redpajama_set_name: RedPajamaGithub


text:
package org.archive.archivespark.dataspecs.access

import java.io.Closeable

import scala.util.Try

trait CloseableDataAccessor[Data <: Closeable] extends DataAccessor[Data] {
  override def access[R >: Null](action: Data => R): R = {
    get match {
      case Some(data) =>
        val result = action(data)
        Try {data.close()}
        result
      case None => null
    }
  }
}


text:
package sh.komet.gui.style;

import javafx.css.PseudoClass;

/**
 *
 * @author kec
 */
public class PseudoClasses {
   public static final PseudoClass INACTIVE_PSEUDO_CLASS = PseudoClass.getPseudoClass("inactive");
   public static final PseudoClass REFERENCED_COMPONENT_INACTIVE_PSEUDO_CLASS = PseudoClass.getPseudoClass("referenced-component-inactive");
   /**
    * may be active, but superceded by a different component, so not current in the display
    */
   public static final PseudoClass SUPERCEDED_PSEUDO_CLASS = PseudoClass.getPseudoClass("superceded");
   public static final PseudoClass CONTRADICTED_PSEUDO_CLASS = PseudoClass.getPseudoClass("contradicted");

   public static final PseudoClass UNCOMMITTED_PSEUDO_CLASS = PseudoClass.getPseudoClass("uncommitted");
   public static final PseudoClass UNCOMMITTED_WITH_ERROR_PSEUDO_CLASS = PseudoClass.getPseudoClass("uncommitted-with-error");

   public static final PseudoClass LOGICAL_DEFINITION_PSEUDO_CLASS = PseudoClass.getPseudoClass("logical-definition-version");
   public static final PseudoClass DESCRIPTION_PSEUDO_CLASS = PseudoClass.getPseudoClass("description-version");
   public static final PseudoClass CONCEPT_PSEUDO_CLASS = PseudoClass.getPseudoClass("concept-version");
   public static final PseudoClass OTHER_VERSION_PSEUDO_CLASS = PseudoClass.getPseudoClass("other-version");

   public static final PseudoClass ALERT_INFO_PSEUDO_CLASS = PseudoClass.getPseudoClass("alert-info");
   public static final PseudoClass ALERT_CONFIRM_PSEUDO_CLASS = PseudoClass.getPseudoClass("alert-confirm");
   public static final PseudoClass ALERT_WARN_PSEUDO_CLASS = PseudoClass.getPseudoClass("alert-warn");
   public static final PseudoClass ALERT_ERROR_PSEUDO_CLASS = PseudoClass.getPseudoClass("alert-error");
   public static final PseudoClass ALERT_SUCCESS_PSEUDO_CLASS = PseudoClass.getPseudoClass("alert-success");

   public static final PseudoClass STATED_PSEUDO_CLASS = PseudoClass.getPseudoClass("stated");
   public static final PseudoClass INFERRED_PSEUDO_CLASS = PseudoClass.getPseudoClass("inferred");

   public static final PseudoClass DROP_POSSIBLE = PseudoClass.getPseudoClass("drop-possible");
   public static final PseudoClass DROP_READY = PseudoClass.getPseudoClass("drop-ready");

}


text:
namespace bgslibrary
{
  namespace algorithms
  {
    namespace kde
    {
      class KernelLUTable
      {
      public:
        double minsegma;
        double maxsegma;
        int segmabins;
        int tablehalfwidth;
        double *kerneltable;
        double *kernelsums;

      public:
        KernelLUTable();
        ~KernelLUTable();

        KernelLUTable(int KernelHalfWidth, double Segmamin, double Segmamax, int Segmabins);
      };
    }
  }
}


text:
package ch.hsr.servicecutter.model.usersystem;

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

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import com.google.common.base.Objects;

@Entity
public class UserSystem {

	@Id
	@GeneratedValue
	private Long id;
	private String name;

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "userSystem", fetch = FetchType.EAGER)
	private List<Nanoentity> nanoentities = new ArrayList<>();

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "userSystem")
	private List<CouplingInstance> couplingInstances = new ArrayList<>();

	public List<Nanoentity> getNanoentities() {
		return Collections.unmodifiableList(nanoentities);
	}

	public void addNanoentity(final Nanoentity nanoentity) {
		nanoentities.add(nanoentity);
		nanoentity.setUserSystem(this);
	}

	public void addCouplingInstance(final CouplingInstance instance) {
		couplingInstances.add(instance);
		instance.setSystem(this);
	}

	public List<CouplingInstance> getCouplingInstances() {
		return couplingInstances;
	}

	public Long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

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

	@Override
	public int hashCode() {
		return Objects.hashCode(id);
	}

	@Override
	public boolean equals(final Object obj) {
		if (obj instanceof UserSystem) {
			UserSystem other = (UserSystem) obj;
			return this == other || Objects.equal(id, other.id);
		} else {
			return false;
		}
	}

}


text:
import sublime
import sublime_plugin

import os

from .TsconfigLinter import check_tsconfig, show_lint_in_status
from .tsconfigglobexpand import expand_filesglob
from ..utils.CancelCommand import catch_CancelCommand, CancelCommand
from ..system.Project import opened_project_by_tsconfig

class TsconfigEventListener(sublime_plugin.EventListener):
    """ Listen to file events -> Activate TsconfigLinter.
        check_tsconfig immediately returns if file is no tsconfig.json """

    def on_activated_async(self, view):
        check_tsconfig(view)

    def on_load_async(self, view):
        check_tsconfig(view)

    def on_modified(self, view):
        check_tsconfig(view)

    def on_clone_async(self, view):
        check_tsconfig(view)

    @catch_CancelCommand
    def on_post_save_async(self, view):
        linter = check_tsconfig(view)
        linting_succeeded = expand_filesglob(linter)
        if linting_succeeded:
            project = opened_project_by_tsconfig(linter.file_name)
            if project:
                project.reopen_project()

    def on_selection_modified_async(self, view):
        show_lint_in_status(view)


text:
<?php
/**
 *
 */

namespace Commercetools\Core\Request\OrderEdits\StagedOrder\Command;

use Commercetools\Core\Request\Carts\Command\CartAddCustomLineItemAction;
use Commercetools\Core\Model\Common\LocalizedString;
use Commercetools\Core\Model\Common\Money;
use Commercetools\Core\Model\TaxCategory\TaxCategoryReference;
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraft;
use Commercetools\Core\Model\TaxCategory\ExternalTaxRateDraft;

/**
 * @package Commercetools\Core\Request\OrderEdits\StagedOrder\Command
 *
 * @method string getAction()
 * @method StagedOrderAddCustomLineItemAction setAction(string $action = null)
 * @method LocalizedString getName()
 * @method StagedOrderAddCustomLineItemAction setName(LocalizedString $name = null)
 * @method int getQuantity()
 * @method StagedOrderAddCustomLineItemAction setQuantity(int $quantity = null)
 * @method Money getMoney()
 * @method StagedOrderAddCustomLineItemAction setMoney(Money $money = null)
 * @method string getSlug()
 * @method StagedOrderAddCustomLineItemAction setSlug(string $slug = null)
 * @method TaxCategoryReference getTaxCategory()
 * @method StagedOrderAddCustomLineItemAction setTaxCategory(TaxCategoryReference $taxCategory = null)
 * @method CustomFieldObjectDraft getCustom()
 * @method StagedOrderAddCustomLineItemAction setCustom(CustomFieldObjectDraft $custom = null)
 * @method ExternalTaxRateDraft getExternalTaxRate()
 * @method StagedOrderAddCustomLineItemAction setExternalTaxRate(ExternalTaxRateDraft $externalTaxRate = null)
 */
class StagedOrderAddCustomLineItemAction extends CartAddCustomLineItemAction implements StagedOrderUpdateAction
{
}


text:
<!doctype html>

		<meta charset="utf-8">

		<title>reveal.js - The HTML Presentation Framework</title>

		<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
		<meta name="author" content="Hakim El Hattab">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

		<link rel="stylesheet" href="css/reveal.css">
		<link rel="stylesheet" href="css/theme/black.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

Reveal.js

The HTML Presentation Framework

Hello There

						reveal.js enables you to create beautiful interactive slide decks using HTML. This presentation will show you examples of what it can do.

Vertical Slides

Slides can be nested inside of each other.

Use the Space key to navigate through all slides.

Basement Level 1

Nested slides are useful for adding additional detail underneath a high level horizontal slide.

Basement Level 2

That's it, time to go back up.

Slides

						Not a coder? Not a problem. There's a fully-featured visual editor for authoring these, try it out at http://slides.com.

Point of View

						Press ESC to enter the slide overview.

						Hold down alt and click on any element to zoom in on it using zoom.js. Alt + click anywhere to zoom back out.

Touch Optimized

						Presentations look great on touch devices, like mobile phones and tablets. Simply swipe through your slides.

Fragments

Hit the next arrow...

... to step through ...

... a fragmented slide.

							This slide has fragments which are also stepped through in the notes window.

Fragment Styles

There's different types of fragments, like:

grow

shrink

fade-out

current-visible

highlight-red

highlight-blue

Transition Styles

						You can select from different transitions, like:

						None -
						Fade -
						Slide -
						Convex -
						Concave -
						Zoom

Themes

						reveal.js comes with a few themes built in:

						Black (default) -
						White -
						League -
						Sky -
						Beige -
						Simple

						Serif -
						Blood -
						Night -
						Moon -
						Solarized

Slide Backgrounds

							Set data-background="#dddddd" on a slide to change the background color. All CSS color formats are supported.

Image Backgrounds

<section data-background="image.png">

Tiled Backgrounds

<section data-background="image.png" data-background-repeat="repeat" data-background-size="100px">

Video Backgrounds

<section data-background-video="video.mp4,video.webm">

... and GIFs!

Background Transitions

						Different background transitions are available via the backgroundTransition option. This one's called "zoom".

Reveal.configure({ backgroundTransition: 'zoom' })

Background Transitions

						You can override background transitions per-slide.

<section data-background-transition="zoom">

Pretty Code

function linkify( selector ) {
  if( supports3DTransforms ) {

    var nodes = document.querySelectorAll( selector );

    for( var i = 0, len = nodes.length; i < len; i++ ) {
      var node = nodes[i];

      if( !node.className ) {
        node.className += ' roll';
      }
    }
  }
}

Code syntax highlighting courtesy of highlight.js.

Marvelous List

No order here

Or here

Or here

Or here

Fantastic Ordered List

One is smaller than...

Two is smaller than...

Three!

Tabular Tables

								Item
								Value
								Quantity

								Apples
								$1
								7

								Lemonade
								$2
								18

								Bread
								$3
								2

Clever Quotes

						These guys come in two forms, inline: <q cite="http://searchservervirtualization.techtarget.com/definition/Our-Favorite-Technology-Quotations">
						“The nice thing about standards is that there are so many to choose from”</q> and block:

						“For years there has been a theory that millions of monkeys typing at random on millions of typewriters would
						reproduce the entire works of Shakespeare. The Internet has proven this theory to be untrue.”

Intergalactic Interconnections

						You can link between slides internally,
						like this.

Speaker View

There's a speaker view. It includes a timer, preview of the upcoming slide as well as your speaker notes.

Press the S key to try it out.

						Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).

Export to PDF

Presentations can be exported to PDF, here's an example:

Global State

						Set data-state="something" on a slide and "something"
						will be added as a class to the document element when the slide is open. This lets you
						apply broader style changes, like switching the page background.

State Events

						Additionally custom events can be triggered on a per slide basis by binding to the data-state name.

Reveal.addEventListener( 'customevent', function() {
	console.log( '"customevent" has fired' );
} );

Take a Moment

						Press B or . on your keyboard to pause the presentation. This is helpful when you're on stage and want to take distracting slides off the screen.

Much more

Right-to-left support

Extensive JavaScript API

Auto-progression

Parallax backgrounds

Custom keyboard bindings

THE END

						- Try the online editor

						- Source code & documentation

			Try the visual editor

				<svg viewBox="-8 -8 48 48" width="20" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg">
					<path fill="#FFFFFF" d="M25.613-4.557c0,0-3.707,0-6.166,0c-3.662,0-7.732,1.535-7.732,6.835c0.019,1.845,0,3.613,0,5.603H7.481 v6.728h4.366v19.37h8.021V14.48h5.295l0.479-6.618h-5.913c0,0,0.016-2.946,0-3.8c0-2.093,2.184-1.974,2.312-1.974 c1.042,0,3.059,0.003,3.578,0v-6.646H25.613z"/>
				</svg>

				<svg viewbox="0 0 2000 1625.36" width="20" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg">
					<path d="m 1999.9999,192.4 c -73.58,32.64 -152.67,54.69 -235.66,64.61 84.7,-50.78 149.77,-131.19 180.41,-227.01 -79.29,47.03 -167.1,81.17 -260.57,99.57 C 1609.3399,49.82 1502.6999,0 1384.6799,0 c -226.6,0 -410.328,183.71 -410.328,410.31 0,32.16 3.628,63.48 10.625,93.51 -341.016,-17.11 -643.368,-180.47 -845.739,-428.72 -35.324,60.6 -55.5583,131.09 -55.5583,206.29 0,142.36 72.4373,267.95 182.5433,341.53 -67.262,-2.13 -130.535,-20.59 -185.8519,-51.32 -0.039,1.71 -0.039,3.42 -0.039,5.16 0,198.803 141.441,364.635 329.145,402.342 -34.426,9.375 -70.676,14.395 -108.098,14.395 -26.441,0 -52.145,-2.578 -77.203,-7.364 52.215,163.008 203.75,281.649 383.304,284.946 -140.429,110.062 -317.351,175.66 -509.5972,175.66 -33.1211,0 -65.7851,-1.949 -97.8828,-5.738 181.586,116.4176 397.27,184.359 628.988,184.359 754.732,0 1167.462,-625.238 1167.462,-1167.47 0,-17.79 -0.41,-35.48 -1.2,-53.08 80.1799,-57.86 149.7399,-130.12 204.7499,-212.41" style="fill:#ffffff"/>
				</svg>


text:
import os
import time
import shutil
import tempfile
from mapproxy.config.loader import load_configuration
from mapproxy.cache.tile import Tile
from mapproxy.image import ImageSource
from mapproxy.image.opts import ImageOptions
from mapproxy.seed.seeder import seed
from mapproxy.seed.cleanup import cleanup
from mapproxy.seed.config import load_seed_tasks_conf
from mapproxy.config import local_base_config
from mapproxy.util.fs import ensure_directory

from mapproxy.test.http import mock_httpd
from mapproxy.test.image import tmp_image, create_tmp_image_buf, create_tmp_image

from nose.tools import eq_

FIXTURE_DIR = os.path.join(os.path.dirname(__file__), 'fixture')

class SeedTestEnvironment(object):
    def setup(self):
        self.dir = tempfile.mkdtemp()
        shutil.copy(os.path.join(FIXTURE_DIR, self.seed_conf_name), self.dir)
        shutil.copy(os.path.join(FIXTURE_DIR, self.mapproxy_conf_name), self.dir)
        shutil.copy(os.path.join(FIXTURE_DIR, self.empty_ogrdata), self.dir)
        self.seed_conf_file = os.path.join(self.dir, self.seed_conf_name)
        self.mapproxy_conf_file = os.path.join(self.dir, self.mapproxy_conf_name)
        self.mapproxy_conf = load_configuration(self.mapproxy_conf_file, seed=True)

    def teardown(self):
        shutil.rmtree(self.dir)

    def make_tile(self, coord=(0, 0, 0), timestamp=None):
        """
        Create file for tile at `coord` with given timestamp.
        """
        tile_dir = os.path.join(self.dir, 'cache/one_EPSG4326/%02d/000/000/%03d/000/000/' %
                                (coord[2], coord[0]))

        ensure_directory(tile_dir)
        tile = os.path.join(tile_dir + '%03d.png' % coord[1])
        open(tile, 'wb').write(b'')
        if timestamp:
            os.utime(tile, (timestamp, timestamp))
        return tile

    def tile_exists(self, coord):
        tile_dir = os.path.join(self.dir, 'cache/one_EPSG4326/%02d/000/000/%03d/000/000/' %
                                (coord[2], coord[0]))
        tile = os.path.join(tile_dir + '%03d.png' % coord[1])
        return os.path.exists(tile)

class SeedTestBase(SeedTestEnvironment):

    def test_seed_dry_run(self):
        with local_base_config(self.mapproxy_conf.base_config):
            seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
            tasks, cleanup_tasks = seed_conf.seeds(['one']), seed_conf.cleanups()
            seed(tasks, dry_run=True)
            cleanup(cleanup_tasks, verbose=False, dry_run=True)

    def test_seed(self):
        with tmp_image((256, 256), format='png') as img:
            img_data = img.read()
            expected_req = ({'path': r'/service?LAYERS=foo&SERVICE=WMS&FORMAT=image%2Fpng'
                                  '&REQUEST=GetMap&VERSION=1.1.1&bbox=-180.0,-90.0,180.0,90.0'
                                  '&width=256&height=128&srs=EPSG:4326'},
                            {'body': img_data, 'headers': {'content-type': 'image/png'}})
            with mock_httpd(('localhost', 42423), [expected_req]):
                with local_base_config(self.mapproxy_conf.base_config):
                    seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
                    tasks, cleanup_tasks = seed_conf.seeds(['one']), seed_conf.cleanups()
                    seed(tasks, dry_run=False)
                    cleanup(cleanup_tasks, verbose=False, dry_run=False)

    def test_reseed_uptodate(self):
        # tile already there.
        self.make_tile((0, 0, 0))
        with local_base_config(self.mapproxy_conf.base_config):
            seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
            tasks, cleanup_tasks = seed_conf.seeds(['one']), seed_conf.cleanups()
            seed(tasks, dry_run=False)
            cleanup(cleanup_tasks, verbose=False, dry_run=False)

class TestSeedOldConfiguration(SeedTestBase):
    seed_conf_name = 'seed_old.yaml'
    mapproxy_conf_name = 'seed_mapproxy.yaml'
    empty_ogrdata = 'empty_ogrdata.geojson'

    def test_reseed_remove_before(self):
        # tile already there but too old
        t000 = self.make_tile((0, 0, 0), timestamp=time.time() - (60*60*25))
        # old tile outside the seed view (should be removed)
        t001 = self.make_tile((0, 0, 1), timestamp=time.time() - (60*60*25))
        assert os.path.exists(t000)
        assert os.path.exists(t001)
        with tmp_image((256, 256), format='png') as img:
            img_data = img.read()
            expected_req = ({'path': r'/service?LAYERS=foo&SERVICE=WMS&FORMAT=image%2Fpng'
                                  '&REQUEST=GetMap&VERSION=1.1.1&bbox=-180.0,-90.0,180.0,90.0'
                                  '&width=256&height=128&srs=EPSG:4326'},
                            {'body': img_data, 'headers': {'content-type': 'image/png'}})
            with mock_httpd(('localhost', 42423), [expected_req]):
                seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
                tasks, cleanup_tasks = seed_conf.seeds(), seed_conf.cleanups()
                seed(tasks, dry_run=False)
                cleanup(cleanup_tasks, verbose=False, dry_run=False)

        assert os.path.exists(t000)
        assert os.path.getmtime(t000) - 5 < time.time() < os.path.getmtime(t000) + 5
        assert not os.path.exists(t001)

tile_image_buf = create_tmp_image_buf((256, 256), color='blue')
tile_image = create_tmp_image((256, 256), color='blue')

class TestSeed(SeedTestBase):
    seed_conf_name = 'seed.yaml'
    mapproxy_conf_name = 'seed_mapproxy.yaml'
    empty_ogrdata = 'empty_ogrdata.geojson'

    def test_cleanup_levels(self):
        seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
        cleanup_tasks = seed_conf.cleanups(['cleanup'])

        self.make_tile((0, 0, 0))
        self.make_tile((0, 0, 1))
        self.make_tile((0, 0, 2))
        self.make_tile((0, 0, 3))

        cleanup(cleanup_tasks, verbose=False, dry_run=False)
        assert not self.tile_exists((0, 0, 0))
        assert not self.tile_exists((0, 0, 1))
        assert self.tile_exists((0, 0, 2))
        assert not self.tile_exists((0, 0, 3))

        eq_(sorted(os.listdir(os.path.join(self.dir, 'cache', 'one_EPSG4326'))),
            ['02'])

    def test_cleanup_remove_all(self):
        seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
        cleanup_tasks = seed_conf.cleanups(['remove_all'])

        self.make_tile((0, 0, 0))
        self.make_tile((0, 0, 1))
        self.make_tile((1, 0, 1))
        self.make_tile((0, 1, 1))
        self.make_tile((1, 1, 1))
        self.make_tile((0, 0, 2))
        self.make_tile((0, 0, 3))

        eq_(sorted(os.listdir(os.path.join(self.dir, 'cache', 'one_EPSG4326'))),
            ['00', '01', '02', '03'])

        cleanup(cleanup_tasks, verbose=False, dry_run=False)
        assert self.tile_exists((0, 0, 0))
        assert not self.tile_exists((0, 0, 1))
        assert not self.tile_exists((1, 0, 1))
        assert not self.tile_exists((0, 1, 1))
        assert not self.tile_exists((1, 1, 1))
        assert not self.tile_exists((0, 0, 1))
        assert self.tile_exists((0, 0, 2))
        assert self.tile_exists((0, 0, 3))

        # remove_all should remove the whole directory
        eq_(sorted(os.listdir(os.path.join(self.dir, 'cache', 'one_EPSG4326'))),
            ['00', '02', '03'])

    def test_cleanup_coverage(self):
        seed_conf = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
        cleanup_tasks = seed_conf.cleanups(['with_coverage'])

        self.make_tile((0, 0, 0))
        self.make_tile((1, 0, 1))
        self.make_tile((2, 0, 2))
        self.make_tile((2, 0, 3))
        self.make_tile((4, 0, 3))

        cleanup(cleanup_tasks, verbose=False, dry_run=False)
        assert not self.tile_exists((0, 0, 0))
        assert not self.tile_exists((1, 0, 1))
        assert self.tile_exists((2, 0, 2))
        assert not self.tile_exists((2, 0, 3))
        assert self.tile_exists((4, 0, 3))

    def test_seed_mbtile(self):
        with tmp_image((256, 256), format='png') as img:
            img_data = img.read()
            expected_req = ({'path': r'/service?LAYERS=bar&SERVICE=WMS&FORMAT=image%2Fpng'
                                  '&REQUEST=GetMap&VERSION=1.1.1&bbox=-180.0,-90.0,180.0,90.0'
                                  '&width=256&height=128&srs=EPSG:4326'},
                            {'body': img_data, 'headers': {'content-type': 'image/png'}})
            with mock_httpd(('localhost', 42423), [expected_req]):
                seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
                tasks, cleanup_tasks = seed_conf.seeds(['mbtile_cache']), seed_conf.cleanups(['cleanup_mbtile_cache'])
                seed(tasks, dry_run=False)
                cleanup(cleanup_tasks, verbose=False, dry_run=False)

    def create_tile(self, coord=(0, 0, 0)):
        return Tile(coord,
            ImageSource(tile_image_buf,
                image_opts=ImageOptions(format='image/png')))

    def test_reseed_mbtiles(self):
        seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
        tasks, cleanup_tasks = seed_conf.seeds(['mbtile_cache']), seed_conf.cleanups(['cleanup_mbtile_cache'])

        cache = tasks[0].tile_manager.cache
        cache.store_tile(self.create_tile())
        # no refresh before
        seed(tasks, dry_run=False)

    def test_reseed_mbtiles_with_refresh(self):
        seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
        tasks, cleanup_tasks = seed_conf.seeds(['mbtile_cache_refresh']), seed_conf.cleanups(['cleanup_mbtile_cache'])

        cache = tasks[0].tile_manager.cache
        cache.store_tile(self.create_tile())

        expected_req = ({'path': r'/service?LAYERS=bar&SERVICE=WMS&FORMAT=image%2Fpng'
                          '&REQUEST=GetMap&VERSION=1.1.1&bbox=-180.0,-90.0,180.0,90.0'
                          '&width=256&height=128&srs=EPSG:4326'},
                        {'body': tile_image, 'headers': {'content-type': 'image/png'}})
        with mock_httpd(('localhost', 42423), [expected_req]):
            # mbtiles does not support timestamps, refresh all tiles
            seed(tasks, dry_run=False)

    def test_cleanup_mbtiles(self):
        seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
        tasks, cleanup_tasks = seed_conf.seeds(['mbtile_cache_refresh']), seed_conf.cleanups(['cleanup_mbtile_cache'])

        cache = tasks[0].tile_manager.cache
        cache.store_tile(self.create_tile())

        cleanup(cleanup_tasks, verbose=False, dry_run=False)

    def test_cleanup_sqlite(self):
        seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
        cleanup_tasks = seed_conf.cleanups(['sqlite_cache'])

        cache = cleanup_tasks[0].tile_manager.cache
        cache.store_tile(self.create_tile((0, 0, 2)))
        cache.store_tile(self.create_tile((0, 0, 3)))
        assert cache.is_cached(Tile((0, 0, 2)))
        assert cache.is_cached(Tile((0, 0, 3)))

        eq_(sorted(os.listdir(os.path.join(self.dir, 'cache', 'sqlite_cache', 'GLOBAL_GEODETIC'))),
            ['2.mbtile', '3.mbtile'])

        cleanup(cleanup_tasks, verbose=False, dry_run=False)

        # 3.mbtile file is still there
        eq_(sorted(os.listdir(os.path.join(self.dir, 'cache', 'sqlite_cache', 'GLOBAL_GEODETIC'))),
            ['2.mbtile', '3.mbtile'])
        assert cache.is_cached(Tile((0, 0, 2)))
        assert not cache.is_cached(Tile((0, 0, 3)))

    def test_cleanup_sqlite_remove_all(self):
        seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
        cleanup_tasks = seed_conf.cleanups(['sqlite_cache_remove_all'])

        cache = cleanup_tasks[0].tile_manager.cache
        cache.store_tile(self.create_tile((0, 0, 2)))
        cache.store_tile(self.create_tile((0, 0, 3)))
        assert cache.is_cached(Tile((0, 0, 2)))
        assert cache.is_cached(Tile((0, 0, 3)))

        eq_(sorted(os.listdir(os.path.join(self.dir, 'cache', 'sqlite_cache', 'GLOBAL_GEODETIC'))),
            ['2.mbtile', '3.mbtile'])

        cleanup(cleanup_tasks, verbose=False, dry_run=False)

        # 3.mbtile file should be removed completely
        eq_(sorted(os.listdir(os.path.join(self.dir, 'cache', 'sqlite_cache', 'GLOBAL_GEODETIC'))),
            ['3.mbtile'])
        assert not cache.is_cached(Tile((0, 0, 2)))
        assert cache.is_cached(Tile((0, 0, 3)))

    def test_active_seed_tasks(self):
        with local_base_config(self.mapproxy_conf.base_config):
            seed_conf = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
            assert len(seed_conf.seed_tasks_names()) == 5
            assert len(seed_conf.seeds()) == 5

    def test_seed_refresh_remove_before_from_file(self):
        # tile already there but old
        t000 = self.make_tile((0, 0, 0), timestamp=time.time() - (60*60*25))

        # mtime is older than tile, no create of the tile
        timestamp = time.time() - (60*60*30)
        os.utime(self.seed_conf_file, (timestamp, timestamp))
        with local_base_config(self.mapproxy_conf.base_config):
            seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
            tasks = seed_conf.seeds(['refresh_from_file'])
            seed(tasks, dry_run=False)

        # touch the seed_conf file and refresh everything
        os.utime(self.seed_conf_file, None)
        img_data = create_tmp_image((256, 256), format='png')
        expected_req = ({'path': r'/service?LAYERS=foo&SERVICE=WMS&FORMAT=image%2Fpng'
                              '&REQUEST=GetMap&VERSION=1.1.1&bbox=-180.0,-90.0,180.0,90.0'
                              '&width=256&height=128&srs=EPSG:4326'},
                        {'body': img_data, 'headers': {'content-type': 'image/png'}})
        with mock_httpd(('localhost', 42423), [expected_req]):
            # touch the seed_conf file and refresh everything
            timestamp = time.time() - 60
            os.utime(self.seed_conf_file, (timestamp, timestamp))

            with local_base_config(self.mapproxy_conf.base_config):
                seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
                tasks = seed_conf.seeds(['refresh_from_file'])
                seed(tasks, dry_run=False)

                assert os.path.exists(t000)
                assert os.path.getmtime(t000) - 5 < time.time() < os.path.getmtime(t000) + 5

        # mtime is older than tile, no cleanup
        timestamp = time.time() - 5
        os.utime(self.seed_conf_file, (timestamp, timestamp))
        with local_base_config(self.mapproxy_conf.base_config):
            seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
            cleanup_tasks = seed_conf.cleanups(['remove_from_file'])
            cleanup(cleanup_tasks, verbose=False, dry_run=False)
        assert os.path.exists(t000)

        # now touch the seed_conf again and remove everything
        timestamp = time.time() + 5
        os.utime(self.seed_conf_file, (timestamp, timestamp))
        with local_base_config(self.mapproxy_conf.base_config):
            seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
            cleanup_tasks = seed_conf.cleanups(['remove_from_file'])
            cleanup(cleanup_tasks, verbose=False, dry_run=False)
        assert not os.path.exists(t000)

class TestConcurrentRequestsSeed(SeedTestEnvironment):
    seed_conf_name = 'seed_timeouts.yaml'
    mapproxy_conf_name = 'seed_timeouts_mapproxy.yaml'
    empty_ogrdata = 'empty_ogrdata.geojson'

    def test_timeout(self):
        # test concurrent seeding where seed concurrency is higher than the permitted
        # concurrent_request value of the source and a lock times out

        seed_conf  = load_seed_tasks_conf(self.seed_conf_file, self.mapproxy_conf)
        tasks = seed_conf.seeds(['test'])

        expected_req1 = ({'path': r'/service?LAYERS=foo&SERVICE=WMS&FORMAT=image%2Fpng'
                          '&REQUEST=GetMap&VERSION=1.1.1&bbox=-180.0,-90.0,180.0,90.0'
                          '&width=256&height=128&srs=EPSG:4326'},
                        {'body': tile_image, 'headers': {'content-type': 'image/png'}, 'duration': 0.1})

        expected_req2 = ({'path': r'/service?LAYERS=foo&SERVICE=WMS&FORMAT=image%2Fpng'
                          '&REQUEST=GetMap&VERSION=1.1.1&bbox=-180.0,-90.0,180.0,90.0'
                          '&width=512&height=256&srs=EPSG:4326'},
                        {'body': tile_image, 'headers': {'content-type': 'image/png'}, 'duration': 0.1})

        expected_req3 = ({'path': r'/service?LAYERS=foo&SERVICE=WMS&FORMAT=image%2Fpng'
                          '&REQUEST=GetMap&VERSION=1.1.1&bbox=-180.0,-90.0,180.0,90.0'
                          '&width=1024&height=512&srs=EPSG:4326'},
                        {'body': tile_image, 'headers': {'content-type': 'image/png'}, 'duration': 0.1})

        with mock_httpd(('localhost', 42423), [expected_req1, expected_req2, expected_req3], unordered=True):
            seed(tasks, dry_run=False, concurrency=3)
            # concurrency=3, concurrent_request=1, client_timeout=0.2, response delay=0.1
            # the third request should time out (3x0.1 > 0.2), but exp_backoff() in the seeder ignores this
            # timeout exception and tries a second time


text:
package com.mongodb.benchmark.benchmarks;

import com.mongodb.client.MongoDatabase;
import org.bson.BsonBinaryWriter;
import org.bson.codecs.Codec;
import org.bson.codecs.DecoderContext;
import org.bson.codecs.EncoderContext;
import org.bson.conversions.Bson;
import org.bson.io.BasicOutputBuffer;
import org.bson.json.JsonReader;

public class RunCommandBenchmark<T extends Bson> extends AbstractMongoBenchmark {

    private MongoDatabase database;
    private final Codec<T> codec;
    private final T command;

    public RunCommandBenchmark(final Codec<T> codec) {
        this.codec = codec;
        this.command = createCommand();
    }

    @Override
    public void setUp() throws Exception {
        super.setUp();
        database = client.getDatabase("admin");
    }

    @Override
    public String getName() {
        return "Run command";
    }

    @Override
    public void run() {
        for (int i = 0; i < NUM_INTERNAL_ITERATIONS; i++) {
            database.runCommand(command);
        }
    }

    @Override
    public int getBytesPerRun() {
        return NUM_INTERNAL_ITERATIONS * getCommandSize();
    }

    private int getCommandSize() {
        T command = createCommand();
        BasicOutputBuffer buffer = new BasicOutputBuffer();
        codec.encode(new BsonBinaryWriter(buffer), command, EncoderContext.builder().build());
        return buffer.getSize();
    }

    private T createCommand() {
        return codec.decode(new JsonReader("{ismaster: true}"),DecoderContext.builder().build());
    }
}


text:
import arc
import solution
import copy
import time

class ConstraintGraph(object):
    """
    Python representation of a constraint graph
    """

    def __init__(self, variables):
        """
        Given a list of variables with unary constraints,
        this generates a constraint graph with no binary
        constraints. The binary constraints are added later
        """
        self.arc_dict = dict()
        self.variables = variables
        self.variables_inds = list()
        self.edges = dict()
        self.num_assigned = 0
        self.num_nodes = 0
        self.num_backtracks = 0

    def ordering(self, i):
        """
        This function should be overridden by other heuristics.
        The current heuristic is the static variable ordering
        """
        return self.variables.index(i)

    def add_constraint(self, i, j, constraint):
        """
        Adds a constraint between two variables in the constraint graph.
        The constraint is a function that takes in two values and returns
        a boolean result
        """
        if not self.has_arc(i, j):
            self.arc_dict[(i, j)] = arc.Arc(i, j)
            self.arc_dict[(j, i)] = arc.Arc(j, i)

        if not i in self.edges:
            self.edges[i] = set()

        if not j in self.edges:
            self.edges[j] = set()

        inv_c = lambda a, b: constraint(b, a)
        self.arc_dict[(i, j)].add_constraint(constraint)
        self.arc_dict[(j, i)].add_constraint(inv_c)
        self.edges[i].add(j)
        self.edges[j].add(i)
        return self

    def all_different(self, *vs):
        """
        Applies the AllDifferent constraint for a group of variables
        in the constraint graph
        """
        neq = lambda a, b: a != b
        for ind, i in enumerate(vs):
            for j in vs[ind + 1:]:
                self.add_constraint(i, j, neq)

        return self

    def minimizing(self, k):
        """
        All variables have to be less than k
        """
        for vbl in self.variables:
            vbl.add_constraint(lambda v: v < k)

        return self

    def get_arc(self, i, j):
        """
        Gets the arc representation between two variables
        """
        return self.arc_dict[(i, j)]

    def has_arc(self, i, j):
        """
        Check if there is an arc between two variables
        """
        return (i, j) in self.arc_dict

    def get_best_variable(self):
        """
        Finds the current variable that has not been assigned that
        has the minimal value for the ordering function. This determines
        the order in which variables are searched
        """
        min_var = None
        min_val = None
        for i in self.variables_inds:
            val = self.ordering(self[i])
            if min_val is None or val < min_val:
                min_var = i
                min_val = val

        return min_var

    def setup_variable_inds(self):
        """
        Initializes the variable index for search
        """
        self.variables_inds = range(len(self.variables))
        return self

    def solve(self):
        """
        Provides a solution to the constraint graph using forward
        checking
        """
        n_graph = copy.deepcopy(self)
        n_graph.setup_variable_inds()
        start = time.time()
        res_graph = self.forward_checking(0, n_graph)
        end = time.time() - start
        if res_graph:
            sol = solution.Solution()
            for v in res_graph:
                sol[v.get_name()] = v.get_value()
            sol.set_num_assigned(self.num_assigned)
            sol.set_num_nodes(self.num_nodes)
            sol.set_num_backtracks(self.num_backtracks)
            sol.set_time_taken(end)
            self.num_assigned = 0
            self.num_nodes = 0
            self.num_backtracks = 0
            return sol
        else:
            return None

    def forward_checking(self, depth, graph):
        """
        Recursive function to perform forward checking. Variables
        are ordered based on the ordering function that may be overridden
        """
        ind = graph.get_best_variable()
        self.num_nodes += 1
        for d in graph[ind].get_pruned_domain():
            if not graph[ind].check_constraints(d):
                continue

            last_graph = copy.deepcopy(graph)
            graph[ind].assign(d)
            self.num_assigned += 1

            # Finally I get to use a for-else statement :D
            for future in graph.edges.get(graph[ind], list()):
                vs = [future, graph[ind]]
                if not graph.get_arc(*vs).revise():
                    break
            else:
                if depth == len(graph) - 1:
                    return graph
                else:
                    graph.variables_inds.remove(ind)
                    res = self.forward_checking(depth + 1, graph)
                    if res:
                        return res
            self.num_backtracks += 1
            graph = last_graph

    def __getitem__(self, i):
        """
        Operator overloading for indexing. We can now index the graph
        based on the the index of the variables in the variable list
        """
        return self.variables[i]

    def __len__(self):
        """
        Gets the number of variables in the graph
        """
        return len(self.variables)

    def __str__(self):
        """
        Returns a string representatino of the graph
        """
        return "\n".join(str(v) for v in self.variables)


text:
Scheduleオブジェクトは、定期アップロードのスケジュールを表します。

### Service
+ [FeedFtpService](../../services/FeedFtpService.md)

### Namespace
[FeedFtpService#Namespace](../../services/FeedFtpService.md#namespace)

| Field | Type | response| add| set| Description|
|---|---|---|---|---|---|
| type | [ScheduleType](./ScheduleType.md)| ○ | Requirement| Requirement| スケジュールタイプ |

この 作品 は クリエイティブ・コモンズ 表示 - 改変禁止 2.1 日本 ライセンスの下に提供されています。


text:
package org.jivesoftware.smack.ping.packet;

import org.dom4j.Element;
import org.xmpp.packet.IQ;

public class Ping extends IQ {

    public static final String NAMESPACE = "urn:xmpp:ping";
    public static final String ELEMENT = "ping";

    public Ping() {
        element.addElement(ELEMENT, NAMESPACE);
    }

    public Ping(String to) {
        this();
        setTo(to);
        setType(IQ.Type.get);
    }

    public Ping(Element doc) {
        super(doc);
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<LearningStandards>
  <LearningStandardItem xml:lang="en" RefID="E8A69B95352445e98F7E9732D5DEF568">
    <RefURI>http://corestandards.org/ELA-Literacy/RF/1/3/g/</RefURI>
    <StandardHierarchyLevel>
      <number>6</number>
      <description>Component</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.ELA-Literacy.RF.1.3g</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>Recognize and read grade-appropriate irregularly spelled words.</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>01</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>0FAC40650F514a459951A657F942B845</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">DFAD6504F1F04fadA9CC5A69A91A072C</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
</LearningStandards>


text:
<?php

namespace Drips\Less;

use Drips\Minimize\Compiler as MinimizeCompiler;
use Drips\MVC\CompileController;

define('DRIPS_LESS_DIRECTORY', (defined('DRIPS_DIRECTORY') ? DRIPS_DIRECTORY : __DIR__) . '/less');

class Controller extends CompileController
{
    protected $source_directory = DRIPS_LESS_DIRECTORY;
    protected $file_extension = "less";
    protected $response_type = "text/css";
    protected $minimize = true;

    public function compile($content)
    {
        $compiler = new LessCompiler;
        $compiler->setImportDir($this->source_directory);
        $compiled = $compiler->compile($content);
        if ($this->minimize) {
            $compiled = MinimizeCompiler::compile($compiled, MinimizeCompiler::CSS);
        }
        return $compiled;
    }
}


text:
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Textures;
using osuTK.Graphics.ES30;
using osu.Framework.Graphics.OpenGL;
using osuTK;
using System;
using osu.Framework.Graphics.OpenGL.Vertices;

namespace osu.Framework.Graphics.Sprites
{
    /// <summary>
    /// Draw node containing all necessary information to draw a <see cref="Sprite"/>.
    /// </summary>
    public class SpriteDrawNode : DrawNode
    {
        public Texture Texture;
        public Quad ScreenSpaceDrawQuad;
        public RectangleF DrawRectangle;
        public Vector2 InflationAmount;
        public bool WrapTexture;

        public IShader TextureShader;
        public IShader RoundedTextureShader;

        private bool needsRoundedShader => GLWrapper.IsMaskingActive || InflationAmount != Vector2.Zero;

        protected virtual void Blit(Action<TexturedVertex2D> vertexAction)
        {
            Texture.DrawQuad(ScreenSpaceDrawQuad, DrawColourInfo.Colour, null, vertexAction,
                new Vector2(InflationAmount.X / DrawRectangle.Width, InflationAmount.Y / DrawRectangle.Height));
        }

        public override void Draw(Action<TexturedVertex2D> vertexAction)
        {
            base.Draw(vertexAction);

            if (Texture?.Available != true)
                return;

            IShader shader = needsRoundedShader ? RoundedTextureShader : TextureShader;

            shader.Bind();

            Texture.TextureGL.WrapMode = WrapTexture ? TextureWrapMode.Repeat : TextureWrapMode.ClampToEdge;

            Blit(vertexAction);

            shader.Unbind();
        }
    }
}


text:
//
//  GTLQuery.h
//

// Query documentation:
// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Query_Operations

#import "GTLObject.h"
#import "GTLUploadParameters.h"

@protocol GTLQueryProtocol <NSObject, NSCopying>
- (BOOL)isBatchQuery;
- (BOOL)shouldSkipAuthorization;
- (void)executionDidStop;
- (NSDictionary *)additionalHTTPHeaders;
- (NSDictionary *)urlQueryParameters;
- (GTLUploadParameters *)uploadParameters;
@end

@protocol GTLQueryCollectionProtocol
@optional
@property (retain) NSString *pageToken;
@property (retain) NSNumber *startIndex;
@end

@class GTLServiceTicket;

@interface GTLQuery : NSObject <GTLQueryProtocol> {
 @private
  NSString *methodName_;
  NSMutableDictionary *json_;
  GTLObject *bodyObject_;
  NSMutableDictionary *childCache_;
  NSString *requestID_;
  GTLUploadParameters *uploadParameters_;
  NSDictionary *urlQueryParameters_;
  NSDictionary *additionalHTTPHeaders_;
  Class expectedObjectClass_;
  BOOL skipAuthorization_;
  void (^completionBlock_)(GTLServiceTicket *ticket, id object, NSError *error);
}

// The rpc method name.
@property (readonly) NSString *methodName;

// The JSON dictionary of all the parameters set on this query.
@property (retain) NSMutableDictionary *JSON;

// The object set to be uploaded with the query.
@property (retain) GTLObject *bodyObject;

// Each query must have a request ID string. The user may replace the
// default assigned request ID with a custom string, provided that if
// used in a batch query, all request IDs in the batch must be unique.
@property (copy) NSString *requestID;

// For queries which support file upload, the MIME type and file handle
// or data must be provided.
@property (copy) GTLUploadParameters *uploadParameters;

// Any URL query parameters to add to the query (useful for debugging with some
// services).
@property (copy) NSDictionary *urlQueryParameters;

// Any additional HTTP headers for this query.  Not valid when this query
// is added to a batch.
//
// These headers override the same keys from the service object's
// additionalHTTPHeaders.
@property (copy) NSDictionary *additionalHTTPHeaders;

// The GTLObject subclass expected for results (used if the result doesn't
// include a kind attribute).
@property (assign) Class expectedObjectClass;

// Clients may set this to YES to disallow authorization. Defaults to NO.
@property (assign) BOOL shouldSkipAuthorization;

// Clients may provide an optional callback block to be called immediately
// before the executeQuery: callback.
//
// The completionBlock property is particularly useful for queries executed
// in a batch.
//
// Errors passed to the completionBlock will have an "underlying" GTLErrorObject
// when the server returned an error for this specific query:
//
//   GTLErrorObject *errorObj = [GTLErrorObject underlyingObjectForError:error];
//   if (errorObj) {
//     // the server returned this error for this specific query
//   } else {
//     // the batch execution failed
//   }
@property (copy) void (^completionBlock)(GTLServiceTicket *ticket, id object, NSError *error);

// methodName is the RPC method name to use.
+ (id)queryWithMethodName:(NSString *)methodName GTL_NONNULL((1));

// methodName is the RPC method name to use.
- (id)initWithMethodName:(NSString *)method GTL_NONNULL((1));

// If you need to set a parameter that is not listed as a property for a
// query class, you can do so via this api.  If you need to clear it after
// setting, pass nil for obj.
- (void)setCustomParameter:(id)obj forKey:(NSString *)key GTL_NONNULL((2));

// Auto-generated request IDs
+ (NSString *)nextRequestID;

// Methods for subclasses to override.
+ (NSDictionary *)parameterNameMap;
+ (NSDictionary *)arrayPropertyToClassMap;
@end

// The library doesn't use GTLQueryCollectionImpl, but it provides a concrete implementation
// of the protocol so the methods do not cause a private method error in Xcode.
@interface GTLQueryCollectionImpl : GTLQuery <GTLQueryCollectionProtocol>
@end


text:
/**
 *
 */
package com.google.code.morphia.mapping.lazy.proxy;

import java.util.Collection;
import java.util.List;

import com.google.code.morphia.Key;

/**
 * @author Uwe Schaefer, (us@thomas-daily.de)
 *
 */
public interface ProxiedEntityReferenceList extends ProxiedReference {

	void __add(Key<?> key);
	void __addAll(Collection<? extends Key<?>> keys);

	List<Key<?>> __getKeysAsList();

}


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-map-controls',
  templateUrl: './map-controls.component.html',
  styleUrls: ['./map-controls.component.css']
})
export class MapControlsComponent implements OnInit {

  certTypes = ['All', 'Instructor'];
  radiusOptions = ['25km', '50km', '100km', 'Full'];

  constructor() { }

  ngOnInit() {
  }

}


text:
/*
 * C String Builder - https://github.com/cavaliercoder/c-stringbuilder
 *
 * sb.c is a simple, non-thread safe String Builder that makes use of a
 * dynamically-allocated linked-list to enable linear time appending and
 * concatenation.
 */

#ifndef SB_H
#define SB_H

#define SB_FAILURE				-1
#define SB_MAX_FRAG_LENGTH		4096

typedef struct _StringFragment {
	struct _StringFragment	*next;
	int						length;
	char					*str;
} StringFragment;

typedef struct _StringBuilder {
	struct _StringFragment	*root;
	struct _StringFragment	*trunk;
	int						length;
} StringBuilder;

StringBuilder	*sb_create();
int				sb_empty(StringBuilder *sb);
int				sb_append(StringBuilder *sb, const char *str);
int				sb_appendf(StringBuilder *sb, const char *format, ...);
char			*sb_concat(StringBuilder *sb);
void 			sb_reset(StringBuilder *sb);
void			sb_free(StringBuilder *sb);

#endif


text:
using System;
using System.Security;
using System.Runtime.InteropServices;

namespace ImageMagick
{
    public partial class OpenCL
    {
        [SuppressUnmanagedCodeSecurity]
        private static unsafe class NativeMethods
        {
            #if PLATFORM_x64 || PLATFORM_AnyCPU
            public static class X64
            {
                [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)]
                public static extern IntPtr OpenCL_GetDevices(out UIntPtr length);
                [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)]
                public static extern IntPtr OpenCL_GetDevice(IntPtr list, UIntPtr index);
                [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)]
                [return: MarshalAs(UnmanagedType.Bool)]
                public static extern bool OpenCL_GetEnabled();
                [DllImport(NativeLibrary.X64Name, CallingConvention = CallingConvention.Cdecl)]
                [return: MarshalAs(UnmanagedType.Bool)]
                public static extern bool OpenCL_SetEnabled([MarshalAs(UnmanagedType.Bool)] bool value);
            }
            #endif
            #if PLATFORM_arm64 || PLATFORM_AnyCPU
            public static class ARM64
            {
                [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)]
                public static extern IntPtr OpenCL_GetDevices(out UIntPtr length);
                [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)]
                public static extern IntPtr OpenCL_GetDevice(IntPtr list, UIntPtr index);
                [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)]
                [return: MarshalAs(UnmanagedType.Bool)]
                public static extern bool OpenCL_GetEnabled();
                [DllImport(NativeLibrary.ARM64Name, CallingConvention = CallingConvention.Cdecl)]
                [return: MarshalAs(UnmanagedType.Bool)]
                public static extern bool OpenCL_SetEnabled([MarshalAs(UnmanagedType.Bool)] bool value);
            }
            #endif
            #if PLATFORM_x86 || PLATFORM_AnyCPU
            public static class X86
            {
                [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)]
                public static extern IntPtr OpenCL_GetDevices(out UIntPtr length);
                [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)]
                public static extern IntPtr OpenCL_GetDevice(IntPtr list, UIntPtr index);
                [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)]
                [return: MarshalAs(UnmanagedType.Bool)]
                public static extern bool OpenCL_GetEnabled();
                [DllImport(NativeLibrary.X86Name, CallingConvention = CallingConvention.Cdecl)]
                [return: MarshalAs(UnmanagedType.Bool)]
                public static extern bool OpenCL_SetEnabled([MarshalAs(UnmanagedType.Bool)] bool value);
            }
            #endif
        }
        private unsafe static class NativeOpenCL
        {
            static NativeOpenCL() { Environment.Initialize(); }
            public static IntPtr GetDevices(out UIntPtr length)
            {
                IntPtr result;
                #if PLATFORM_AnyCPU
                if (OperatingSystem.IsArm64)
                #endif
                #if PLATFORM_arm64 || PLATFORM_AnyCPU
                result = NativeMethods.ARM64.OpenCL_GetDevices(out length);
                #endif
                #if PLATFORM_AnyCPU
                else if (OperatingSystem.Is64Bit)
                #endif
                #if PLATFORM_x64 || PLATFORM_AnyCPU
                result = NativeMethods.X64.OpenCL_GetDevices(out length);
                #endif
                #if PLATFORM_AnyCPU
                else
                #endif
                #if PLATFORM_x86 || PLATFORM_AnyCPU
                result = NativeMethods.X86.OpenCL_GetDevices(out length);
                #endif
                return result;
            }
            public static IntPtr GetDevice(IntPtr list, int index)
            {
                IntPtr result;
                #if PLATFORM_AnyCPU
                if (OperatingSystem.IsArm64)
                #endif
                #if PLATFORM_arm64 || PLATFORM_AnyCPU
                result = NativeMethods.ARM64.OpenCL_GetDevice(list, (UIntPtr)index);
                #endif
                #if PLATFORM_AnyCPU
                else if (OperatingSystem.Is64Bit)
                #endif
                #if PLATFORM_x64 || PLATFORM_AnyCPU
                result = NativeMethods.X64.OpenCL_GetDevice(list, (UIntPtr)index);
                #endif
                #if PLATFORM_AnyCPU
                else
                #endif
                #if PLATFORM_x86 || PLATFORM_AnyCPU
                result = NativeMethods.X86.OpenCL_GetDevice(list, (UIntPtr)index);
                #endif
                return result;
            }
            public static bool GetEnabled()
            {
                bool result;
                #if PLATFORM_AnyCPU
                if (OperatingSystem.IsArm64)
                #endif
                #if PLATFORM_arm64 || PLATFORM_AnyCPU
                result = NativeMethods.ARM64.OpenCL_GetEnabled();
                #endif
                #if PLATFORM_AnyCPU
                else if (OperatingSystem.Is64Bit)
                #endif
                #if PLATFORM_x64 || PLATFORM_AnyCPU
                result = NativeMethods.X64.OpenCL_GetEnabled();
                #endif
                #if PLATFORM_AnyCPU
                else
                #endif
                #if PLATFORM_x86 || PLATFORM_AnyCPU
                result = NativeMethods.X86.OpenCL_GetEnabled();
                #endif
                return result;
            }
            public static bool SetEnabled(bool value)
            {
                bool result;
                #if PLATFORM_AnyCPU
                if (OperatingSystem.IsArm64)
                #endif
                #if PLATFORM_arm64 || PLATFORM_AnyCPU
                result = NativeMethods.ARM64.OpenCL_SetEnabled(value);
                #endif
                #if PLATFORM_AnyCPU
                else if (OperatingSystem.Is64Bit)
                #endif
                #if PLATFORM_x64 || PLATFORM_AnyCPU
                result = NativeMethods.X64.OpenCL_SetEnabled(value);
                #endif
                #if PLATFORM_AnyCPU
                else
                #endif
                #if PLATFORM_x86 || PLATFORM_AnyCPU
                result = NativeMethods.X86.OpenCL_SetEnabled(value);
                #endif
                return result;
            }
        }
    }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.trino.execution.scheduler;

import io.trino.execution.Lifespan;
import io.trino.spi.connector.ConnectorPartitionHandle;
import io.trino.sql.planner.plan.PlanNodeId;

import java.util.List;

public interface SourceScheduler
{
    ScheduleResult schedule();

    void close();

    PlanNodeId getPlanNodeId();

    void startLifespan(Lifespan lifespan, ConnectorPartitionHandle partitionHandle);

    void noMoreLifespans();

    List<Lifespan> drainCompletedLifespans();
}


text:
<?php

namespace Graze\CiffRenderer\Parser\FieldParser;

use Graze\CiffRenderer\Parser\FieldParserRegistry;
use \SimpleXMLElement;

interface FieldParserInterface
{
    /**
     * @return string
     */
    public function getFieldType();

    /**
     * @return string
     */
    public function getFieldName();

    /**
     * @return int
     */
    public function getPositionX();

    /**
     * @return int
     */
    public function getPositionY();

    /**
     * @return int
     */
    public function getWidth();

    /**
     * @return int
     */
    public function getHeight();

    /**
     * @return bool
     */
    public function isDisplayed();

    /**
     * @return string
     */
    public function getText();

    /**
     * @return string
     */
    public function getDateFormat();

    /**
     * @return int
     */
    public function getFontSize();

    /**
     * @return string
     */
    public function getFontFace();

    /**
     * @return bool
     */
    public function getIsInverse();

    /**
     * @return int
     */
    public function getOrientation();

    /**
     * @return string
     */
    public function getShape();

    /**
     * @return int
     */
    public function getLineWeight();

    /**
     * @return string
     */
    public function getGraphic();

    /**
     * @return string
     */
    public function getTextAlignment();

    /**
     * @param FieldParserRegistry $fieldParserRegistry
     * @param SimpleXMLElement $xmlHeader
     * @param SimpleXMLElement $xmlField
     * @param float $scale
     * @return FieldParserInterface
     */
    public static function factory(
        FieldParserRegistry $fieldParserRegistry,
        SimpleXMLElement $xmlHeader,
        SimpleXMLElement $xmlField,
        $scale
    );
}


text:
package model;

/**
 * A class to represent a card.
 *
 * @author ben k steele
 * @author Arthur Nunes-Harwitt
 * @author Sean Strout
 */
public class Card {
    /**
     * The number on the card.
     */
    private final int number;

    /**
     * The flag indicating whether or not the card is face-up.
     */
    private boolean isFaceUp;

    /**
     * canFlip flag indicates whether the card can be flipped face-up.
     */
    private boolean canFlip;

    /**
     * Constructor is protected for use by concrete subclasses.
     *
     * @param number  the secret, hidden id of the card (for text ui)
     * @param canFlip is true if the card can be flipped face up/down.
     */

    public Card(int number, boolean canFlip) {
        this.number = number;
        this.isFaceUp = false;
        this.canFlip = canFlip;

    }

    /**
     * Create a copy of the card.
     *
     * @param other the card to copy
     */
    public Card(Card other) {
        this.number = other.number;
        this.isFaceUp = other.isFaceUp;
        this.canFlip = other.canFlip;
    }

    /**
     * @return A boolean indicating whether or not card is face-up.
     */

    public boolean isFaceUp() {
        return this.isFaceUp;
    }

    /**
     * Sets the cards face to showing (used when "cheating").
     **/
    public void setFaceUp() {
        this.isFaceUp = true;
    }

    /**
     * @return An integer that is the number on the face of the card.
     */

    public int getNumber() {
        return (this.isFaceUp() ? this.number : -1);
    }

    /**
     * Toggle the flag indicating whether or not the card is face-up.
     * It only toggles the state of the card if this card allows flipping.
     */

    public void toggleFace() {
        if (this.canFlip) {
            this.isFaceUp = !this.isFaceUp;
        }
    }

    /**
     * This method sets canFlip and toggles face up/down if canFlip is true.
     * If canFlip is false, then no card flipping is performed until
     * canFlip is a true value.
     * It only toggles the state of the card if this card allows flipping.
     *
     * @param canFlip a true value allows the card to be flipped face up.
     */

    public void toggleFace(boolean canFlip) {
        this.canFlip = canFlip;
        toggleFace();
    }
}


text:
<?php

namespace Annuaire\AnnuaireBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
/**
 * Localite
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Annuaire\AnnuaireBundle\Entity\LocaliteRepository")
 */
class Localite
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var Commune
     *
     * @ORM\ManyToOne(targetEntity="Commune", inversedBy="localites")
     * @ORM\JoinColumn(name="commune", referencedColumnName="id")
     */
    private $commune;

    /**
     * @var Codepost
     *
     * @ORM\ManyToOne(targetEntity="Codepost", inversedBy="localites")
     * @ORM\JoinColumn(name="codepost", referencedColumnName="id")
     */
    private $codepost;

    /**
     * @var
     * @ORM\Column(name="localite", type="string", length=128)
     */
    private $localite;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set localite
     *
     * @param string $localite
     *
     * @return Localite
     */
    public function setLocalite($localite)
    {
        $this->localite = $localite;

        return $this;
    }

    /**
     * Get localite
     *
     * @return string
     */
    public function getLocalite()
    {
        return $this->localite;
    }

    /**
     * Set commune
     *
     * @param \Annuaire\AnnuaireBundle\Entity\Commune $commune
     *
     * @return Localite
     */
    public function setCommune(\Annuaire\AnnuaireBundle\Entity\Commune $commune = null)
    {
        $this->commune = $commune;

        return $this;
    }

    /**
     * Get commune
     *
     * @return \Annuaire\AnnuaireBundle\Entity\Commune
     */
    public function getCommune()
    {
        return $this->commune;
    }

    /**
     * Set codepost
     *
     * @param \Annuaire\AnnuaireBundle\Entity\Codepost $codepost
     *
     * @return Localite
     */
    public function setCodepost(\Annuaire\AnnuaireBundle\Entity\Codepost $codepost = null)
    {
        $this->codepost = $codepost;

        return $this;
    }

    /**
     * Get codepost
     *
     * @return \Annuaire\AnnuaireBundle\Entity\Codepost
     */
    public function getCodepost()
    {
        return $this->codepost;
    }
}


text:
param(
    [switch]$Verbose
)

. $PSScriptRoot\Write-Status.ps1

if ($Verbose) {
    $quiet = ""
}
else {
    $quiet = "--quiet"
}

$project_root = Split-Path $PSScriptRoot

Push-Location $project_root

$venv = Join-Path $project_root "venv"
if (-Not (Test-Path $venv)) {
    Write-Status "Creating venv in $venv"
    . $PSScriptRoot\Invoke-NonVenvPython.ps1 @('-m', 'venv', $venv)
}

$already_activated = . $PSScriptRoot\Ensure-Venv.ps1

Write-Status "Updating pip"
& python -m pip install --upgrade pip $quiet
Write-Status "Updating pip-tools"
& python -m pip install --upgrade pip-tools $quiet
Write-Status "Updating requirements"
& pip-sync .\win64-py310-requirements.txt $quiet

if ($Global:console_functions) {
    # Define or update the console scripts if we want them
    . $PSScriptRoot\Console-Scripts.ps1
}

Pop-Location

if (-Not $already_activated) {
    deactivate
}


text: return require "skynet.dns"


text:
<?php

namespace PHPCI\Plugin;

use PHPCI;
use PHPCI\Builder;
use PHPCI\Model\Build;
use PHPCI\Plugin\Util\TapParser;

/**
* PHP Unit Plugin - Allows PHP Unit testing.
* @author       Dan Cryer <dan@block8.co.uk>
* @package      PHPCI
* @subpackage   Plugins
*/
class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
{
    protected $args;
    protected $phpci;
    protected $build;

    /**
     * @var string|string[] $directory The directory (or array of dirs) to run PHPUnit on
     */
    protected $directory;

    /**
     * @var string $runFrom When running PHPUnit with an XML config, the command is run from this directory
     */
    protected $runFrom;

    /**
     * @var string, in cases where tests files are in a sub path of the /tests path,
     * allows this path to be set in the config.
     */
    protected $path;

    protected $coverage = "";

    /**
     * @var string|string[] $xmlConfigFile The path (or array of paths) of an xml config for PHPUnit
     */
    protected $xmlConfigFile;

    /**
     * Check if this plugin can be executed.
     * @param $stage
     * @param Builder $builder
     * @param Build $build
     * @return bool
     */
    public static function canExecute($stage, Builder $builder, Build $build)
    {
        if ($stage == 'test' && !is_null(self::findConfigFile($builder->buildPath))) {
            return true;
        }

        return false;
    }

    /**
     * Try and find the phpunit XML config file.
     * @param $buildPath
     * @return null|string
     */
    public static function findConfigFile($buildPath)
    {
        if (file_exists($buildPath . 'phpunit.xml')) {
            return 'phpunit.xml';
        }

        if (file_exists($buildPath . 'tests/phpunit.xml')) {
            return 'tests/phpunit.xml';
        }

        if (file_exists($buildPath . 'phpunit.xml.dist')) {
            return 'phpunit.xml.dist';
        }

        if (file_exists($buildPath . 'tests/phpunit.xml.dist')) {
            return 'tests/phpunit.xml.dist';
        }

        return null;
    }

    /**
     * Standard Constructor
     *
     * $options['directory'] Output Directory. Default: %BUILDPATH%
     * $options['filename']  Phar Filename. Default: build.phar
     * $options['regexp']    Regular Expression Filename Capture. Default: /\.php$/
     * $options['stub']      Stub Content. No Default Value
     *
     * @param Builder $phpci
     * @param Build   $build
     * @param array   $options
     */
    public function __construct(Builder $phpci, Build $build, array $options = array())
    {
        $this->phpci = $phpci;
        $this->build = $build;

        if (empty($options['config']) && empty($options['directory'])) {
            $this->xmlConfigFile = self::findConfigFile($phpci->buildPath);
        }

        if (isset($options['directory'])) {
            $this->directory = $options['directory'];
        }

        if (isset($options['config'])) {
            $this->xmlConfigFile = $options['config'];
        }

        if (isset($options['run_from'])) {
            $this->runFrom = $options['run_from'];
        }

        if (isset($options['args'])) {
            $this->args = $this->phpci->interpolate($options['args']);
        }

        if (isset($options['path'])) {
            $this->path = $options['path'];
        }

        if (isset($options['coverage'])) {
            $this->coverage = " --coverage-html {$options['coverage']} ";
        }

        if (isset($options['executable'])) {
            $this->executable = $options['executable'];
        } else {
            $this->executable = $this->phpci->findBinary(array('phpunit'));
        }
    }

    /**
    * Runs PHP Unit tests in a specified directory, optionally using specified config file(s).
    */
    public function execute()
    {
        if (empty($this->xmlConfigFile) && empty($this->directory)) {
            $this->phpci->logFailure('Neither configuration file nor test directory found.');
            return false;
        }

        $success = true;

        $this->phpci->logExecOutput(false);

        // Run any config files first. This can be either a single value or an array.
        if ($this->xmlConfigFile !== null) {
            $success &= $this->runConfigFile($this->xmlConfigFile);
        }

        // Run any dirs next. Again this can be either a single value or an array.
        if ($this->directory !== null) {
            $success &= $this->runDir($this->directory);
        }

        $tapString = $this->phpci->getLastOutput();
        $tapString = mb_convert_encoding($tapString, "UTF-8", "ISO-8859-1");

        try {
            $tapParser = new TapParser($tapString);
            $output = $tapParser->parse();
        } catch (\Exception $ex) {
            $this->phpci->logFailure($tapString);
            throw $ex;
        }

        $failures = $tapParser->getTotalFailures();

        $this->build->storeMeta('phpunit-errors', $failures);
        $this->build->storeMeta('phpunit-data', $output);

        $this->phpci->logExecOutput(true);

        return $success;
    }

    /**
     * Run the tests defined in a PHPUnit config file.
     * @param $configPath
     * @return bool|mixed
     */
    protected function runConfigFile($configPath)
    {
        if (is_array($configPath)) {
            return $this->recurseArg($configPath, array($this, "runConfigFile"));
        } else {
            if ($this->runFrom) {
                $curdir = getcwd();
                chdir($this->phpci->buildPath.'/'.$this->runFrom);
            }

            $phpunit = $this->executable;

            if (!$phpunit) {
                $this->phpci->logFailure(PHPCI\Helper\Lang::get('could_not_find', 'phpunit'));
                return false;
            }

            $cmd = $phpunit . ' --tap %s -c "%s" ' . $this->coverage . $this->path;
            echo(sprintf($cmd, $this->args, $configPath));
            $success = $this->phpci->executeCommand($cmd, $this->args, $configPath);

            if ($this->runFrom) {
                chdir($curdir);
            }

            return $success;
        }
    }

    /**
     * Run the PHPUnit tests in a specific directory or array of directories.
     * @param $directory
     * @return bool|mixed
     */
    protected function runDir($directory)
    {
        if (is_array($directory)) {
            return $this->recurseArg($directory, array($this, "runDir"));
        } else {
            $curdir = getcwd();
            chdir($this->phpci->buildPath);

            $phpunit = $this->executable;

            if (!$phpunit) {
                $this->phpci->logFailure(PHPCI\Helper\Lang::get('could_not_find', 'phpunit'));
                return false;
            }

            $cmd = $phpunit . ' --tap %s "%s"';
            $success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $directory);
            chdir($curdir);
            return $success;
        }
    }

    /**
     * @param $array
     * @param $callable
     * @return bool|mixed
     */
    protected function recurseArg($array, $callable)
    {
        $success = true;
        foreach ($array as $subItem) {
            $success &= call_user_func($callable, $subItem);
        }
        return $success;
    }
}


text:
(function () {
    'use strict';

    angular.module("app.movies").factory("DemoAppService", DemoService);

    DemoService.$inject = ['$http'];

    function DemoService($http) {

        var serviceBase = "http://localhost:60472/";
        var DemoServiceFactory = {};

        var getMoviesData = function () {
            return $http.get(serviceBase + 'api/movie/get', {
                skipAuthorization: true
            }).then(function (movies) {
                return movies;
            });
        }

        var addNewMovie = function (movieModel) {
            return $http.post(serviceBase + 'api/movie/create', movieModel).then(function (newMovie) {
                return newMovie;
            })
        }

        var updateMovie = function (movieModel) {
            return $http.put(serviceBase + 'api/movie/update', movieModel).then(function (updatedMovie) {
                return updatedMovie;
            })
        }

        var deleteMovie = function (id) {
            return $http.delete(serviceBase + 'api/movie/delete?id=' + id).then(function (deletedMovie) {
                return deletedMovie;
            });
        }

        DemoServiceFactory.getMoviesData = getMoviesData;
        DemoServiceFactory.addNewMovie = addNewMovie;
        DemoServiceFactory.updateMovie = updateMovie;
        DemoServiceFactory.deleteMovie = deleteMovie;

        return DemoServiceFactory;
    }

})()