text:
namespace android.accounts
{
	[global::MonoJavaBridge.JavaInterface(typeof(global::android.accounts.AccountManagerCallback_))]
	public partial interface AccountManagerCallback  : global::MonoJavaBridge.IJavaObject
	{
		void run(android.accounts.AccountManagerFuture arg0);
	}

	[global::MonoJavaBridge.JavaProxy(typeof(global::android.accounts.AccountManagerCallback))]
	internal sealed partial class AccountManagerCallback_ : java.lang.Object, AccountManagerCallback
	{
		internal new static global::MonoJavaBridge.JniGlobalHandle staticClass;
		internal AccountManagerCallback_(global::MonoJavaBridge.JNIEnv @__env) : base(@__env)
		{
		}
		private static global::MonoJavaBridge.MethodId _m0;
		void android.accounts.AccountManagerCallback.run(android.accounts.AccountManagerFuture arg0)
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.accounts.AccountManagerCallback_.staticClass, "run", "(Landroid/accounts/AccountManagerFuture;)V", ref global::android.accounts.AccountManagerCallback_._m0, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
		}
		static AccountManagerCallback_()
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			global::android.accounts.AccountManagerCallback_.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/accounts/AccountManagerCallback"));
		}
	}

	public delegate void AccountManagerCallbackDelegate(android.accounts.AccountManagerFuture arg0);

	internal partial class AccountManagerCallbackDelegateWrapper : java.lang.Object, AccountManagerCallback
	{
		internal new static global::MonoJavaBridge.JniGlobalHandle staticClass;
		protected AccountManagerCallbackDelegateWrapper(global::MonoJavaBridge.JNIEnv @__env) : base(@__env)
		{
		}
		private static global::MonoJavaBridge.MethodId _m0;
		public AccountManagerCallbackDelegateWrapper() : base(global::MonoJavaBridge.JNIEnv.ThreadEnv)
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			if (global::android.accounts.AccountManagerCallbackDelegateWrapper._m0.native == global::System.IntPtr.Zero)
				global::android.accounts.AccountManagerCallbackDelegateWrapper._m0 = @__env.GetMethodIDNoThrow(global::android.accounts.AccountManagerCallbackDelegateWrapper.staticClass, "<init>", "()V");
			global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.accounts.AccountManagerCallbackDelegateWrapper.staticClass, global::android.accounts.AccountManagerCallbackDelegateWrapper._m0);
			Init(@__env, handle);
		}
		static AccountManagerCallbackDelegateWrapper()
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			global::android.accounts.AccountManagerCallbackDelegateWrapper.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/accounts/AccountManagerCallbackDelegateWrapper"));
		}
	}
	internal partial class AccountManagerCallbackDelegateWrapper
	{
		private AccountManagerCallbackDelegate myDelegate;
		public void run(android.accounts.AccountManagerFuture arg0)
		{
			myDelegate(arg0);
		}
		public static implicit operator AccountManagerCallbackDelegateWrapper(AccountManagerCallbackDelegate d)
		{
			global::android.accounts.AccountManagerCallbackDelegateWrapper ret = new global::android.accounts.AccountManagerCallbackDelegateWrapper();
			ret.myDelegate = d;
			global::MonoJavaBridge.JavaBridge.SetGCHandle(global::MonoJavaBridge.JNIEnv.ThreadEnv, ret);
			return ret;
		}
	}
}


text:
In this chapter, we'll be writing a `setImageLayout` method. We'll make sure to come back to `initSwapchain` later.

```cpp
void setImageLayout(VkCommandBuffer cmdBuffer, VkImage image,
                    VkImageAspectFlags aspects,
                    VkImageLayout oldLayout,
                    VkImageLayout newLayout) {}
```

This will take a `VkCommandBuffer` and a `VkImage` whose image layout we want to set. While it's not necessary to build out this method, it will be useful later on. We'll also take in two `VkImageLayout`s.

## Image Memory Barriers

In Vulkan, we have a new concept called barriers which are called `VkImageMemoryBarrier`. They make sure our operations done on the GPU occur in a particular order which assure we get the expected result. A barrier separates two operations in a queue: before the barrier and after the barrier. Work done before the barrier will always finish before it can be used again.

**Definition for `VkImageMemoryBarrier`**:

```cpp
typedef struct VkImageMemoryBarrier {
  VkStructureType            sType;
  const void*                pNext;
  VkAccessFlags              srcAccessMask;
  VkAccessFlags              dstAccessMask;
  VkImageLayout              oldLayout;
  VkImageLayout              newLayout;
  uint32_t                   srcQueueFamilyIndex;
  uint32_t                   dstQueueFamilyIndex;
  VkImage                    image;
  VkImageSubresourceRange    subresourceRange;
} VkImageMemoryBarrier;
```

**[Documentation](https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#synchronization-image-memory-barrier) for `VkImageMemoryBarrier`**:

- `sType` is the type of this structure.
- `pNext` is `NULL` or a pointer to an extension-specific structure.
- `srcAccessMask` is a mask of the classes of memory accesses performed by the first set of commands that will participate in the dependency.
- `dstAccessMask` is a mask of the classes of memory accesses performed by the second set of commands that will participate in the dependency.
- `oldLayout` describes the current layout of the image subresource(s).
- `newLayout` describes the new layout of the image subresource(s).
- `srcQueueFamilyIndex` is the queue family that is relinquishing ownership of the image subresource(s) to another queue, or `VK_QUEUE_FAMILY_IGNORED` if there is no transfer of ownership).
- `dstQueueFamilyIndex` is the queue family that is acquiring ownership of the image subresource(s) from another queue, or `VK_QUEUE_FAMILY_IGNORED` if there is no transfer of ownership).
- `image` is a handle to the image whose backing memory is affected by the barrier.
- `subresourceRange` describes an area of the backing memory for image, as well as the set of subresources whose image layouts are modified.

**Usage for `VkImageMemoryBarrier`**:

```cpp
VkImageMemoryBarrier imageBarrier = {};
imageBarrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
imageBarrier.pNext = NULL;
imageBarrier.oldLayout = oldLayout;
imageBarrier.newLayout = newLayout;
imageBarrier.image = image;
imageBarrier.subresourceRange.aspectMask = aspects;
imageBarrier.subresourceRange.baseMipLevel = 0;
imageBarrier.subresourceRange.levelCount = 1;
imageBarrier.subresourceRange.layerCount = 1;
```

Notice we left our two parts: `srcAccessMask` and `dstAccessMask`. Depending on the values `oldLayout` and `newLayout` take, we'll change how we set up our `VkImageMemoryBarrier`. Here is the way I handle the transition between the two layouts:

```cpp
switch (oldLayout) {
  case VK_IMAGE_LAYOUT_PREINITIALIZED:
    imageBarrier.srcAccessMask =
        VK_ACCESS_HOST_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT;
    break;
  case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL:
    imageBarrier.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
    break;
  case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL:
    imageBarrier.srcAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
    break;
  case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
    imageBarrier.srcAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
    break;
  case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
    imageBarrier.srcAccessMask = VK_ACCESS_SHADER_READ_BIT;
    break;
}

switch (newLayout) {
  case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL:
    imageBarrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
    break;
  case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
    imageBarrier.srcAccessMask |= VK_ACCESS_TRANSFER_READ_BIT;
    imageBarrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
    break;
  case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL:
    imageBarrier.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
    imageBarrier.srcAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
    break;
  case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL:
    imageBarrier.dstAccessMask |=
        VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
    break;
  case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
    imageBarrier.srcAccessMask =
        VK_ACCESS_HOST_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT;
    imageBarrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
    break;
}
```

While there is a `VK_IMAGE_LAYOUT_GENERAL` that will work in all cases, it's not always optimal. For example, we have different layouts meant for:

- Color attachments (framebuffer)
- Depth stencils attachments (framebuffer)
- Shader reading via sampling

Images will start as `VK_IMAGE_LAYOUT_UNDEFINED` or `VK_IMAGE_LAYOUT_PREINITIALIZED` depending on which you pick. Note that moving from `VK_IMAGE_LAYOUT_UNDEFINED` to another layout may not preserve the existing data. However, moving from `VK_IMAGE_LAYOUT_PREINITIALIZED` to another gurantees the data is preserved. The documentation says that any layout can be used for `oldLayout` while `newLayout` cannot use `VK_IMAGE_LAYOUT_UNDEFINED` or `VK_IMAGE_LAYOUT_PREINITIALIZED`. You can find the documentation I'm reading from [here](https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#synchronization-image-memory-barrier).

## Recording Commands Image Layout Commands

Before we can finish our `setImageLayout` method, we need to call `vkCmdPipelineBarrier`. This will record the command and insert our execution dependencies and memory dependencies between two sets of commands.

**Definition of `vkCmdPipelineBarrier`**:

```cpp
void vkCmdPipelineBarrier(
  VkCommandBuffer               commandBuffer,
  VkPipelineStageFlags          srcStageMask,
  VkPipelineStageFlags          dstStageMask,
  VkDependencyFlags             dependencyFlags,
  uint32_t                      memoryBarrierCount,
  const VkMemoryBarrier*        pMemoryBarriers,
  uint32_t                      bufferMemoryBarrierCount,
  const VkBufferMemoryBarrier*  pBufferMemoryBarriers,
  uint32_t                      imageMemoryBarrierCount,
  const VkImageMemoryBarrier*   pImageMemoryBarriers);
```

**[Documentation](https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCmdPipelineBarrier) for `vkCmdPipelineBarrier`**:

- `commandBuffer` is the command buffer into which the command is recorded.
- `srcStageMask` is a bitmask of `VkPipelineStageFlagBits` specifying a set of source pipeline stages.
- `dstStageMask` is a bitmask specifying a set of destination pipeline stages.
- `dependencyFlags` is a bitmask of `VkDependencyFlagBits`. The execution dependency is by-region if the mask includes VK_DEPENDENCY_BY_REGION_BIT`.
- `memoryBarrierCount` is the length of the `pMemoryBarriers` array.
- `pMemoryBarriers` is a pointer to an array of `VkMemoryBarrier` structures.
- `bufferMemoryBarrierCount` is the length of the `pBufferMemoryBarriers` array.
- `pBufferMemoryBarriers` is a pointer to an array of `VkBufferMemoryBarrier` structures.
- `imageMemoryBarrierCount` is the length of the `pImageMemoryBarriers` array.
- `pImageMemoryBarriers` is a pointer to an array of `VkImageMemoryBarrier` structures.

The only arguments we're not sure about are `srcFlags` and `dstFlags`. We know we want our execution / memory dependencies to be staged at the top of the command buffer. So, we'll use `VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT` to notify Vulkan of our intentions. You can find more information on pipeline state flags like `VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT` [here](https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#synchronization-pipeline-stage-flags).

**Usage for `vkCmdPipelineBarrier`**:

```cpp
VkPipelineStageFlagBits srcFlags = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
VkPipelineStageFlagBits dstFlags = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
vkCmdPipelineBarrier(cmdBuffer, srcFlags, dstFlags, 0, 0, NULL, 0, NULL, 1,
                     &imageBarrier);
