text:
package org.sleuthkit.autopsy.casemodule;

import java.awt.event.ActionEvent;
import java.nio.file.Path;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import javax.swing.AbstractAction;
import javax.swing.SwingWorker;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.featureaccess.FeatureAccessUtils;
import org.sleuthkit.autopsy.ingest.IngestManager;

/**
 * An Action that allows a user to remove a data source from the current case.
 */
public final class DeleteDataSourceAction extends AbstractAction {

    private static final long serialVersionUID = 1L;
    private static final Logger logger = Logger.getLogger(DeleteDataSourceAction.class.getName());
    private long dataSourceObjectID;
    private Path caseMetadataFilePath;

    /**
     * Constructs an Action that allows a user to remove a data source from a
     * case.
     *
     * @param dataSourceObjectID The object ID of the data source to be removed.
     */
    @NbBundle.Messages({
        "DeleteDataSourceAction.name.text=Remove Data Source"
    })
    public DeleteDataSourceAction(Long dataSourceObjectID) {
        super(Bundle.DeleteDataSourceAction_name_text());
        this.dataSourceObjectID = dataSourceObjectID;
        this.setEnabled(FeatureAccessUtils.canDeleteDataSources());
    }

    @NbBundle.Messages({
        "DeleteDataSourceAction.ingestRunningWarningDialog.message=Data sources cannot be removed from a case when ingest is running.",
        "DeleteDataSourceAction.confirmationDialog.message=Are you sure you want to remove the selected data source from the case?\nNote that the case will be closed and re-opened during the removal.",
        "# {0} - exception message", "DeleteDataSourceAction.exceptionMessage.dataSourceDeletionError=An error occurred while removing the data source:\n{0}\nPlease see the application log for details.",
        "# {0} - exception message", "DeleteDataSourceAction.exceptionMessage.couldNotReopenCase=Failed to re-open the case:\n{0}\nPlease see the application log for details."
    })
    @Override
    public void actionPerformed(ActionEvent event) {
        if (IngestManager.getInstance().isIngestRunning()) {
            MessageNotifyUtil.Message.warn(Bundle.DeleteDataSourceAction_ingestRunningWarningDialog_message());
            return;
        }

        if (MessageNotifyUtil.Message.confirm(Bundle.DeleteDataSourceAction_confirmationDialog_message())) {
            new DataSourceDeletionWorker().execute();
        }
    }

    /**
     * A SwingWorker to do the data source deletion.
     */
    private class DataSourceDeletionWorker extends SwingWorker<Void, Void> {

        @Override
        protected Void doInBackground() throws Exception {
            /*
             * Save the case metadata file path so the case can be reopened if
             * something goes wrong and the case ends up closed.
             */
            caseMetadataFilePath = Case.getCurrentCase().getMetadata().getFilePath();
            Case.deleteDataSourceFromCurrentCase(dataSourceObjectID);
            return null;
        }

        @Override
        protected void done() {
            try {
                get();
            } catch (InterruptedException | ExecutionException ex) {
                logger.log(Level.SEVERE, String.format("Error deleting data source (obj_id=%d)", dataSourceObjectID), ex);
                MessageNotifyUtil.Message.show(Bundle.DeleteDataSourceAction_exceptionMessage_dataSourceDeletionError(ex.getLocalizedMessage()), MessageNotifyUtil.MessageType.ERROR);
                if (!Case.isCaseOpen()) {
                    new CaseReopeningWorker().execute();
                }
            }
        }

    }

    /**
     * A SwingWorker to attempt to re-open the case after a data source deletion
     * exception.
     */
    private class CaseReopeningWorker extends SwingWorker<Void, Void> {

        @Override
        protected Void doInBackground() throws Exception {
            Case.openAsCurrentCase(caseMetadataFilePath.toString());
            return null;
        }

        @Override
        protected void done() {
            try {
                get();
            } catch (InterruptedException ex) {
                logger.log(Level.WARNING, String.format("Interrupted reopening case after error deleting data source (obj_id=%d)", dataSourceObjectID), ex);

            } catch (ExecutionException ex) {
                logger.log(Level.SEVERE, String.format("Error reopening case after error deleting data source (obj_id=%d)", dataSourceObjectID), ex);
                MessageNotifyUtil.Message.show(Bundle.DeleteDataSourceAction_exceptionMessage_dataSourceDeletionError(ex.getCause().getLocalizedMessage()), MessageNotifyUtil.MessageType.ERROR);
                StartupWindowProvider.getInstance().open();
            }
        }

    }

    @Override
    public DeleteDataSourceAction clone() throws CloneNotSupportedException {
        DeleteDataSourceAction clonedObject = ((DeleteDataSourceAction) super.clone());
        clonedObject.setDataSourceID(this.dataSourceObjectID);
        return clonedObject;
    }

    /**
     * Allows the setting of the data source object ID field of a clone of this
     * action.
     *
     * @param dataSourceObjectID The data source object ID.
     */
    private void setDataSourceID(long dataSourceObjectID) {
        this.dataSourceObjectID = dataSourceObjectID;
    }

}


text:
module VideoTranscoding
  module MP4track
    extend self

    COMMAND_NAME = 'mp4track'

    def setup
      Tool.provide(COMMAND_NAME, ['--version']) do |output, status, _|
        fail "#{COMMAND_NAME} failed during execution" unless status == 0

        unless output =~ /^mp4track - MP4v2 .*/
          Console.debug output
          fail "#{COMMAND_NAME} version unknown"
        end

        Console.info "#{$MATCH} found..."
      end
    end

    def command_name
      Tool.use(COMMAND_NAME)
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 30.06.2015
 * Time: 15:25
 */

namespace yiicms\modules\users\models;

use yiicms\components\core\validators\HtmlFilter;
use yiicms\components\core\validators\PhoneValidator;
use yiicms\models\core\Users;
use yii\base\Model;

/**
 * Class RegistrationForm форма регистрации
 * @package yiicms\modules\users\models
 */
class RegistrationForm extends Model
{
    /** регистрация со всеми аттрибутами */
    const SC_FULL_REGISTRATION = 'fullRegistration';
    /** при регистрации не проверяется каптча и требование согласится с правилами */
    const SC_LIGHT_REGISTRATION = 'lightRegistration';

    public $email;
    public $login;
    public $password;
    public $password2;
    public $timeZone;
    public $verifyCode;
    public $phone;
    public $ruleRead;

    public function scenarios()
    {
        return [
            self::SCENARIO_DEFAULT => [],
            self::SC_FULL_REGISTRATION => ['email', 'login', 'password', 'password2', 'timeZone', 'ruleRead', 'verifyCode'],
            self::SC_LIGHT_REGISTRATION => ['email', 'login', 'password', 'password2', 'timeZone'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['email', 'login', 'password', 'password2', 'timeZone', 'ruleRead', 'verifyCode'], 'required'],
            [['login'], HtmlFilter::class],
            [['login', 'email'], 'string', 'min' => 4, 'max' => 255],
            [
                ['login'],
                function ($attribute) {
                    //проверяем логин на уникальность
                    if ($this->hasErrors()) {
                        return;
                    }
                    $user = Users::findOne(['lower(login)' => strtolower($this->login)]);
                    if ($user !== null) {
                        $this->addError($attribute, \Yii::t('modules/users', 'Вы не можете использовать этот логин'));
                    }
                },
            ],
            [['email'], 'email'],
            [
                ['email'],
                function ($attribute) {
                    //проверяем уникальность мыла
                    if ($this->hasErrors()) {
                        return;
                    }
                    $user = Users::findOne(['lower(email)' => $this->email]);
                    if ($user !== null) {
                        $this->addError($attribute, \Yii::t('modules/users', 'Вы не можете использовать этот Email'));
                    }
                },
            ],
            [['password', 'password2'], 'string', 'min' => 6, 'max' => 255],
            [['password2'], 'compare', 'compareAttribute' => 'password', 'operator' => '==='],
            [['phone'], PhoneValidator::class],
            [['timeZone'], 'in', 'range' => \DateTimeZone::listIdentifiers()],
            [['ruleRead'], 'boolean'],
            [
                ['ruleRead'],
                function ($attribute) {
                    //проверка согласия с правилами
                    if (!$this->ruleRead && !$this->hasErrors()) {
                        $this->addError($attribute, \Yii::t('modules/users', 'Вы должны согласится с правилами'));
                    }
                },
            ],
            [['verifyCode'], 'captcha', 'captchaAction' => 'site/captcha', 'enableClientValidation' => false],
        ];
    }