```

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * @package Form
 */
class Kwf_Form_Field_Hidden extends Kwf_Form_Field_SimpleAbstract
{
    public function __construct($field_name = null)
    {
        parent::__construct($field_name);
        $this->setXtype('hidden');
    }
    public function getTemplateVars($values, $fieldNamePostfix = '', $idPrefix = '')
    {
        $name = $this->getFieldName();
        $value = (string)$values[$name];

        $ret = parent::getTemplateVars($values, $fieldNamePostfix, $idPrefix);

        $value = htmlspecialchars($value);
        $name = htmlspecialchars($name);
        $ret['html'] = "<input type=\"hidden\" ".
                        "name=\"$name$fieldNamePostfix\" value=\"$value\" />";
        return $ret;
    }
}


text:
<title>XT expression parsing and evaluation</title>

Expression parsing and evaluation

This package provides facilities for parsing and evaluating
XSLT expressions which include XPath expressions, template
match patterns and attribute templates.


text:
package com.rwoar.pfacalculator;

import java.io.IOException;
import java.util.LinkedList;
import java.util.ListIterator;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Typeface;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.TableRow.LayoutParams;

public class PFAUtils {

	public static String formatIntToStrTime(int time){
		int minute = getRunMinute(time);
		int second = getRunSecond(time);
		return new String(minute+":"+String.format("%02d", second));
	}

	public static int formatToIntTime(int minute, int second){
		return minute*100+second;
	}

	public static int formatStrToIntTime(String time){
		int colonLocation = time.indexOf(":");
		int minute = Integer.parseInt(time.substring(0, colonLocation));
		int second = Integer.parseInt(time.substring(colonLocation+1));
		return formatToIntTime(minute,second);
	}

	private static int getRunMinute(int time){
		return time/100;
	}

	private static int getRunSecond(int time){
		return time%100;
	}

	/**
	 * Clears all of the TableRows from a TableLayout, with the EXCEPTION
	 * of the first row! The first row should be the component category
	 * (Situps, Pushups, Run, Waist) and should therefore never be deleted.
	 * @param table
	 */
	public static void clearAfiTable(TableLayout table){
		int count = table.getChildCount();
		for (int i = 1; i < count; i++) {
			View child = table.getChildAt(i);
			if (child instanceof TableRow) ((ViewGroup) child).removeAllViews();
		}
	}

	private static TableRow generateAfiTblRow(Context context, String first, String second){
		TableRow tr = new TableRow(context);
		tr.setLayoutParams(new LayoutParams(
				LayoutParams.FILL_PARENT,
				LayoutParams.FILL_PARENT));

		LayoutParams childLp = new LayoutParams(0, LayoutParams.FILL_PARENT, 1);

		TextView amount = new TextView(context);
		amount.setText(first);
		amount.setGravity(Gravity.CENTER);
		tr.addView(amount,childLp);

		TextView score = new TextView(context);
		score.setText(second);
		score.setGravity(Gravity.CENTER);
		tr.addView(score,childLp);

		return tr;
	}

	public static void setupAfiPushupTbl(Context context, Dialog dialog, ScoreCalculator sc){
		TableLayout tl = (TableLayout)dialog.findViewById(R.id.afi_pushup_table);
		PFAUtils.clearAfiTable(tl);

		tl.addView(generateAfiTblRow(context, Integer.toString(sc.getPushupMax())+"+", Double.toString(sc.getIndividualPushupScore(sc.getPushupMax()))),new TableLayout.LayoutParams(
				LayoutParams.FILL_PARENT,
				LayoutParams.WRAP_CONTENT));

		for (int i = sc.getPushupMax()-1; i >= sc.getPushupMin(); i--){
			tl.addView(generateAfiTblRow(context, Integer.toString(i), Double.toString(sc.getIndividualPushupScore(i))),new TableLayout.LayoutParams(
					LayoutParams.FILL_PARENT,
					LayoutParams.WRAP_CONTENT));
		}

		tl.addView(generateAfiTblRow(context, "<="+Integer.toString(sc.getPushupMin()-1), Double.toString(sc.getIndividualPushupScore(sc.getPushupMin()-1))),new TableLayout.LayoutParams(
				LayoutParams.FILL_PARENT,
				LayoutParams.WRAP_CONTENT));
	}

	public static void setupAfiSitupTbl(Context context, Dialog dialog, ScoreCalculator sc){
		TableLayout tl = (TableLayout)dialog.findViewById(R.id.afi_situp_table);
		PFAUtils.clearAfiTable(tl);

		tl.addView(generateAfiTblRow(context, Integer.toString(sc.getSitupMax())+"+", Double.toString(sc.getIndividualSitupScore(sc.getSitupMax()))),new TableLayout.LayoutParams(
				LayoutParams.FILL_PARENT,
				LayoutParams.WRAP_CONTENT));

		for (int i = sc.getSitupMax()-1; i >= sc.getSitupMin(); i--){
			tl.addView(generateAfiTblRow(context, Integer.toString(i), Double.toString(sc.getIndividualSitupScore(i))),new TableLayout.LayoutParams(
					LayoutParams.FILL_PARENT,
					LayoutParams.WRAP_CONTENT));
		}

		tl.addView(generateAfiTblRow(context, "<="+Integer.toString(sc.getSitupMin()-1), Double.toString(sc.getIndividualSitupScore(sc.getSitupMin()-1))),new TableLayout.LayoutParams(
				LayoutParams.FILL_PARENT,
				LayoutParams.WRAP_CONTENT));
	}

	public static void setupAfiWaistTbl(Context context, Dialog dialog, ScoreCalculator sc){
		TableLayout tl = (TableLayout)dialog.findViewById(R.id.afi_waist_table);
		PFAUtils.clearAfiTable(tl);

		tl.addView(generateAfiTblRow(context, "<="+sc.getWaistMax(), Double.toString(sc.getIndividualWaistScore(sc.getWaistMax()))),new TableLayout.LayoutParams(
				LayoutParams.FILL_PARENT,
				LayoutParams.WRAP_CONTENT));

		for (double i = sc.getWaistMax()+.5; i <= sc.getWaistMin(); i = i+.5){
			tl.addView(generateAfiTblRow(context, Double.toString(i), Double.toString(sc.getIndividualWaistScore(i))),new TableLayout.LayoutParams(
					LayoutParams.FILL_PARENT,
					LayoutParams.WRAP_CONTENT));
		}

		tl.addView(generateAfiTblRow(context, sc.getWaistMin()+.5+"+", Double.toString(sc.getIndividualWaistScore(sc.getWaistMin()+.5))),new TableLayout.LayoutParams(
				LayoutParams.FILL_PARENT,
				LayoutParams.WRAP_CONTENT));
	}

	public static void setupAfiRunTbl(Context context, Dialog dialog, ScoreCalculator sc){
		Integer current, next;

		TableLayout tl = (TableLayout)dialog.findViewById(R.id.afi_run_table);
		PFAUtils.clearAfiTable(tl);

		LinkedList<Integer> intervals = sc.getRunIntervals();
		ListIterator<Integer> itr = (ListIterator<Integer>) intervals.iterator();

		// Check to make sure there are no intervals.
		// This should NEVER trigger
		if (!itr.hasNext()){
			try {
				throw new IOException("");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		} else {
			current = itr.next();

			tl.addView(generateAfiTblRow(context, "<="+PFAUtils.formatIntToStrTime(current.intValue()-1), Double.toString(sc.getIndividualRunScore(PFAUtils.getRunMinute(current), PFAUtils.getRunSecond(current-1)))),new TableLayout.LayoutParams(
					LayoutParams.FILL_PARENT,
					LayoutParams.WRAP_CONTENT));

			itr.previous();
		}

		while(itr.hasNext()){
			current = itr.next();

			if (!sc.passedRun(current)){
				tl.addView(generateAfiTblRow(context, ">="+PFAUtils.formatIntToStrTime(current.intValue()), Double.toString(sc.getIndividualRunScore(PFAUtils.getRunMinute(current), PFAUtils.getRunSecond(current)))),new TableLayout.LayoutParams(
						LayoutParams.FILL_PARENT,
						LayoutParams.WRAP_CONTENT));
				break;
			}

			if (itr.hasNext()){
				next = itr.next();

				tl.addView(generateAfiTblRow(context, PFAUtils.formatIntToStrTime(current.intValue())+"-"+PFAUtils.formatIntToStrTime(next.intValue()-1), Double.toString(sc.getIndividualRunScore(PFAUtils.getRunMinute(current), PFAUtils.getRunSecond(current)))),new TableLayout.LayoutParams(
						LayoutParams.FILL_PARENT,
						LayoutParams.WRAP_CONTENT));

				itr.previous();
			} else {
				tl.addView(generateAfiTblRow(context, PFAUtils.formatIntToStrTime(current.intValue()), Double.toString(sc.getIndividualRunScore(PFAUtils.getRunMinute(current), PFAUtils.getRunSecond(current)))),new TableLayout.LayoutParams(
						LayoutParams.FILL_PARENT,
						LayoutParams.WRAP_CONTENT));
			}
		}
	}
}


text:
/**
 * JavaScript for form editing completion conditions.
 *
 * @module moodle-availability_completion-form
 */
M.availability_completion = M.availability_completion || {};

/**
 * @class M.availability_completion.form
 * @extends M.core_availability.plugin
 */
M.availability_completion.form = Y.Object(M.core_availability.plugin);

/**
 * Initialises this plugin.
 *
 * @method initInner
 * @param {Array} cms Array of objects containing cmid => name
 */
M.availability_completion.form.initInner = function(cms) {
    this.cms = cms;
};

M.availability_completion.form.getNode = function(json) {
    // Create HTML structure.
    var html = ' ' + M.util.get_string('title', 'availability_completion') + '' +
               ' ' +
            '' + M.util.get_string('label_cm', 'availability_completion') + ' ' +
            '<select class="custom-select" name="cm" title="' + M.util.get_string('label_cm', 'availability_completion') + '">' +
            '<option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
    for (var i = 0; i < this.cms.length; i++) {
        var cm = this.cms[i];
        // String has already been escaped using format_string.
        html += '<option value="' + cm.id + '">' + cm.name + '</option>';
    }
    html += '</select> ' +
                M.util.get_string('label_completion', 'availability_completion') +
            ' <select class="custom-select" ' +
                            'name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
            '<option value="1">' + M.util.get_string('option_complete', 'availability_completion') + '</option>' +
            '<option value="0">' + M.util.get_string('option_incomplete', 'availability_completion') + '</option>' +
            '<option value="2">' + M.util.get_string('option_pass', 'availability_completion') + '</option>' +
            '<option value="3">' + M.util.get_string('option_fail', 'availability_completion') + '</option>' +
            '</select>';
    var node = Y.Node.create('' + html + '');

    // Set initial values.
    if (json.cm !== undefined &&
            node.one('select[name=cm] > option[value=' + json.cm + ']')) {
        node.one('select[name=cm]').set('value', '' + json.cm);
    }
    if (json.e !== undefined) {
        node.one('select[name=e]').set('value', '' + json.e);
    }

    // Add event handlers (first time only).
    if (!M.availability_completion.form.addedEvents) {
        M.availability_completion.form.addedEvents = true;
        var root = Y.one('.availability-field');
        root.delegate('change', function() {
            // Whichever dropdown changed, just update the form.
            M.core_availability.form.update();
        }, '.availability_completion select');
    }

    return node;
};

M.availability_completion.form.fillValue = function(value, node) {
    value.cm = parseInt(node.one('select[name=cm]').get('value'), 10);
    value.e = parseInt(node.one('select[name=e]').get('value'), 10);
};

M.availability_completion.form.fillErrors = function(errors, node) {
    var cmid = parseInt(node.one('select[name=cm]').get('value'), 10);
    if (cmid === 0) {
        errors.push('availability_completion:error_selectcmid');
    }
};


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
let defaultLogger = {
    log: () => { },
    error: () => { }
};
//# sourceMappingURL=queryAbleInterface.js.map


text:
package jp.bizreach.example.solr.client.bs;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import jp.bizreach.example.solr.base.AppSolrException;
import jp.bizreach.example.solr.base.SolrFacetResultBean;
import jp.bizreach.example.solr.base.SolrPagingResultBean;
import jp.bizreach.example.solr.base.AbstractSolrClient;
import jp.bizreach.example.solr.bean.ex.MemberSolrBean;
import jp.bizreach.example.solr.condition.ex.MemberSolrConditionBean;
import jp.bizreach.example.solr.index.ex.MemberSolrIndexBean;
import jp.bizreach.example.solr.query.ex.MemberSolrQueryBean;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrQuery.SortClause;
import org.apache.solr.client.solrj.SolrRequest.METHOD;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.impl.LBHttpSolrServer;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.seasar.dbflute.cbean.PagingResultBean;

/**
 * Solr検索ClientのBaseクラス
 * string, tint, tlong, tdate, tdouble, text_ja, text_cjkのみに対応しています
 * @author FreeGen
 */
public class BsMemberSolrClient extends AbstractSolrClient {

	Log logger = LogFactory.getLog(BsMemberSolrClient.class);

	/**
	 * Solrへの件数取得クエリ発行
	 */
	public int selectCount(MemberSolrConditionBean conditionBean) {
		if (conditionBean == null) {
			throw new IllegalArgumentException("conditionBeanがnullです");
		}

		SolrQuery query = conditionBean.buildSolrQuery();

		query.setStart(0);
		query.setRows(0);

		if (logger.isDebugEnabled()) {
			logger.debug(conditionBean);
		}

		SolrServer solrServer = getSelectSolrServer();
		int numFound;
		try {
			QueryResponse rsp = solrServer.query(query, METHOD.POST);
			numFound = (int) rsp.getResults().getNumFound();
		} catch (SolrServerException e) {
			throw new AppSolrException("Solrアクセス時(Select)にエラーが発生しました", e);
		}

		return numFound;
	}

	/**
	 * Solrへの検索クエリ発行
	 * @param conditionBean
	 * @return
	 */
	public SolrPagingResultBean<MemberSolrBean> selectPage(MemberSolrConditionBean conditionBean) {
		if (conditionBean == null) {
			throw new IllegalArgumentException("conditionBeanがnullです");
		}

		SolrQuery query = conditionBean.buildSolrQuery();

		if (logger.isDebugEnabled()) {
			logger.debug(conditionBean);
		}

		SolrServer solrServer = getSelectSolrServer();

		SolrPagingResultBean<MemberSolrBean> pagingResult = new SolrPagingResultBean<MemberSolrBean>();
		try {
			QueryResponse rsp = solrServer.query(query, METHOD.POST);
			List<MemberSolrBean> selectList = rsp.getBeans(MemberSolrBean.class);
			pagingResult.setSelectedList(selectList);
			pagingResult.setPageRangeSize(5);
			pagingResult.setPageSize(conditionBean.getPageSize());
			pagingResult.setCurrentPageNumber(conditionBean.getPageNumer());
			long numFound = rsp.getResults().getNumFound();
			pagingResult.setAllRecordCount((int) numFound);
			pagingResult.setQueryTime(rsp.getQTime());
			pagingResult.setQueryString(query.toString());
		} catch (SolrServerException e) {
			throw new AppSolrException("Solrアクセス時(Select)にエラーが発生しました", e);
		}

		return pagingResult;
	}

	/**
	 * Solrへのファセットクエリー発行

	 * facet.queryにクエリーを複数指定します。

	 *
	 * @param conditionBean Query文字列をKeyにしたMapです。QueryBeanのgetQueryString()を利用して比較してください。
	 */
	public SolrFacetResultBean selectFacetQuery(MemberSolrConditionBean conditionBean) {
		if (conditionBean == null) {
			throw new IllegalArgumentException("conditionBeanがnullです");
		}

		if (!conditionBean.isFacetQuery()) {
			throw new IllegalArgumentException("conditionBeanにFacetQueryが設定されていません");
		}

		SolrQuery query = conditionBean.buildSolrQuery();

		query.setStart(0);
		query.setRows(0);

		if (logger.isDebugEnabled()) {
			logger.debug(conditionBean);
		}

		SolrFacetResultBean resultBean = new SolrFacetResultBean();

		SolrServer solrServer = getSelectSolrServer();
		try {
			QueryResponse rsp = solrServer.query(query, METHOD.POST);
			resultBean.setFacetResult(rsp.getFacetQuery());
			resultBean.setQueryString(query.toString());
			resultBean.setQueryTime(rsp.getQTime());
			return resultBean;
		} catch (SolrServerException e) {
			throw new AppSolrException("Solrアクセス時(Select)にエラーが発生しました", e);
		}
	}

	public <RESULT_BEAN> SolrPagingResultBean<RESULT_BEAN> selectPage(MemberSolrConditionBean conditionBean,
			Class<RESULT_BEAN> clazz) {
		if (conditionBean == null) {
			throw new IllegalArgumentException("conditionBeanがnullです");
		}

		SolrQuery query = conditionBean.buildSolrQuery();

		SolrServer solrServer = getSelectSolrServer();

		if (logger.isDebugEnabled()) {
			logger.debug(conditionBean);
		}
		SolrPagingResultBean<RESULT_BEAN> pagingResult = new SolrPagingResultBean<RESULT_BEAN>();
		try {
			QueryResponse rsp = solrServer.query(query, METHOD.POST);
			List<RESULT_BEAN> selectList = rsp.getBeans(clazz);

			pagingResult.setSelectedList(selectList);
			pagingResult.setPageRangeSize(5);
			pagingResult.setPageSize(conditionBean.getPageSize());
			pagingResult.setCurrentPageNumber(conditionBean.getPageNumer());
			long numFound = rsp.getResults().getNumFound();
			pagingResult.setAllRecordCount((int) numFound);
			pagingResult.setQueryTime(rsp.getQTime());
			pagingResult.setQueryString(query.toString());
		} catch (SolrServerException e) {
			throw new AppSolrException("Solrアクセス時(Select)にエラーが発生しました", e);
		}

		return pagingResult;
	}

	/**
	 * すべてのIndexを削除します。
	 */
	public void deleteAllIndex() {
		HttpSolrServer solrServer = getMasterSolrServer();
		try {
			solrServer.deleteByQuery("*:*");
		} catch (SolrServerException e) {
			throw new AppSolrException("SolrIndex削除(" + "*:*" + ")時にエラーが発生しました。", e);
		} catch (IOException e) {
			throw new AppSolrException("SolrIndex削除(" + "*:*" + ")時にエラーが発生しました。", e);
		}
	}

	public void deleteById(Object id) {
		HttpSolrServer solrServer = getMasterSolrServer();
		try {
			solrServer.deleteByQuery("id:" + id);
		} catch (SolrServerException e) {
			throw new AppSolrException("SolrIndex削除(" + "id:" + id + ")時にエラーが発生しました。", e);
		} catch (IOException e) {
			throw new AppSolrException("SolrIndex削除(" + "id:" + id + ")時にエラーが発生しました。", e);
		}
	}

	public void addSolrIndexBeans(List<MemberSolrIndexBean> beans) {
		if (beans == null || beans.isEmpty()) {
			return;
		}
		HttpSolrServer solrServer = getMasterSolrServer();
		try {
			solrServer.addBeans(beans);
		} catch (SolrServerException e) {
			throw new AppSolrException("SolrIndex登録時にエラーが発生しました。", e);
		} catch (IOException e) {
			throw new AppSolrException("SolrIndex登録時にエラーが発生しました。", e);
		}
	}

	public void commit() {
		HttpSolrServer solrServer = getMasterSolrServer();
		try {
			solrServer.commit();
		} catch (SolrServerException e) {
			throw new AppSolrException("SolrIndex Commit時にエラーが発生しました。", e);
		} catch (IOException e) {
			throw new AppSolrException("SolrIndex Commit時にエラーが発生しました。", e);
		}
	}

    // ===================================================================================
    //                                                            Gettter of SolrFieldName
    //                                                            ========================
	public String[] getSolrFieldNames() {
		String[] fieldNames = {
				"id"
, "member_id"
, "member_status_cd"
, "member_name"
, "member_account"
, "birthdate"
, "formalized_datetime"
, "purchase_id"
, "product_id"
, "product_name"
, "product_category_code"
, "product_category_name"
		};
		return fieldNames;
	}

}


text:
package mil.nga.giat.geowave.adapter.vector.ingest;

import com.beust.jcommander.ParametersDelegate;

import mil.nga.giat.geowave.core.ingest.spi.IngestFormatOptionProvider;

/**
 * This class is a holder class for options used in AbstractSimpleFeatureIngest.
 */
public class SimpleFeatureIngestOptions implements
		IngestFormatOptionProvider
{

	@ParametersDelegate
	private CQLFilterOptionProvider cqlFilterOptionProvider = new CQLFilterOptionProvider();

	@ParametersDelegate
	private TypeNameOptionProvider typeNameOptionProvider = new TypeNameOptionProvider();

	@ParametersDelegate
	private FeatureSerializationOptionProvider serializationFormatOptionProvider = new FeatureSerializationOptionProvider();

	@ParametersDelegate
	private Object pluginOptions = null;

	public SimpleFeatureIngestOptions() {}

	public CQLFilterOptionProvider getCqlFilterOptionProvider() {
		return cqlFilterOptionProvider;
	}

	public void setCqlFilterOptionProvider(
			CQLFilterOptionProvider cqlFilterOptionProvider ) {
		this.cqlFilterOptionProvider = cqlFilterOptionProvider;
	}

	public TypeNameOptionProvider getTypeNameOptionProvider() {
		return typeNameOptionProvider;
	}

	public void setTypeNameOptionProvider(
			TypeNameOptionProvider typeNameOptionProvider ) {
		this.typeNameOptionProvider = typeNameOptionProvider;
	}

	public FeatureSerializationOptionProvider getSerializationFormatOptionProvider() {
		return serializationFormatOptionProvider;
	}

	public void setSerializationFormatOptionProvider(
			FeatureSerializationOptionProvider serializationFormatOptionProvider ) {
		this.serializationFormatOptionProvider = serializationFormatOptionProvider;
	}

	public Object getPluginOptions() {
		return pluginOptions;
	}

	public void setPluginOptions(
			Object pluginOptions ) {
		this.pluginOptions = pluginOptions;
	}
}


text:
ssh 172.16.67.229 "killall -KILL java ; service bamboo-agent restart" &
ssh 172.16.67.230 "killall -KILL java ; service bamboo-agent restart" &
ssh 172.16.67.231 "killall -KILL java ; service bamboo-agent restart" &
ssh 172.16.67.232 "killall -KILL java ; service bamboo-agent restart" &
ssh 172.16.67.233 "killall -KILL java ; service bamboo-agent restart" &
ssh 172.16.67.234 "killall -KILL java ; service bamboo-agent restart" &
ssh 172.16.67.249 "killall -KILL java ; service bamboo-agent restart" &

wait && echo "Done !"


text:
require 'fpm/cookery/source_handler/template'
require 'fpm/cookery/log'
require 'fileutils'
require 'pry'

module FPM
  module Cookery
    class SourceHandler
      class Glob < FPM::Cookery::SourceHandler::Template
        CHECKSUM = false
        NAME = :glob

        def fetch(config = {})
          Dir.glob(source.path).each do |file|
            cached_file = File.join(@cachedir,file)
            if File.exist? cached_file
              Log.info "Using cached file #{cached_file}"
            else
              Log.info "Copying #{file} to cache"
              FileUtils.cp_r(file, cachedir)
            end
          end
          local_path
        end

        def extract(config = {})
          Dir.chdir(builddir) do
            Dir.glob(local_path).each do |file|
	    case File.extname file
            when '.bz2', '.gz', '.tgz', '.xz'
              safesystem('tar', 'xf', file)
            when '.shar', '.bin'
              File.chmod(0755, file)
              safesystem(file)
            when '.zip'
              safesystem('unzip', '-d', file.basename(file,'.zip'), file)
            else
              FileUtils.cp_r(file, builddir)
            end
          end
          builddir
          end
        end
      end
    end
  end
end


text:
import { Injectable } from '@angular/core';
import { Headers, Http } from '@angular/http';
import { Uf }           from './uf.model';
import { Observable }     from 'rxjs/Observable';

@Injectable()
export class CepService {
  title = 'Cep';

  constructor(private http:Http){}

  listaUf(): Observable<Uf[]>{
    return  this.http.get('api/uf').map(
        (res) => {
            let body = res.json();
            return body as Uf[];
        }
    );
    };

}


text:
package v1beta1

import (
	"fmt"
	"strings"

	jsonpatch "github.com/evanphx/json-patch"
	"github.com/golang/glog"
	"github.com/pkg/errors"
	"github.com/spf13/pflag"
	"k8s.io/api/admissionregistration/v1beta1"
	kerr "k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/api/meta"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/apimachinery/pkg/util/wait"
	"k8s.io/client-go/dynamic"
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/rest"
	apiregistration "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1"
	apireg_cs "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
	kutil "kmodules.xyz/client-go"
	apireg_util "kmodules.xyz/client-go/apiregistration/v1beta1"
	core_util "kmodules.xyz/client-go/core/v1"
	"kmodules.xyz/client-go/discovery"
	dynamic_util "kmodules.xyz/client-go/dynamic"
	meta_util "kmodules.xyz/client-go/meta"
)

func init() {
	pflag.BoolVar(&bypassValidatingWebhookXray, "bypass-validating-webhook-xray", bypassValidatingWebhookXray, "if true, bypasses validating webhook xray checks")
}

const (
	KeyAdmissionWebhookActive = "admission-webhook.appscode.com/active"
	KeyAdmissionWebhookStatus = "admission-webhook.appscode.com/status"
)

var bypassValidatingWebhookXray = false

var ErrMissingKind = errors.New("test object missing kind")
var ErrMissingVersion = errors.New("test object missing version")
var ErrWebhookNotActivated = errors.New("Admission webhooks are not activated. Enable it by configuring --enable-admission-plugins flag of kube-apiserver. For details, visit: https://appsco.de/kube-apiserver-webhooks")

type ValidatingWebhookXray struct {
	config    *rest.Config
	apisvc    string
	testObj   runtime.Object
	op        v1beta1.OperationType
	transform func(_ runtime.Object)
	stopCh    <-chan struct{}
}

func NewCreateValidatingWebhookXray(config *rest.Config, apisvc string, testObj runtime.Object, stopCh <-chan struct{}) *ValidatingWebhookXray {
	return &ValidatingWebhookXray{
		config:    config,
		apisvc:    apisvc,
		testObj:   testObj,
		op:        v1beta1.Create,
		transform: nil,
		stopCh:    stopCh,
	}
}

func NewUpdateValidatingWebhookXray(config *rest.Config, apisvc string, testObj runtime.Object, transform func(_ runtime.Object), stopCh <-chan struct{}) *ValidatingWebhookXray {
	return &ValidatingWebhookXray{
		config:    config,
		apisvc:    apisvc,
		testObj:   testObj,
		op:        v1beta1.Update,
		transform: transform,
		stopCh:    stopCh,
	}
}

func NewDeleteValidatingWebhookXray(config *rest.Config, apisvc string, testObj runtime.Object, transform func(_ runtime.Object), stopCh <-chan struct{}) *ValidatingWebhookXray {
	return &ValidatingWebhookXray{
		config:    config,
		apisvc:    apisvc,
		testObj:   testObj,
		op:        v1beta1.Delete,
		transform: transform,
		stopCh:    stopCh,
	}
}

func retry(err error) error {
	if err == nil ||
		strings.HasPrefix(err.Error(), "Internal error occurred: failed calling admission webhook") ||
		strings.HasPrefix(err.Error(), "Internal error occurred: failed calling webhook") || // https://github.com/kubernetes/kubernetes/pull/70060/files
		kerr.IsNotFound(err) ||
		kerr.IsServiceUnavailable(err) ||
		kerr.IsTimeout(err) ||
		kerr.IsServerTimeout(err) ||
		kerr.IsTooManyRequests(err) {
		return nil
	}
	return err
}

func (d ValidatingWebhookXray) IsActive() error {
	kc := kubernetes.NewForConfigOrDie(d.config)
	apireg := apireg_cs.NewForConfigOrDie(d.config)

	if bypassValidatingWebhookXray {
		apisvc, err := apireg.ApiregistrationV1beta1().APIServices().Get(d.apisvc, metav1.GetOptions{})
		if err == nil {
			d.updateAPIService(apireg, apisvc, nil)
		}
		return nil
	}

	attempt := 0
	var failures []string
	return wait.PollImmediateUntil(kutil.RetryInterval, func() (bool, error) {
		apisvc, err := apireg.ApiregistrationV1beta1().APIServices().Get(d.apisvc, metav1.GetOptions{})
		if err != nil {
			return false, retry(err)
		}
		for _, cond := range apisvc.Status.Conditions {
			if cond.Type == apiregistration.Available && cond.Status == apiregistration.ConditionTrue {
				// Kubernetes is slow to update APIService.status. So, we double check that the pods are running and ready.
				if apisvc.Spec.Service != nil {
					svc, err := kc.CoreV1().Services(apisvc.Spec.Service.Namespace).Get(apisvc.Spec.Service.Name, metav1.GetOptions{})
					if err != nil {
						return false, retry(err)
					}

					pods, err := kc.CoreV1().Pods(apisvc.Spec.Service.Namespace).List(metav1.ListOptions{
						LabelSelector: labels.SelectorFromSet(svc.Spec.Selector).String(),
					})
					if err != nil {
						return false, retry(err)
					}
					if len(pods.Items) == 0 {
						return false, nil
					}
					for _, pod := range pods.Items {
						ready, _ := core_util.PodRunningAndReady(pod)
						if !ready {
							return false, nil
						}
					}
				}
				attempt++
				active, err := d.check()
				if err != nil {
					failures = append(failures, fmt.Sprintf("Attempt %d to detect ValidatingWebhook activation failed due to %s", attempt, err.Error()))
				}
				err = retry(err)
				if active || err != nil {
					d.updateAPIService(apireg, apisvc, err)
				}
				if err != nil {
					// log failures only if xray fails, otherwise don't confuse users with intermediate failures.
					for _, msg := range failures {
						glog.Warningln(msg)
					}
				}
				return active, err
			}
		}
		return false, nil
	}, d.stopCh)
}

func (d ValidatingWebhookXray) updateAPIService(apireg apireg_cs.Interface, apisvc *apiregistration.APIService, err error) error {
	fn := func(annotations map[string]string) map[string]string {
		if len(annotations) == 0 {
			annotations = map[string]string{}
		}
		if err == nil {
			annotations[KeyAdmissionWebhookActive] = "true"
			annotations[KeyAdmissionWebhookStatus] = ""
		} else {
			annotations[KeyAdmissionWebhookActive] = "false"
			annotations[KeyAdmissionWebhookStatus] = string(kerr.ReasonForError(err)) + "|" + err.Error()
		}
		return annotations
	}

	_, _, e3 := apireg_util.PatchAPIService(apireg, apisvc, func(in *apiregistration.APIService) *apiregistration.APIService {
		data, ok := in.Annotations[meta_util.LastAppliedConfigAnnotation]
		if ok {
			u, e2 := runtime.Decode(unstructured.UnstructuredJSONScheme, []byte(data))
			if e2 != nil {
				goto LastAppliedConfig
			}
			m, e2 := meta.Accessor(u)
			if e2 != nil {
				goto LastAppliedConfig
			}
			m.SetAnnotations(fn(m.GetAnnotations()))
			if mod, err := runtime.Encode(unstructured.UnstructuredJSONScheme, u); err == nil {
				in.Annotations[meta_util.LastAppliedConfigAnnotation] = string(mod)
			}
		}

	LastAppliedConfig:
		in.Annotations = fn(in.Annotations)
		return in
	})
	return e3
}

func (d ValidatingWebhookXray) check() (bool, error) {
	kc, err := kubernetes.NewForConfig(d.config)
	if err != nil {
		return false, err
	}

	dc, err := dynamic.NewForConfig(d.config)
	if err != nil {
		return false, err
	}

	gvk := d.testObj.GetObjectKind().GroupVersionKind()
	if gvk.Version == "" {
		return false, ErrMissingVersion
	}
	if gvk.Kind == "" {
		return false, ErrMissingKind
	}

	gvr, err := discovery.ResourceForGVK(kc.Discovery(), gvk)
	if err != nil {
		return false, err
	}
	glog.Infof("testing ValidatingWebhook using an object with GVR = %s", gvr.String())

	accessor, err := meta.Accessor(d.testObj)
	if err != nil {
		return false, err
	}

	var ri dynamic.ResourceInterface
	if accessor.GetNamespace() != "" {
		ri = dc.Resource(gvr).Namespace(accessor.GetNamespace())
	} else {
		ri = dc.Resource(gvr)
	}

	objJson, err := json.Marshal(d.testObj)
	if err != nil {
		return false, err
	}

	u := unstructured.Unstructured{}
	_, _, err = unstructured.UnstructuredJSONScheme.Decode(objJson, nil, &u)
	if err != nil {
		return false, err
	}

	if d.op == v1beta1.Create {
		_, err := ri.Create(&u, metav1.CreateOptions{})
		if kutil.AdmissionWebhookDeniedRequest(err) {
			glog.V(10).Infof("failed to create invalid test object as expected with error: %s", err)
			return true, nil
		} else if err != nil {
			return false, err
		}

		dynamic_util.WaitUntilDeleted(ri, d.stopCh, accessor.GetName())
		return false, ErrWebhookNotActivated
	} else if d.op == v1beta1.Update {
		_, err := ri.Create(&u, metav1.CreateOptions{})
		if err != nil {
			return false, err
		}

		mod := d.testObj.DeepCopyObject()
		d.transform(mod)
		modJson, err := json.Marshal(mod)
		if err != nil {
			return false, err
		}

		patch, err := jsonpatch.CreateMergePatch(objJson, modJson)
		if err != nil {
			return false, err
		}

		_, err = ri.Patch(accessor.GetName(), types.MergePatchType, patch, metav1.PatchOptions{})
		defer dynamic_util.WaitUntilDeleted(ri, d.stopCh, accessor.GetName())

		if kutil.AdmissionWebhookDeniedRequest(err) {
			glog.V(10).Infof("failed to update test object as expected with error: %s", err)
			return true, nil
		} else if err != nil {
			return false, err
		}

		return false, ErrWebhookNotActivated
	} else if d.op == v1beta1.Delete {
		_, err := ri.Create(&u, metav1.CreateOptions{})
		if err != nil {
			return false, err
		}

		err = ri.Delete(accessor.GetName(), &metav1.DeleteOptions{})
		if kutil.AdmissionWebhookDeniedRequest(err) {
			defer func() {
				// update to make it valid
				mod := d.testObj.DeepCopyObject()
				d.transform(mod)
				modJson, err := json.Marshal(mod)
				if err != nil {
					return
				}

				patch, err := jsonpatch.CreateMergePatch(objJson, modJson)
				if err != nil {
					return
				}

				ri.Patch(accessor.GetName(), types.MergePatchType, patch, metav1.PatchOptions{})

				// delete
				dynamic_util.WaitUntilDeleted(ri, d.stopCh, accessor.GetName())
			}()

			glog.V(10).Infof("failed to delete test object as expected with error: %s", err)
			return true, nil
		} else if err != nil {
			return false, err
		}
		return false, ErrWebhookNotActivated
	}

	return false, nil
}


text:
'use strict';

/**
 * Module dependencies.
 */
 var mongoose = require('mongoose'),
 Schema = mongoose.Schema;

/**
 * Photo Schema
 */
 var PhotoSchema = new Schema({
 	name:{
 		type:String
 	},
 	extension:{
 		type:String
 	},
 	size:{
 		type:Number
 	},
 	url:{
 		type:String
 	},
 	user:{
 		type:Schema.ObjectId,
 		ref:'User'
 	},
 	created: {
 		type: Date,
 		default: Date.now
 	}
 });

 mongoose.model('Photo', PhotoSchema);


text:
import React from 'react';
import { mount } from 'enzyme';
import { DropdownItem } from '../';
import { DropdownContext } from '../DropdownContext';

describe('DropdownItem', () => {
  let isOpen;
  let toggle;

  beforeEach(() => {
    isOpen = false;
    toggle = () => { isOpen = !isOpen; };
  });

  it('should render a single child', () => {
    const wrapper = mount(<DropdownItem>Ello world</DropdownItem>);

    expect(wrapper.text()).toBe('Ello world');
    expect(wrapper.find('button').hostNodes().hasClass('dropdown-item')).toBe(true);
    expect(wrapper.find('button').hostNodes().length).toBe(1);
  });

  it('should render type as "button" by default when tag is "button"', () => {
    const wrapper = mount(<DropdownItem>Home</DropdownItem>);

    expect(wrapper.find('button').hostNodes().prop('type')).toBe('button');
    expect(wrapper.text()).toBe('Home');
  });

  it('should render type as undefined by default when tag is "button" and toggle is false', () => {
    const wrapper = mount(<DropdownItem toggle={false}>Home</DropdownItem>);

    expect(wrapper.find('button').hostNodes().prop('type')).toBe(undefined);
    expect(wrapper.text()).toBe('Home');
  });

  it('should render type as "button" by default when tag is "button" and onClick is provided', () => {
    const wrapper = mount(<DropdownItem onClick={() => {}}>Home</DropdownItem>);

    expect(wrapper.find('button').hostNodes().prop('type')).toBe('button');
    expect(wrapper.text()).toBe('Home');
  });

  it('should render type as user defined when defined by the user', () => {
    const wrapper = mount(<DropdownItem type="submit">Home</DropdownItem>);

    expect(wrapper.find('button').hostNodes().prop('type')).toBe('submit');
    expect(wrapper.text()).toBe('Home');
  });

  it('should not render type by default when the type is not defined and the tag is not "button"', () => {
    const wrapper = mount(<DropdownItem tag="a">Home</DropdownItem>);

    expect(wrapper.find('a').hostNodes().prop('type')).toBe(undefined);
    expect(wrapper.text()).toBe('Home');
  });

  it('should render custom element', () => {
    const Link = props => {props.children};
    const wrapper = mount(<DropdownItem tag={Link}>Home</DropdownItem>);

    expect(wrapper.find('a').hostNodes().length).toBe(1);
    expect(wrapper.find('a').hostNodes().hasClass('dropdown-item')).toBe(true);
    expect(wrapper.text()).toBe('Home');
  });

  it('should render dropdown item text', () => {
    const wrapper = mount(<DropdownItem text>text</DropdownItem>);

    expect(wrapper.find('span').hostNodes().length).toBe(1);
    expect(wrapper.find('span').hostNodes().hasClass('dropdown-item-text')).toBe(true);
    expect(wrapper.text()).toBe('text');
  });

  describe('header', () => {
    it('should render h6 tag heading', () => {
      const wrapper = mount(<DropdownItem header>Heading</DropdownItem>);

      expect(wrapper.find('h6').hostNodes().length).toBe(1);
      expect(wrapper.find('h6').hostNodes().hasClass('dropdown-header')).toBe(true);
      expect(wrapper.text()).toBe('Heading');
    });
  });

  describe('active', () => {
    it('should render an active class', () => {
      const wrapper = mount(<DropdownItem active />);

      expect(wrapper.find('.active').hostNodes().length).toBe(1);
    });
  });

  describe('divider', () => {
    it('should render a divider element', () => {
      const wrapper = mount(<DropdownItem divider />);

      expect(wrapper.find('.dropdown-divider').hostNodes().length).toBe(1);
    });
  });

  describe('link (with href)', () => {
    it('should render an anchor tag', () => {
      const wrapper = mount(<DropdownItem href="#">GO!</DropdownItem>);

      expect(wrapper.find('a').hostNodes().length).toBe(1);
      expect(wrapper.find('a').hostNodes().hasClass('dropdown-item')).toBe(true);
      expect(wrapper.text()).toBe('GO!');
    });
  });

  describe('onClick', () => {
    it('should not be called when disabled', () => {
      const e = { preventDefault: jest.fn() };
      const wrapper = mount(<DropdownItem disabled>Item</DropdownItem>);
      const instance = wrapper.instance();

      instance.onClick(e);
      expect(e.preventDefault).toHaveBeenCalled();
    });

    it('should not be called when divider is set', () => {
      const e = { preventDefault: jest.fn() };
      const wrapper = mount(<DropdownItem divider />);
      const instance = wrapper.instance();

      instance.onClick(e);
      expect(e.preventDefault).toHaveBeenCalled();
    });

    it('should not be called when header item', () => {
      const e = { preventDefault: jest.fn() };
      const wrapper = mount(<DropdownItem header>Header</DropdownItem>);
      const instance = wrapper.instance();

      instance.onClick(e);
      expect(e.preventDefault).toHaveBeenCalled();
    });

    it('should be called when not disabled, heading, or divider', () => {
      const e = { preventDefault: jest.fn() };
      const onClick = jest.fn();
      const wrapper = mount(
        <DropdownContext.Provider value={{ toggle: toggle }}>
          <DropdownItem onClick={() => onClick()}>Click me</DropdownItem>
        </DropdownContext.Provider>
      );
      const instance = wrapper.instance();

      instance.onClick(e);
      expect(onClick).toHaveBeenCalled();
    });

    it('should call onClick prop', () => {
      toggle = jest.fn();
      const clickHandler = jest.fn();
      const wrapper = mount(
        <DropdownContext.Provider value={{ toggle: toggle }}>
          <DropdownItem onClick={clickHandler}>Click me</DropdownItem>
        </DropdownContext.Provider>
      );

      wrapper.simulate('click');
      expect(clickHandler).toHaveBeenCalled();
      expect(toggle).toHaveBeenCalled();
    });

    it('should call toggle', () => {
      toggle = jest.fn();
      const wrapper = mount(
        <DropdownContext.Provider value={{ toggle: toggle }}>
          <DropdownItem>Click me</DropdownItem>
        </DropdownContext.Provider>
      );

      wrapper.simulate('click');
      expect(toggle).toHaveBeenCalled();
    });
  });
});


text:
from setuptools import setup, find_packages
setup(
    name = "HexClient",
    version = "0.1.2",
    #packages = find_packages(),
    py_modules = ['hex_client', 'hex_connection', 'spellbook'],
    scripts = ['hex_client'],

    # Project uses reStructuredText, so ensure that the docutils get
    # installed or upgraded on the target machine
    install_requires = [
        'requests',
        'sphinx'
    ],

    package_data = {
        # If any package contains *.txt or *.rst files, include them:
        '': ['*.txt', '*.rst']
        # And include any *.msg files found in the 'hello' package, too:
        #'hello': ['*.msg'],
    },

    # metadata for upload to PyPI
    author = "Chris Proctor",
    author_email = "chris.proctor@gmail.com",
    description = "A client for casting spells on the hex",
    license = "MIT",
    keywords = "",
    url = "http://mrproctor.net",   # project home page, if any

)


text:
ROSFlask
========

A simple Flask server that runs in a ROS node


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="dismiss">Dismiss</string>
</resources>


text:
extern zend_class_entry *test_testinterface_ce;

ZEPHIR_INIT_CLASS(Test_TestInterface);


text:
/*
 * Listening socket file number
 */
#define FCGI_LISTENSOCK_FILENO 0

typedef struct {
  unsigned char version;
  unsigned char type;
  unsigned char requestIdB1;
  unsigned char requestIdB0;
  unsigned char contentLengthB1;
  unsigned char contentLengthB0;
  unsigned char paddingLength;
  unsigned char reserved;
} FCGI_Header;

/*
 * Number of bytes in a FCGI_Header.  Future versions of the protocol
 * will not reduce this number.
 */
#define FCGI_HEADER_LEN 8

/*
 * Value for version component of FCGI_Header
 */
#define FCGI_VERSION_1 1

/*
 * Values for type component of FCGI_Header
 */
#define FCGI_BEGIN_REQUEST 1
#define FCGI_ABORT_REQUEST 2
#define FCGI_END_REQUEST 3
#define FCGI_PARAMS 4
#define FCGI_STDIN 5
#define FCGI_STDOUT 6
#define FCGI_STDERR 7
#define FCGI_DATA 8
#define FCGI_GET_VALUES 9
#define FCGI_GET_VALUES_RESULT 10
#define FCGI_UNKNOWN_TYPE 11
#define FCGI_MAXTYPE (FCGI_UNKNOWN_TYPE)

/*
 * Value for requestId component of FCGI_Header
 */
#define FCGI_NULL_REQUEST_ID 0

typedef struct {
  unsigned char roleB1;
  unsigned char roleB0;
  unsigned char flags;
  unsigned char reserved[5];
} FCGI_BeginRequestBody;

typedef struct {
  FCGI_Header header;
  FCGI_BeginRequestBody body;
} FCGI_BeginRequestRecord;

/*
 * Mask for flags component of FCGI_BeginRequestBody
 */
#define FCGI_KEEP_CONN 1

/*
 * Values for role component of FCGI_BeginRequestBody
 */
#define FCGI_RESPONDER 1
#define FCGI_AUTHORIZER 2
#define FCGI_FILTER 3

typedef struct {
  unsigned char appStatusB3;
  unsigned char appStatusB2;
  unsigned char appStatusB1;
  unsigned char appStatusB0;
  unsigned char protocolStatus;
  unsigned char reserved[3];
} FCGI_EndRequestBody;

typedef struct {
  FCGI_Header header;
  FCGI_EndRequestBody body;
} FCGI_EndRequestRecord;

/*
 * Values for protocolStatus component of FCGI_EndRequestBody
 */
#define FCGI_REQUEST_COMPLETE 0
#define FCGI_CANT_MPX_CONN 1
#define FCGI_OVERLOADED 2
#define FCGI_UNKNOWN_ROLE 3

/*
 * Variable names for FCGI_GET_VALUES / FCGI_GET_VALUES_RESULT records
 */
#define FCGI_MAX_CONNS "FCGI_MAX_CONNS"
#define FCGI_MAX_REQS "FCGI_MAX_REQS"
#define FCGI_MPXS_CONNS "FCGI_MPXS_CONNS"

typedef struct {
  unsigned char type;
  unsigned char reserved[7];
} FCGI_UnknownTypeBody;

typedef struct {
  FCGI_Header header;
  FCGI_UnknownTypeBody body;
} FCGI_UnknownTypeRecord;


text:
Azure Key Vault helps solve the following problems:
- Certificate management (this library) - create, manage, and deploy public and private SSL/TLS certificates
- Cryptographic key management
([azure-keyvault-keys](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-keys)) - create, store, and control access to the keys used to encrypt your data
- Secrets management
([azure-keyvault-secrets](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-secrets)) -
securely store and control access to tokens, passwords, certificates, API keys,
and other secrets
- Vault administration ([azure-keyvault-administration](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-administration)) - role-based access control (RBAC), and vault-level backup and restore options

[Source code][library_src] | [Package (PyPI)][pypi_package_certificates] | [API reference documentation][reference_docs] | [Product documentation][azure_keyvault] | [Samples][certificates_samples]

## _Disclaimer_

_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_.

## Getting started
### Install the package
Install [azure-keyvault-certificates][pypi_package_certificates] and
[azure-identity][azure_identity_pypi] with [pip][pip]:
```Bash
pip install azure-keyvault-certificates azure-identity
```
[azure-identity][azure_identity] is used for Azure Active Directory
authentication as demonstrated below.

### Prerequisites
* An [Azure subscription][azure_sub]
* Python 3.6 or later
* An existing [Azure Key Vault][azure_keyvault]. If you need to create one, you can do so using the Azure CLI by following the steps in [this document][azure_keyvault_cli].

### Authenticate the client
In order to interact with the Azure Key Vault service, you will need an instance of a [CertificateClient][certificate_client_docs], as well as a **vault url** and a credential object. This document demonstrates using a [DefaultAzureCredential][default_cred_ref], which is appropriate for most scenarios, including local development and production environments. We recommend using a [managed identity][managed_identity] for authentication in production environments.

See [azure-identity][azure_identity] documentation for more information about other methods of authentication and their corresponding credential types.

#### Create a client
After configuring your environment for the [DefaultAzureCredential][default_cred_ref] to use a suitable method of authentication, you can do the following to create a certificate client (replacing the value of `vault_url` with your vault's URL):

```python
from azure.identity import DefaultAzureCredential
from azure.keyvault.certificates import CertificateClient

credential = DefaultAzureCredential()

certificate_client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)
```

> **NOTE:** For an asynchronous client, import `azure.keyvault.certificates.aio`'s `CertificateClient` instead.

## Key concepts
### CertificateClient
With a [CertificateClient][certificate_client_docs] you can get certificates from the vault, create new certificates and new versions of existing certificates, update certificate metadata, and delete certificates. You can also manage certificate issuers, contacts, and management policies of certificates. This is illustrated in the [examples](#examples) below.

## Examples
This section contains code snippets covering common tasks:
* [Create a certificate](#create-a-certificate)
* [Retrieve a certificate](#retrieve-a-certificate)
* [Update properties of an existing certificate](#update-properties-of-an-existing-certificate)
* [Delete a certificate](#delete-a-certificate)
* [List properties of certificates](#list-properties-of-certificates)
* [Async operations](#async-operations)
* [Asynchronously create a certificate](#asynchronously-create-a-certificate)
* [Asynchronously list properties of certificates](#asynchronously-list-properties-of-certificates)

### Create a certificate
[begin_create_certificate](https://aka.ms/azsdk/python/keyvault-certificates/docs#azure.keyvault.certificates.CertificateClient.begin_create_certificate)
creates a certificate to be stored in the Azure Key Vault. If a certificate with the same name already exists, a new
version of the certificate is created. Before creating a certificate, a management policy for the certificate can be
created or our default policy will be used. This method returns a long running operation poller.
```python
from azure.identity import DefaultAzureCredential
from azure.keyvault.certificates import CertificateClient, CertificatePolicy