    public function attributeLabels()
    {
        return [
            'email' => \Yii::t('modules/users', 'E-mail'),
            'login' => \Yii::t('modules/users', 'Имя (Логин) пользователя'),
            'phone' => \Yii::t('modules/users', 'Мобильный телефон'),
            'password' => \Yii::t('modules/users', 'Пароль'),
            'password2' => \Yii::t('modules/users', 'Подтверждение'),
            'timeZone' => \Yii::t('modules/users', 'Часовой пояс'),
            'ruleRead' => \Yii::t('modules/users', 'Я принимаю условия использования'),
            'verifyCode' => \Yii::t('modules/users', 'Проверочный код'),
        ];
    }

    /**
     * регистрация
     * @return bool|Users
     * @throws \yii\base\InvalidParamException
     */
    public function registration()
    {
        if (!$this->validate()) {
            return false;
        }

        $user = new Users();
        $user->scenario = Users::SC_REGISTRATION;
        $user->attributes = $this->attributes;
        $user->password = $this->password;

        if ($user->save() === false) {
            $this->addErrors($user->errors);
        }
        return $user;
    }

    /**
     * @return array список доступных часовых поясов
     */
    public function availableTimeZones()
    {
        $tz1 = \DateTimeZone::listIdentifiers();
        return array_combine($tz1, $tz1);
    }
}


text:
var express = require('express');
var app = express();
console.log(__dirname)

app.use(express.static(__dirname + '/'));

app.listen(3001);


text:
/**
 *
 */
package uk.co.jemos.podam.test.dto.docs.example;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import uk.co.jemos.podam.common.PodamCollection;

/**
 * @author mtedone
 *
 */
public class Order implements Serializable {

	private static final long serialVersionUID = 1L;

	private int id;

	private Calendar createDate;

	private double totalAmount;

	@PodamCollection(nbrElements = 5)
	private List<OrderItem> orderItems = new ArrayList<OrderItem>();

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the createDate
	 */
	public Calendar getCreateDate() {
		return createDate;
	}

	/**
	 * @param createDate
	 *            the createDate to set
	 */
	public void setCreateDate(Calendar createDate) {
		this.createDate = createDate;
	}

	/**
	 * @return the totalAmount
	 */
	public double getTotalAmount() {
		return totalAmount;
	}

	/**
	 * @param totalAmount
	 *            the totalAmount to set
	 */
	public void setTotalAmount(double totalAmount) {
		this.totalAmount = totalAmount;
	}

	/**
	 * @return the orderItems
	 */
	public List<OrderItem> getOrderItems() {
		return orderItems;
	}

	/**
	 * @param orderItems
	 *            the orderItems to set
	 */
	public void setOrderItems(List<OrderItem> orderItems) {
		this.orderItems = orderItems;
	}

	/**
	 * Constructs a String with all attributes in name = value
	 * format.
	 *
	 * @return a String representation of this object.
	 */
	@Override
	public String toString() {
		final String TAB = "    ";

		StringBuilder retValue = new StringBuilder();

		retValue.append("Order ( ").append("id = ").append(id).append(TAB)
				.append("createDate = ").append(createDate.getTime())
				.append(TAB).append("totalAmount = ").append(totalAmount)
				.append(TAB).append("orderItems = ").append(orderItems)
				.append(TAB).append(" )");

		return retValue.toString();
	}

}


text:
class ReviewApp < ApplicationRecord
  belongs_to :heritage, dependent: :destroy, autosave: true
  belongs_to :review_group

  attr_accessor :image_name, :image_tag, :services, :before_deploy, :environment
  validates :subject, :image_name, :image_tag, :retention, :services, presence: true
  validates :subject, format: {
    with: /\A[a-z0-9][a-z0-9(-|_)]*[a-z0-9]\z/,
    message: 'branch name must only contain lowercase characters, numbers and hyphens, and can only start and end with a letter or a number'
  }

  validates :retention, numericality: {greater_than: 0, less_than: 24 * 3600 * 30}

  before_validation :build_heritage
  before_validation do
    self.retention ||= 24 * 3600
  end
  after_save :deploy

  def build_heritage
    web_service = services.find{ |s| s[:service_type].to_s == "web" }
    web_service[:listeners] = [{}] if web_service[:listeners].blank?
    web_service[:listeners][0][:endpoint] = review_group.endpoint.name
    web_service[:listeners][0][:rule_priority] = rule_priority_from_subject
    web_service[:listeners][0][:rule_conditions] ||= []
    web_service[:listeners][0][:rule_conditions] << {type: "host-header", value: domain}

    params = {
      name: "review-#{slug_digest}",
      image_name: image_name,
      image_tag: image_tag,
      before_deploy: before_deploy,
      environment: computed_environment,
      services: services
    }

    self.heritage = BuildHeritage.new(params, district: review_group.district).execute
  end

  def deploy
    touch
    self.heritage.deploy!(description: "ReviewApp for #{subject}")
    CleanupReviewAppJob.set(wait: retention).perform_later(self)
  end

  def domain
    "#{sanitized_subject}.#{review_group.base_domain}"
  end

  def rule_priority_from_subject
    (slug_digest.to_i(16) % 50000) + 1
  end

  def slug
    review_group.name + "---" + sanitized_subject
  end

  def slug_digest
    Digest::SHA256.hexdigest(slug)[0...8]
  end

  def to_param
    sanitized_subject
  end

  def expired?(now = Time.current)
    updated_at < (now - retention.seconds)
  end

  def computed_environment
    environment + [
      {name: "BARCELONA_REVIEWAPP_DOMAIN", value: domain}
    ]
  end

  # replace underscores and downcase - not valid as subdomain
  def sanitized_subject
    subject.downcase.gsub('_', '-')
  end
end


text:
.class final Lo/VW;
.super Ljava/lang/ThreadLocal;
.source ""

# annotations
.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/ThreadLocal<Ljava/lang/StringBuilder;>;"
    }
.end annotation

# direct methods
.method constructor <init>()V
    .locals 0

    .line 52
    invoke-direct {p0}, Ljava/lang/ThreadLocal;-><init>()V

    return-void
.end method

# virtual methods
.method protected synthetic initialValue()Ljava/lang/Object;
    .locals 1

    .line 52
    invoke-virtual {p0}, Lo/VW;->ˊ()Ljava/lang/StringBuilder;

    move-result-object v0

    return-object v0
.end method

.method protected ˊ()Ljava/lang/StringBuilder;
    .locals 2

    .line 54
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "Picasso-"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    return-object v0
.end method


text:
<?php

namespace denbora\R_T_G_Services\examples\RESTv2;

abstract class RestExample
{
    protected function dumpCLI(...$data)
    {
        echo "\n";
        foreach ($data as $datum) {
            var_export($datum);
            echo "\n";
        }
        echo "\n";
    }
}


text:
require 'beaker-rspec'

install_puppet_on hosts