credential = DefaultAzureCredential()

certificate_client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)

create_certificate_poller = certificate_client.begin_create_certificate(
    certificate_name="cert-name", policy=CertificatePolicy.get_default()
)
print(create_certificate_poller.result())
```
If you would like to check the status of your certificate creation, you can call `status()` on the poller or
[get_certificate_operation](https://aka.ms/azsdk/python/keyvault-certificates/docs#azure.keyvault.certificates.CertificateClient.get_certificate_operation)
with the name of the certificate.

### Retrieve a certificate
[get_certificate](https://aka.ms/azsdk/python/keyvault-certificates/docs#azure.keyvault.certificates.CertificateClient.get_certificate)
retrieves the latest version of a certificate previously stored in the Key Vault.
```python
from azure.identity import DefaultAzureCredential
from azure.keyvault.certificates import CertificateClient

credential = DefaultAzureCredential()

certificate_client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)

certificate = certificate_client.get_certificate("cert-name")

print(certificate.name)
print(certificate.properties.version)
print(certificate.policy.issuer_name)
```

[get_certificate_version](https://aka.ms/azsdk/python/keyvault-certificates/docs#azure.keyvault.certificates.CertificateClient.get_certificate_version)
retrieves a specific version of a certificate.
```python
from azure.identity import DefaultAzureCredential
from azure.keyvault.certificates import CertificateClient