RSpec.configure do |c|
  module_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
  module_name = module_root.split('-').last

  # Readable test descriptions
  c.formatter = :documentation

  # Configure all nodes in nodeset
  c.before :suite do
    # Install module and dependencies
    puppet_module_install(source: module_root, module_name: module_name)
    hosts.each do |host|
      on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
    end
  end
end


text:
package stats

import (
	"testing"
)

func TestGetDeviceID(t *testing.T) {
	deviceID, err := GetDeviceID()
	if err != nil {
		t.Error(err)
	}

	if deviceID == "" {
		t.Error("blank device ID")
	}

	anotherDeviceID, err := GetDeviceID()
	if err != nil {
		t.Error(err)
	}

	if deviceID != anotherDeviceID {
		t.Error("device id shoud be same")
	}
}

func TestNewDeviceId(t *testing.T) {
	deviceID, err := newDeviceID()
	if err != nil {
		t.Error(err)
	}

	if deviceID == "" {
		t.Error("blank device ID")
	}

	anotherDeviceID, err := newDeviceID()
	if err != nil {
		t.Error(err)
	}

	if deviceID == anotherDeviceID {
		t.Error("device id shoud be not same")
	}
}


text:
@implementation KMLTimeStamp {
    NSString *_whenValue;
}

@synthesize when = _when;

#pragma mark - Instance

- (id)initWithXMLElement:(KMLXMLElement *)element parent:(KMLElement *)parent
{
    self = [super initWithXMLElement:element parent:parent];
    if (self) {
        _whenValue = [self textForSingleChildElementNamed:@"when" xmlElement:element];
    }
    return self;
}

#pragma mark - Public mehtods

- (NSDate *)when
{
    return [KMLType dateTime:_whenValue];
}

- (void)setWhen:(NSDate *)when
{
    _whenValue = [KMLType valueForDateTime:when];
}

#pragma mark - tag

+ (NSString *)tagName
{
    return @"TimeStamp";
}

#pragma mark - KML

- (void)addChildTagToKml:(NSMutableString *)kml indentationLevel:(NSInteger)indentationLevel
{
    [super addChildTagToKml:kml indentationLevel:indentationLevel];

    [self kml:kml addPropertyForValue:_whenValue tagName:@"when" indentationLevel:indentationLevel];
}

@end


text:
<readable><title>2441815792_43565b1312</title><content>
A group of people gather for a picture while a woman stands on a post and takes the picture .
A group of people having their picture taken .
A group of people outside having their picture taken
A person standing on a pillar taking a group photo .
A woman stands on a concrete block taking a picture of a group of people on a sidewalk beside the road .
</content></readable>


text:
use strict;
use warnings;

package Clownfish::CFC::Test::TestUtils;

our $VERSION = '0.006000';
$VERSION = eval $VERSION;

use Exporter 'import';
our @EXPORT_OK = qw( test_files_dir );

use File::Spec::Functions qw( catdir updir );

sub test_files_dir {
    my @dirs = (
        't',
        catdir( updir(), 'common', 'test' ),
    );

    for my $dir (@dirs) {
        my $cfbase = catdir( $dir, 'cfbase' );
        return $dir if -d $cfbase;
    }

    die("test files dir not found");
}

1;


text:
/* INTERFACE ROUTINES
 *		ExecInitBitmapOr	- initialize the BitmapOr node
 *		MultiExecBitmapOr	- retrieve the result bitmap from the node
 *		ExecEndBitmapOr		- shut down the BitmapOr node
 *		ExecReScanBitmapOr	- rescan the BitmapOr node
 *
 *	 NOTES
 *		BitmapOr nodes don't make use of their left and right
 *		subtrees, rather they maintain a list of subplans,
 *		much like Append nodes.  The logic is much simpler than
 *		Append, however, since we needn't cope with forward/backward
 *		execution.
 */

#include "postgres.h"