credential = DefaultAzureCredential()

certificate_client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)
certificate = certificate_client.get_certificate_version(certificate_name="cert-name", version="cert-version")

print(certificate.name)
print(certificate.properties.version)
```

### Update properties of an existing certificate
[update_certificate_properties](https://aka.ms/azsdk/python/keyvault-certificates/docs#azure.keyvault.certificates.CertificateClient.update_certificate_properties)
updates a certificate previously stored in the Key Vault.
```python
from azure.identity import DefaultAzureCredential
from azure.keyvault.certificates import CertificateClient

credential = DefaultAzureCredential()

certificate_client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)

# we will now disable the certificate for further use
updated_certificate= certificate_client.update_certificate_properties(
    certificate_name="cert-name", enabled=False
)

print(updated_certificate.name)
print(updated_certificate.properties.enabled)
```

### Delete a certificate
[begin_delete_certificate](https://aka.ms/azsdk/python/keyvault-certificates/docs#azure.keyvault.certificates.CertificateClient.begin_delete_certificate)
requests Key Vault delete a certificate, returning a poller which allows you to wait for the deletion to finish.
Waiting is helpful when the vault has [soft-delete][soft_delete] enabled, and you want to purge
(permanently delete) the certificate as soon as possible. When [soft-delete][soft_delete] is disabled,
`begin_delete_certificate` itself is permanent.

```python
from azure.identity import DefaultAzureCredential
from azure.keyvault.certificates import CertificateClient

credential = DefaultAzureCredential()

certificate_client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)

deleted_certificate_poller = certificate_client.begin_delete_certificate("cert-name")

deleted_certificate = deleted_certificate_poller.result()
print(deleted_certificate.name)
print(deleted_certificate.deleted_on)
```
### List properties of certificates
[list_properties_of_certificates](https://aka.ms/azsdk/python/keyvault-certificates/docs#azure.keyvault.certificates.CertificateClient.list_properties_of_certificates)
lists the properties of all certificates in the specified Key Vault.
```python
from azure.identity import DefaultAzureCredential
from azure.keyvault.certificates import CertificateClient

credential = DefaultAzureCredential()

certificate_client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)

certificates = certificate_client.list_properties_of_certificates()

for certificate in certificates:
    # this list doesn't include versions of the certificates
    print(certificate.name)
```

### Async operations
This library includes a complete set of async APIs. To use them, you must
first install an async transport, such as [aiohttp](https://pypi.org/project/aiohttp/).
See
[azure-core documentation](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#transport)
for more information.

Async clients and credentials should be closed when they're no longer needed. These
objects are async context managers and define async `close` methods. For
example:

```py
from azure.identity.aio import DefaultAzureCredential
from azure.keyvault.certificates.aio import CertificateClient

credential = DefaultAzureCredential()

# call close when the client and credential are no longer needed
client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)
...
await client.close()
await credential.close()

# alternatively, use them as async context managers (contextlib.AsyncExitStack can help)
client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)
async with client:
  async with credential:
    ...
```

### Asynchronously create a certificate
[create_certificate](https://aka.ms/azsdk/python/keyvault-certificates/aio/docs#azure.keyvault.certificates.aio.CertificateClient.create_certificate)
creates a certificate to be stored in the Azure Key Vault. If a certificate with the same name already exists, a new
version of the certificate is created. Before creating a certificate, a management policy for the certificate can be
created or our default policy will be used. Awaiting `create_certificate` returns your created certificate if creation
is successful, and a
[CertificateOperation](https://aka.ms/azsdk/python/keyvault-certificates/docs#azure.keyvault.certificates.CertificateOperation)
if it is not.
```python
from azure.identity.aio import DefaultAzureCredential
from azure.keyvault.certificates.aio import CertificateClient
from azure.keyvault.certificates import CertificatePolicy

credential = DefaultAzureCredential()

certificate_client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)

create_certificate_result = await certificate_client.create_certificate(
    certificate_name="cert-name", policy=CertificatePolicy.get_default()
)
print(create_certificate_result)
```

### Asynchronously list properties of certificates
[list_properties_of_certificates](https://aka.ms/azsdk/python/keyvault-certificates/aio/docs#azure.keyvault.certificates.aio.CertificateClient.list_properties_of_certificates)
lists all the properties of the certificates in the client's vault:
```python
from azure.identity.aio import DefaultAzureCredential
from azure.keyvault.certificates.aio import CertificateClient

credential = DefaultAzureCredential()

certificate_client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)

certificates = certificate_client.list_properties_of_certificates()
async for certificate in certificates:
    print(certificate.name)
```

## Troubleshooting

See the `azure-keyvault-certificates`
[troubleshooting guide](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-certificates/TROUBLESHOOTING.md)
for details on how to diagnose various failure scenarios.

### General
Key Vault clients raise exceptions defined in [azure-core][azure_core_exceptions].
For example, if you try to get a key that doesn't exist in the vault, [CertificateClient][certificate_client_docs]
raises [ResourceNotFoundError](https://aka.ms/azsdk-python-core-exceptions-resource-not-found-error):
```python
from azure.identity import DefaultAzureCredential
from azure.keyvault.certificates import CertificateClient
from azure.core.exceptions import ResourceNotFoundError

credential = DefaultAzureCredential()
certificate_client = CertificateClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)

try:
    certificate_client.get_certificate("which-does-not-exist")
except ResourceNotFoundError as e:
    print(e.message)
```
### Logging
This library uses the standard
[logging](https://docs.python.org/3.5/library/logging.html) library for logging.
Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO
level.

Detailed DEBUG level logging, including request/response bodies and unredacted
headers, can be enabled on a client with the `logging_enable` argument:
```py
from azure.identity import DefaultAzureCredential
from azure.keyvault.certificates import CertificateClient
import sys
import logging

# Create a logger for the 'azure' SDK
logger = logging.getLogger('azure')
logger.setLevel(logging.DEBUG)

# Configure a console output
handler = logging.StreamHandler(stream=sys.stdout)
logger.addHandler(handler)

credential = DefaultAzureCredential()