#include "cdb/cdbvars.h"
#include "executor/execdebug.h"
#include "executor/nodeBitmapOr.h"
#include "miscadmin.h"
#include "nodes/tidbitmap.h"

/* ----------------------------------------------------------------
 *		ExecInitBitmapOr
 *
 *		Begin all of the subscans of the BitmapOr node.
 * ----------------------------------------------------------------
 */
BitmapOrState *
ExecInitBitmapOr(BitmapOr *node, EState *estate, int eflags)
{
	BitmapOrState *bitmaporstate = makeNode(BitmapOrState);
	PlanState **bitmapplanstates;
	int			nplans;
	int			i;
	ListCell   *l;
	Plan	   *initNode;

	/* check for unsupported flags */
	Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));

	/*
	 * Set up empty vector of subplan states
	 */
	nplans = list_length(node->bitmapplans);

	bitmapplanstates = (PlanState **) palloc0(nplans * sizeof(PlanState *));

	/*
	 * create new BitmapOrState for our BitmapOr node
	 */
	bitmaporstate->ps.plan = (Plan *) node;
	bitmaporstate->ps.state = estate;
	bitmaporstate->bitmapplans = bitmapplanstates;
	bitmaporstate->nplans = nplans;

	/*
	 * Miscellaneous initialization
	 *
	 * BitmapOr plans don't have expression contexts because they never call
	 * ExecQual or ExecProject.  They don't need any tuple slots either.
	 */

	/*
	 * call ExecInitNode on each of the plans to be executed and save the
	 * results into the array "bitmapplanstates".
	 */
	i = 0;
	foreach(l, node->bitmapplans)
	{
		initNode = (Plan *) lfirst(l);
		bitmapplanstates[i] = ExecInitNode(initNode, estate, eflags);
		i++;
	}

	return bitmaporstate;
}

/* ----------------------------------------------------------------
 *	   MultiExecBitmapOr
 *
 *	   BitmapOr node gets the bitmaps generated from BitmapIndexScan
 *	   nodes and outputs a bitmap that ORs all input bitmaps.
 *
 *	   The first input bitmap is utilized to store the result of the
 *	   OR and returned to the caller. In addition, the output points
 *	   to a newly created OpStream node of type BMS_OR, where all
 *	   StreamNodes of input bitmaps are added as input streams.
 * ----------------------------------------------------------------
 */
Node *
MultiExecBitmapOr(BitmapOrState *node)
{
	PlanState **bitmapplans;
	int			nplans;
	int			i;
	TIDBitmap  *hbm = NULL;

	/* must provide our own instrumentation support */
	if (node->ps.instrument)
		InstrStartNode(node->ps.instrument);

	/*
	 * get information from the node
	 */
	bitmapplans = node->bitmapplans;
	nplans = node->nplans;

	/*
	 * Scan all the subplans and OR their result bitmaps
	 */
	for (i = 0; i < nplans; i++)
	{
		PlanState  *subnode = bitmapplans[i];
		Node	   *subresult = NULL;

		subresult = MultiExecProcNode(subnode);

		if(subresult == NULL)
			continue;

		if (!(IsA(subresult, TIDBitmap) ||
			  IsA(subresult, StreamBitmap)))
			elog(ERROR, "unrecognized result from subplan");

		if (IsA(subresult, TIDBitmap))
		{
			if (hbm == NULL)
				hbm = (TIDBitmap *)subresult;
			else
			{
				tbm_union(hbm, (TIDBitmap *)subresult);
			}
		}
		else
		{
			if(node->bitmap)
			{
				if(node->bitmap != subresult)
				{
					StreamBitmap *s = (StreamBitmap *)subresult;
					stream_move_node((StreamBitmap *)node->bitmap, s, BMS_OR);				}
			}
			else
				node->bitmap = subresult;
		}
	}

	/* check to see if we have any hash bitmaps */
	if (hbm != NULL)
	{
		if(node->bitmap && IsA(node->bitmap, StreamBitmap))
			stream_add_node((StreamBitmap *)node->bitmap,
						tbm_create_stream_node(hbm), BMS_OR);
		else
			node->bitmap = (Node *)hbm;
	}

	/* must provide our own instrumentation support */
	if (node->ps.instrument)
		InstrStopNode(node->ps.instrument, node->bitmap ? 1 : 0);

	return node->bitmap;
}