# This client will log detailed information about its HTTP sessions, at DEBUG level
client = CertificateClient(
    vault_url="https://my-key-vault.vault.azure.net/",
    credential=credential,
    logging_enable=True
)
```

Network trace logging can also be enabled for any single operation:
```python
certificate = certificate_client.get_certificate(certificate_name="cert-name", logging_enable=True)
```

## Next steps
Several samples are available in the Azure SDK for Python GitHub repository. These samples provide example code for additional Key Vault scenarios:
| File | Description |
|-------------|-------------|
| [hello_world.py][hello_world_sample] ([async version][hello_world_async_sample]) | create/get/update/delete certificates |
| [backup_restore_operations.py][backup_operations_sample] ([async version][backup_operations_async_sample]) | back up and recover certificates |
| [import_certificate.py][import_certificate_sample] ([async version][import_certificate_async_sample]) | import PKCS#12 (PFX) and PEM-formatted certificates into Key Vault |
| [list_operations.py][list_operations_sample] ([async version][list_operations_async_sample]) | list certificates |
| [recover_purge_operations.py][recover_purge_operations_sample] ([async version][recover_purge_operations_async_sample]) | recover and purge certificates |
| [issuers.py][issuers_sample] ([async version][issuers_async_sample]) | manage certificate issuers |
| [contacts.py][contacts_sample] ([async version][contacts_async_sample]) | manage certificate contacts |
| [parse_certificate.py][parse_sample] ([async version][parse_async_sample]) | extract a certificate's private key |

###  Additional documentation
For more extensive documentation on Azure Key Vault, see the [API reference documentation][reference_docs].

## Contributing
This project welcomes contributions and suggestions. Most contributions require
you to agree to a Contributor License Agreement (CLA) declaring that you have
the right to, and actually do, grant us the rights to use your contribution.
For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether
you need to provide a CLA and decorate the PR appropriately (e.g., label,
comment). Simply follow the instructions provided by the bot. You will only
need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct].
For more information, see the
[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact opencode@microsoft.com with any additional questions or comments.

<!-- LINKS -->
[azure_core_exceptions]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core#azure-core-library-exceptions
[azure_identity]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity
[azure_identity_pypi]: https://pypi.org/project/azure-identity/
[azure_keyvault]: https://docs.microsoft.com/azure/key-vault/general/overview
[azure_keyvault_cli]: https://docs.microsoft.com/azure/key-vault/general/quick-create-cli
[azure_sub]: https://azure.microsoft.com/free/

[backup_operations_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/backup_restore_operations.py
[backup_operations_async_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/backup_restore_operations_async.py

[certificate_client_docs]: https://aka.ms/azsdk/python/keyvault-certificates/docs#azure.keyvault.certificates.CertificateClient
[certificates_samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-certificates/samples
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
[contacts_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/contacts.py
[contacts_async_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/contacts_async.py

[default_cred_ref]: https://aka.ms/azsdk/python/identity/docs#azure.identity.DefaultAzureCredential

[hello_world_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/hello_world.py
[hello_world_async_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/hello_world_async.py

[import_certificate_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-certificates/samples/import_certificate.py
[import_certificate_async_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-certificates/samples/import_certificate_async.py
[issuers_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/issuers.py
[issuers_async_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/issuers_async.py

[library_src]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates
[list_operations_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/list_operations.py
[list_operations_async_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/list_operations_async.py

[managed_identity]: https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview

[parse_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/parse_certificate.py
[parse_async_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/parse_certificate_async.py
[pip]: https://pypi.org/project/pip/
[pypi_package_certificates]: https://pypi.org/project/azure-keyvault-certificates/

[recover_purge_operations_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/recover_purge_operations.py
[recover_purge_operations_async_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/recover_purge_operations_async.py
[reference_docs]: https://aka.ms/azsdk/python/keyvault-certificates/docs

[soft_delete]: https://docs.microsoft.com/azure/key-vault/general/soft-delete-overview

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fsdk%2Fkeyvault%2Fazure-keyvault-certificates%2FREADME.png)


text:
package com.github.sulir.runtimesearch.agent;

import com.github.sulir.runtimesearch.agent.transformer.ClassTransformer;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.MethodNode;

public class SimpleMethod extends MethodNode {
    public SimpleMethod(AbstractInsnNode... instructions) {
        super(ClassTransformer.ASM_VERSION, Opcodes.ACC_PUBLIC, "test", "()V", null, null);
        maxLocals = 10;
        maxStack = 10;

        for (AbstractInsnNode instruction : instructions)
            this.instructions.add(instruction);
    }

    public String getClassName() {
        return "test/Test";
    }

    public AbstractInsnNode[] getInstructions() {
        return instructions.toArray();
    }
}


text:
<?php

require_once(dirname(__FILE__).'/../../bootstrap/unit.php');

$t = new lime_test(24);

// ->clear()
$t->diag('->clear()');
$ph = new sfParameterHolder();
$ph->clear();
$t->is($ph->getAll(), null, '->clear() clears all parameters');

$ph->set('foo', 'bar');
$ph->clear();
$t->is($ph->getAll(), null, '->clear() clears all parameters');

// ->get()
$t->diag('->get()');
$ph = new sfParameterHolder();
$ph->set('foo', 'bar');
$t->is($ph->get('foo'), 'bar', '->get() returns the parameter value for the given key');
$t->is($ph->get('bar'), null, '->get() returns null if the key does not exist');

// checks that get returns reference
$ref = 'foobar';
$ph->set('ref', $ref);
$ref2 = null;
$ref2 &= $ph->get('ref'); // obtain the very same reference and modify it
$ref2 &= 'barfoo';
$t->is($ref2 , $ref, '->get() returns a reference for the given key');

$ph = new sfParameterHolder();
$t->is('default_value', $ph->get('foo1', 'default_value'), '->get() takes the default value as its second argument');

// ->getNames()
$t->diag('->getNames()');
$ph = new sfParameterHolder();
$ph->set('foo', 'bar');
$ph->set('yourfoo', 'bar');

$t->is($ph->getNames(), array('foo', 'yourfoo'), '->getNames() returns all key names');

// ->getAll()
$t->diag('->getAll()');
$parameters = array('foo' => 'bar', 'myfoo' => 'bar');
$ph = new sfParameterHolder();
$ph->add($parameters);
$t->is($ph->getAll(), $parameters, '->getAll() returns all parameters');

// ->has()
$t->diag('->has()');
$ph = new sfParameterHolder();
$ph->set('foo', 'bar');
$t->is($ph->has('foo'), true, '->has() returns true if the key exists');
$t->is($ph->has('bar'), false, '->has() returns false if the key does not exist');
$ph->set('bar', null);
$t->is($ph->has('bar'), true, '->has() returns true if the key exist, even if the value is null');

// ->remove()
$t->diag('->remove()');
$ph = new sfParameterHolder();
$ph->set('foo', 'bar');
$ph->set('myfoo', 'bar');

$ph->remove('foo');
$t->is($ph->has('foo'), false, '->remove() removes the key from parameters');

$ph->remove('myfoo');
$t->is($ph->has('myfoo'), false, '->remove() removes the key from parameters');

$t->is($ph->remove('nonexistant', 'foobar'), 'foobar', '->remove() takes a default value as its second argument');

$t->is($ph->getAll(), null, '->remove() removes the key from parameters');

// ->set()
$t->diag('->set()');
$foo = 'bar';

$ph = new sfParameterHolder();
$ph->set('foo', $foo);
$t->is($ph->get('foo'), $foo, '->set() sets the value for a key');

$foo = 'foo';
$t->is($ph->get('foo'), 'bar', '->set() sets the value for a key, not a reference');

// ->setByRef()
$t->diag('->setByRef()');
$foo = 'bar';

$ph = new sfParameterHolder();
$ph->setByRef('foo', $foo);
$t->is($ph->get('foo'), $foo, '->setByRef() sets the value for a key');

$foo = 'foo';
$t->is($ph->get('foo'), $foo, '->setByRef() sets the value for a key as a reference');

// ->add()
$t->diag('->add()');
$foo = 'bar';
$parameters = array('foo' => $foo, 'bar' => 'bar');
$myparameters = array('myfoo' => 'bar', 'mybar' => 'bar');

$ph = new sfParameterHolder();
$ph->add($parameters);

$t->is($ph->getAll(), $parameters, '->add() adds an array of parameters');

$foo = 'mybar';
$t->is($ph->getAll(), $parameters, '->add() adds an array of parameters, not a reference');

// ->addByRef()
$t->diag('->addByRef()');
$foo = 'bar';
$parameters = array('foo' => &$foo, 'bar' => 'bar');
$myparameters = array('myfoo' => 'bar', 'mybar' => 'bar');

$ph = new sfParameterHolder();
$ph->addByRef($parameters);

$t->is($parameters, $ph->getAll(), '->add() adds an array of parameters');

$foo = 'mybar';
$t->is($parameters, $ph->getAll(), '->add() adds a reference of an array of parameters');

// ->serialize() ->unserialize()
$t->diag('->serialize() ->unserialize()');
$t->ok($ph == unserialize(serialize($ph)), 'sfParameterHolder implements the Serializable interface');


text:
package devopsdistilled.operp.client.stock.models;

import devopsdistilled.operp.client.abstracts.EntityModel;
import devopsdistilled.operp.client.stock.models.observers.StockModelObserver;
import devopsdistilled.operp.server.data.entity.stock.Stock;
import devopsdistilled.operp.server.data.service.stock.StockService;

public interface StockModel extends
		EntityModel<Stock, StockService, StockModelObserver> {

}


text:
package uk.ac.ucl.eidp.auth.jwt;

import java.util.Date;
import java.util.UUID;

/**
 * JWT Claims for processing in JASPIC modules.
 * @author David Guzman {@literal d.guzman at ucl.ac.uk}
 */
public class CallerClaims {

  private final UUID uid = UUID.randomUUID();
  private final String sub;
  private final String iss;
  private Date exp;

  public CallerClaims(String sub, String iss) {
    this.sub = sub;
    this.iss = iss;
  }

  public String getSub() {
    return sub;
  }

  public String getIss() {
    return iss;
  }

  public String getJti() {
    return uid.toString();
  }

  /**
   * Returns the expiration date.
   * @return returns a clone copy of the data of expiration.
   */
  public Date getExp() {
    if (null != exp) {
      return (Date) exp.clone();
    }
    return exp;
  }

  public void setExp(Date exp) {
    this.exp = new Date(exp.getTime());
  }
}


text:
p{
  background-color:black;
  font-family: futura;
  color:white;
  margin:30px;
}


text:
<?php

namespace Wpug\PostBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

/**
 * Varia controller.
 *
 */
class SoapController extends Controller
{

    public function indexAction()
    {
        $server = new \SoapServer(__DIR__.'/../Resources/config/soap/addition.wsdl');
        $server->setObject($this->get('wpug.factorial'));

        $response = new Response();
        $response->headers->set('Content-Type', 'text/xml; charset=ISO-8859-1');

        ob_start();
        $server->handle();
        $response->setContent(ob_get_clean());

        return $response;
    }
}


text:
// This file is automatically generated.

package adila.db;

/*
 * Positivo Next
 *
 * DEVICE: X500
 * MODEL: Positivo Next
 */
final class x500_positivo20next {
    public static final String DATA = "Positivo|Next|";
}


text:
namespace SimpleMathCompare.PerformanceTests
{
    using System;
    using System.Diagnostics;

    public static class AdditionTest
    {
        public static TimeSpan MeasureTime(int firstNumber, int secondNumber, long repetitionCount)
        {
            long sum = 0;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            for (long i = 0; i < repetitionCount; i++)
            {
                sum = firstNumber + secondNumber;
            }

            stopwatch.Stop();

            var elapsedTime = stopwatch.Elapsed;

            return elapsedTime;
        }

        public static TimeSpan MeasureTime(long firstNumber, long secondNumber, long repetitionCount)
        {
            long sum = 0L;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            for (long i = 0; i < repetitionCount; i++)
            {
                sum = firstNumber + secondNumber;
            }

            stopwatch.Stop();

            var elapsedTime = stopwatch.Elapsed;

            return elapsedTime;
        }

        public static TimeSpan MeasureTime(float firstNumber, float secondNumber, long repetitionCount)
        {
            float sum = 0f;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            for (long i = 0; i < repetitionCount; i++)
            {
                sum = firstNumber + secondNumber;
            }

            stopwatch.Stop();

            var elapsedTime = stopwatch.Elapsed;

            return elapsedTime;
        }

        public static TimeSpan MeasureTime(double firstNumber, double secondNumber, long repetitionCount)
        {
            double sum = 0d;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            for (long i = 0; i < repetitionCount; i++)
            {
                sum = firstNumber + secondNumber;
            }

            stopwatch.Stop();

            var elapsedTime = stopwatch.Elapsed;

            return elapsedTime;
        }

        public static TimeSpan MeasureTime(decimal firstNumber, decimal secondNumber, long repetitionCount)
        {
            decimal sum = 0M;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            for (long i = 0; i < repetitionCount; i++)
            {
                sum = firstNumber + secondNumber;
            }

            stopwatch.Stop();

            var elapsedTime = stopwatch.Elapsed;

            return elapsedTime;
        }
    }
}


text:
using System;
using System.Text;

namespace BracketPipe
{
  public interface IBaseTokenizer : IDisposable
  {
    ushort Column { get; }
    char CurrentChar { get; }
    int InsertionPoint { get; set; }
    ushort Line { get; }
    int Position { get; }
    TextSource Source { get; }
    StringBuilder StringBuffer { get; }

    char Advance();
    void Advance(int n);
    char Back();
    void Back(int n);
    bool ContinuesWithInsensitive(string s);
    bool ContinuesWithSensitive(string s);
    string FlushBuffer();
    TextPosition GetCurrentPosition();
    string PeekString(int length);
    char SkipSpaces();
  }
}


text:
#ifndef CSSPrimitiveValue_h
#define CSSPrimitiveValue_h

#include "core/CSSPropertyNames.h"
#include "core/CSSValueKeywords.h"
#include "core/CoreExport.h"
#include "core/css/CSSValue.h"
#include "wtf/BitVector.h"
#include "wtf/Forward.h"
#include "wtf/MathExtras.h"
#include "wtf/PassRefPtr.h"
#include "wtf/TypeTraits.h"
#include "wtf/text/StringHash.h"

namespace blink {

class CSSCalcValue;
class CSSToLengthConversionData;
class Length;
class ComputedStyle;

// Dimension calculations are imprecise, often resulting in values of e.g.
// 44.99998. We need to go ahead and round if we're really close to the next
// integer value.
template<typename T> inline T roundForImpreciseConversion(double value)
{
    value += (value < 0) ? -0.01 : +0.01;
    return ((value > std::numeric_limits<T>::max()) || (value < std::numeric_limits<T>::min())) ? 0 : static_cast<T>(value);
}

template<> inline float roundForImpreciseConversion(double value)
{
    double ceiledValue = ceil(value);
    double proximityToNextInt = ceiledValue - value;
    if (proximityToNextInt <= 0.01 && value > 0)
        return static_cast<float>(ceiledValue);
    if (proximityToNextInt >= 0.99 && value < 0)
        return static_cast<float>(floor(value));
    return static_cast<float>(value);
}

// CSSPrimitiveValues are immutable. This class has manual ref-counting
// of unioned types and does not have the code necessary
// to handle any kind of mutations.
class CORE_EXPORT CSSPrimitiveValue : public CSSValue {
public:
    enum class UnitType {
        Unknown,
        Number,
        Percentage,
        Ems,
        Exs,
        Pixels,
        Centimeters,
        Millimeters,
        Inches,
        Points,
        Picas,
        UserUnits, // The SVG term for unitless lengths
        Degrees,
        Radians,
        Gradians,
        Turns,
        Milliseconds,
        Seconds,
        Hertz,
        Kilohertz,
        ViewportWidth,
        ViewportHeight,
        ViewportMin,
        ViewportMax,
        DotsPerPixel,
        DotsPerInch,
        DotsPerCentimeter,
        Fraction,
        Integer,
        Rems,
        Chs,
        Calc,
        CalcPercentageWithNumber,
        CalcPercentageWithLength,
        ValueID,

        // This value is used to handle quirky margins in reflow roots (body, td, and th) like WinIE.
        // The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em.
        // When the quirky value is used, if you're in quirks mode, the margin will collapse away
        // inside a table cell. This quirk is specified in the HTML spec but our impl is different.
        // TODO: Remove this. crbug.com/443952
        QuirkyEms,
    };

    enum LengthUnitType {
        UnitTypePixels = 0,
        UnitTypePercentage,
        UnitTypeFontSize,
        UnitTypeFontXSize,
        UnitTypeRootFontSize,
        UnitTypeZeroCharacterWidth,
        UnitTypeViewportWidth,
        UnitTypeViewportHeight,
        UnitTypeViewportMin,
        UnitTypeViewportMax,

        // This value must come after the last length unit type to enable iteration over the length unit types.
        LengthUnitTypeCount,
    };

    using CSSLengthArray = Vector<double, CSSPrimitiveValue::LengthUnitTypeCount>;
    using CSSLengthTypeArray = BitVector;

    void accumulateLengthArray(CSSLengthArray&, double multiplier = 1) const;
    void accumulateLengthArray(CSSLengthArray&, CSSLengthTypeArray&, double multiplier = 1) const;

    enum UnitCategory {
        UNumber,
        UPercent,
        ULength,
        UAngle,
        UTime,
        UFrequency,
        UResolution,
        UOther
    };
    static UnitCategory unitCategory(UnitType);
    static float clampToCSSLengthRange(double);

    static void initUnitTable();

    static UnitType fromName(const String& unit);

    bool isAngle() const
    {
        return type() == UnitType::Degrees
            || type() == UnitType::Radians
            || type() == UnitType::Gradians
            || type() == UnitType::Turns;
    }
    bool isFontRelativeLength() const
    {
        return type() == UnitType::QuirkyEms
            || type() == UnitType::Ems
            || type() == UnitType::Exs
            || type() == UnitType::Rems
            || type() == UnitType::Chs;
    }
    bool isQuirkyEms() const { return type() == UnitType::QuirkyEms; }
    bool isViewportPercentageLength() const { return isViewportPercentageLength(type()); }
    static bool isViewportPercentageLength(UnitType type) { return type >= UnitType::ViewportWidth && type <= UnitType::ViewportMax; }
    static bool isLength(UnitType type)
    {
        return (type >= UnitType::Ems && type <= UnitType::UserUnits) || type == UnitType::QuirkyEms || type == UnitType::Rems || type == UnitType::Chs || isViewportPercentageLength(type);
    }
    bool isLength() const { return isLength(typeWithCalcResolved()); }
    bool isNumber() const { return typeWithCalcResolved() == UnitType::Number || typeWithCalcResolved() == UnitType::Integer; }
    bool isPercentage() const { return typeWithCalcResolved() == UnitType::Percentage; }
    bool isPx() const { return typeWithCalcResolved() == UnitType::Pixels; }
    bool isTime() const { return type() == UnitType::Seconds || type() == UnitType::Milliseconds; }
    bool isCalculated() const { return type() == UnitType::Calc; }
    bool isCalculatedPercentageWithNumber() const { return typeWithCalcResolved() == UnitType::CalcPercentageWithNumber; }
    bool isCalculatedPercentageWithLength() const { return typeWithCalcResolved() == UnitType::CalcPercentageWithLength; }
    static bool isDotsPerInch(UnitType type) { return type == UnitType::DotsPerInch; }
    static bool isDotsPerPixel(UnitType type) { return type == UnitType::DotsPerPixel; }
    static bool isDotsPerCentimeter(UnitType type) { return type == UnitType::DotsPerCentimeter; }
    static bool isResolution(UnitType type) { return type >= UnitType::DotsPerPixel && type <= UnitType::DotsPerCentimeter; }
    bool isFlex() const { return typeWithCalcResolved() == UnitType::Fraction; }
    bool isValueID() const { return type() == UnitType::ValueID; }
    bool colorIsDerivedFromElement() const;

    static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifier(CSSValueID valueID)
    {
        return adoptRefWillBeNoop(new CSSPrimitiveValue(valueID));
    }
    static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(double value, UnitType type)
    {
        return adoptRefWillBeNoop(new CSSPrimitiveValue(value, type));
    }
    static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const Length& value, float zoom)
    {
        return adoptRefWillBeNoop(new CSSPrimitiveValue(value, zoom));
    }
    template<typename T> static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(T value)
    {
        static_assert(!WTF::IsSameType<T, CSSValueID>::value, "Do not call create() with a CSSValueID; call createIdentifier() instead");
        return adoptRefWillBeNoop(new CSSPrimitiveValue(value));
    }

    ~CSSPrimitiveValue();

    void cleanup();

    UnitType typeWithCalcResolved() const;

    double computeDegrees() const;
    double computeSeconds() const;

    // Computes a length in pixels, resolving relative lengths
    template<typename T> T computeLength(const CSSToLengthConversionData&) const;

    // Converts to a Length (Fixed, Percent or Calculated)
    Length convertToLength(const CSSToLengthConversionData&) const;

    double getDoubleValue() const;
    float getFloatValue() const { return getValue<float>(); }
    int getIntValue() const { return getValue<int>(); }
    template<typename T> inline T getValue() const { return clampTo<T>(getDoubleValue()); }

    CSSCalcValue* cssCalcValue() const { ASSERT(isCalculated()); return m_value.calc; }

    CSSValueID getValueID() const { return type() == UnitType::ValueID ? m_value.valueID : CSSValueInvalid; }

    template<typename T> inline T convertTo() const; // Defined in CSSPrimitiveValueMappings.h

    static const char* unitTypeToString(UnitType);
    String customCSSText() const;

    bool equals(const CSSPrimitiveValue&) const;

    DECLARE_TRACE_AFTER_DISPATCH();

    static UnitType canonicalUnitTypeForCategory(UnitCategory);
    static double conversionToCanonicalUnitsScaleFactor(UnitType);

    // Returns true and populates lengthUnitType, if unitType is a length unit. Otherwise, returns false.
    static bool unitTypeToLengthUnitType(UnitType, LengthUnitType&);
    static UnitType lengthUnitTypeToUnitType(LengthUnitType);

private:
    CSSPrimitiveValue(CSSValueID);
    CSSPrimitiveValue(const Length&, float zoom);
    CSSPrimitiveValue(double, UnitType);

    template<typename T> CSSPrimitiveValue(T); // Defined in CSSPrimitiveValueMappings.h
    template<typename T> CSSPrimitiveValue(T* val)
        : CSSValue(PrimitiveClass)
    {
        init(PassRefPtrWillBeRawPtr<T>(val));
    }

    template<typename T> CSSPrimitiveValue(PassRefPtrWillBeRawPtr<T> val)
        : CSSValue(PrimitiveClass)
    {
        init(val);
    }

    static void create(int); // compile-time guard
    static void create(unsigned); // compile-time guard
    template<typename T> operator T*(); // compile-time guard

    void init(UnitType);
    void init(const Length&);
    void init(PassRefPtrWillBeRawPtr<CSSCalcValue>);

    double computeLengthDouble(const CSSToLengthConversionData&) const;

    inline UnitType type() const { return static_cast<UnitType>(m_primitiveUnitType); }

    union {
        CSSValueID valueID;
        double num;
        // FIXME: oilpan: Should be a member, but no support for members in unions. Just trace the raw ptr for now.
        CSSCalcValue* calc;
    } m_value;
};

using CSSLengthArray = CSSPrimitiveValue::CSSLengthArray;
using CSSLengthTypeArray = CSSPrimitiveValue::CSSLengthTypeArray;

DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());

} // namespace blink

#endif // CSSPrimitiveValue_h