/* ----------------------------------------------------------------
 *		ExecEndBitmapOr
 *
 *		Shuts down the subscans of the BitmapOr node.
 *
 *		Returns nothing of interest.
 * ----------------------------------------------------------------
 */
void
ExecEndBitmapOr(BitmapOrState *node)
{
	PlanState **bitmapplans;
	int			nplans;
	int			i;

	/*
	 * get information from the node
	 */
	bitmapplans = node->bitmapplans;
	nplans = node->nplans;

	/*
	 * shut down each of the subscans (that we've initialized)
	 */
	for (i = 0; i < nplans; i++)
	{
		if (bitmapplans[i])
			ExecEndNode(bitmapplans[i]);
	}

	EndPlanStateGpmonPkt(&node->ps);
}

void
ExecReScanBitmapOr(BitmapOrState *node)
{
	/*
	 * For optimizer a rescan call on BitmapIndexScan could free up the bitmap. So,
	 * we voluntarily set our bitmap to NULL to ensure that we don't have an out
	 * of scope pointer
	 */
	node->bitmap = NULL;

	int			i;

	for (i = 0; i < node->nplans; i++)
	{
		PlanState  *subnode = node->bitmapplans[i];

		/*
		 * ExecReScan doesn't know about my subplans, so I have to do
		 * changed-parameter signaling myself.
		 */
		if (node->ps.chgParam != NULL)
			UpdateChangedParamSet(subnode, node->ps.chgParam);

		/*
		 * If chgParam of subnode is not null then plan will be re-scanned by
		 * first ExecProcNode.
		 */
		if (subnode->chgParam == NULL)
			ExecReScan(subnode);
	}
}


text:
## Introduction

This module enables user provided etcd certificates.
It actually doesn't contain any logic, but just passes user provided certificates from its input directly to its output.
This is to prevent changing existing references to the `tls/etcd/signed` module, hence all `tls/etcd/*` modules share
the same outputs.

## Usage

Comment out the existing signed etcd TLS in your platform, i.e. `platforms/aws/tectonic.tf`:
```
/*
module "etcd_certs" {
  source = "../../modules/tls/etcd"

  etcd_ca_cert_path     = "${var.tectonic_etcd_ca_cert_path}"
  etcd_cert_dns_names   = "${data.template_file.etcd_hostname_list.*.rendered}"
  etcd_client_cert_path = "${var.tectonic_etcd_client_cert_path}"
  etcd_client_key_path  = "${var.tectonic_etcd_client_key_path}"
  service_cidr          = "${var.tectonic_service_cidr}"
}
*/
```

Configure the user provided certificate paths in your platform, i.e. `platforms/aws/tectonic.tf`:
```
module "etcd_certs" {
  source = "../../modules/tls/etcd/user-provided"

  etcd_ca_crt_pem_path     = "/path/to/etcd-ca.crt"
  etcd_server_crt_pem_path = "/path/to/etcd-server.crt"
  etcd_server_key_pem_path = "/path/to/etcd-server.key"
  etcd_peer_crt_pem_path   = "/path/to/etcd-peer.crt"
  etcd_peer_key_pem_path   = "/path/to/etcd-peer.key"
  etcd_client_crt_pem_path = "/path/to/etcd-client.crt"
  etcd_client_key_pem_path = "/path/to/etcd-client.key"
}
```

The signed etcd server certificate must have the following Subject Alternative Name (SAN) and Key Usage associations:
```
$ openssl x509 -noout -text -in /path/to/etcd-server.crt
Certificate:
...
        X509v3 extensions:
            X509v3 Key Usage: critical
                Key Encipherment
            X509v3 Extended Key Usage:
                TLS Web Server Authentication
...
            X509v3 Subject Alternative Name:
                DNS:<tectonic_cluster_name>-etcd-0.<tectonic_base_domain>,
                DNS:<tectonic_cluster_name>-etcd-1.<tectonic_base_domain>,
                ...
                DNS:<tectonic_cluster_name>-etcd-<tectonic_etcd_count-1>.<tectonic_base_domain>,
```

The signed etcd peer certificate must have the following Subject Alternative Name (SAN) and Key Usage associations:
```
$ openssl x509 -noout -text -in /path/to/etcd-peer.crt
Certificate:
        X509v3 extensions:
            X509v3 Key Usage: critical
                Key Encipherment
            X509v3 Extended Key Usage:
                TLS Web Server Authentication, TLS Web Client Authentication
...
            X509v3 Subject Alternative Name:
                DNS:<tectonic_cluster_name>-etcd-0.<tectonic_base_domain>,
                DNS:<tectonic_cluster_name>-etcd-1.<tectonic_base_domain>,
                ...
                DNS:<tectonic_cluster_name>-etcd-<tectonic_etcd_count-1>.<tectonic_base_domain>,
```

The signed etcd client certificate must have the following Key Usage associations:
```
$ openssl x509 -noout -text -in /path/to/etcd-client.crt
Certificate:
...
        X509v3 extensions:
            X509v3 Extended Key Usage:
                TLS Web Client Authentication
```


text:
module EmployerContributions
  class FederalContributionGroup
    include Mongoid::Document

    embedded_in :federal_employer, :class_name => "::EmployerContributions::FederalEmployer"

    field :enrollee_count, type: Integer
    field :contribution_amount, type: BigDecimal

    validates_presence_of :enrollee_count
    validates_presence_of :contribution_amount
  end
end


text:
using System;
using System.Linq;
using Marten.Testing.Harness;
using Shouldly;
using Xunit;

namespace DocumentDbTests.HierarchicalStorage;

[Collection("hierarchy")]
public class end_to_end_document_hierarchy_with_interface_tests: OneOffConfigurationsContext
{
    public end_to_end_document_hierarchy_with_interface_tests()
    {
        StoreOptions(
            _ =>
            {
                _.Schema.For<IPolicy>()
                    .Identity(x => x.VersionId)
                    .AddSubClassHierarchy();

                _.Schema.For<IPolicy>().GinIndexJsonData();
            });
    }

    [Fact]
    public void persists_subclass()
    {
        var policy = new LinuxPolicy {Name = Guid.NewGuid().ToString()};
        using (var session = theStore.LightweightSession())
        {
            session.Store(policy);
            session.SaveChanges();
        }
    }

    [Fact]
    public void query_for_only_a_subclass_with_string_where_clause()
    {
        var policy = new LinuxPolicy {VersionId = Guid.NewGuid(), Name = Guid.NewGuid().ToString()};
        using (var session = theStore.LightweightSession())
        {
            session.Store(policy);
            session.SaveChanges();
        }

        using (var session = theStore.LightweightSession())
        {
            session.Query<IPolicy>($"Where id = \'{policy.VersionId}\'").Single()
                .VersionId.ShouldBe(policy.VersionId);
        }
    }

    [Fact]
    public void query_for_only_a_subclass_with_where_clause()
    {
        var policy = new LinuxPolicy {VersionId = Guid.NewGuid(), Name = Guid.NewGuid().ToString()};
        using (var session = theStore.LightweightSession())
        {
            session.Store(policy);
            session.SaveChanges();
        }

        using (var session = theStore.LightweightSession())
        {
            session.Query<IPolicy>().Single(p => p.VersionId == policy.VersionId)
                .VersionId.ShouldBe(policy.VersionId);
        }
    }
}