text:
#include <stddef.h>

#ifdef  __cplusplus
extern "C" {
#endif
typedef void (*block128_f) (const unsigned char in[16],
                            unsigned char out[16], const void *key);

typedef void (*cbc128_f) (const unsigned char *in, unsigned char *out,
                          size_t len, const void *key,
                          unsigned char ivec[16], int enc);

typedef void (*ctr128_f) (const unsigned char *in, unsigned char *out,
                          size_t blocks, const void *key,
                          const unsigned char ivec[16]);

typedef void (*ccm128_f) (const unsigned char *in, unsigned char *out,
                          size_t blocks, const void *key,
                          const unsigned char ivec[16],
                          unsigned char cmac[16]);

void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
                           size_t len, const void *key,
                           unsigned char ivec[16], block128_f block);
void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
                           size_t len, const void *key,
                           unsigned char ivec[16], block128_f block);

void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
                           size_t len, const void *key,
                           unsigned char ivec[16],
                           unsigned char ecount_buf[16], unsigned int *num,
                           block128_f block);

void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
                                 size_t len, const void *key,
                                 unsigned char ivec[16],
                                 unsigned char ecount_buf[16],
                                 unsigned int *num, ctr128_f ctr);

void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
                           size_t len, const void *key,
                           unsigned char ivec[16], int *num,
                           block128_f block);

void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
                           size_t len, const void *key,
                           unsigned char ivec[16], int *num,
                           int enc, block128_f block);
void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
                             size_t length, const void *key,
                             unsigned char ivec[16], int *num,
                             int enc, block128_f block);
void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
                             size_t bits, const void *key,
                             unsigned char ivec[16], int *num,
                             int enc, block128_f block);

size_t CRYPTO_cts128_encrypt_block(const unsigned char *in,
                                   unsigned char *out, size_t len,
                                   const void *key, unsigned char ivec[16],
                                   block128_f block);
size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
                             size_t len, const void *key,
                             unsigned char ivec[16], cbc128_f cbc);
size_t CRYPTO_cts128_decrypt_block(const unsigned char *in,
                                   unsigned char *out, size_t len,
                                   const void *key, unsigned char ivec[16],
                                   block128_f block);
size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
                             size_t len, const void *key,
                             unsigned char ivec[16], cbc128_f cbc);

size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in,
                                       unsigned char *out, size_t len,
                                       const void *key,
                                       unsigned char ivec[16],
                                       block128_f block);
size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,
                                 size_t len, const void *key,
                                 unsigned char ivec[16], cbc128_f cbc);
size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in,
                                       unsigned char *out, size_t len,
                                       const void *key,
                                       unsigned char ivec[16],
                                       block128_f block);
size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,
                                 size_t len, const void *key,
                                 unsigned char ivec[16], cbc128_f cbc);

typedef struct gcm128_context GCM128_CONTEXT;

GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block);
void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block);
void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
                         size_t len);
int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
                      size_t len);
int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
                          const unsigned char *in, unsigned char *out,
                          size_t len);
int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
                          const unsigned char *in, unsigned char *out,
                          size_t len);
int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
                                const unsigned char *in, unsigned char *out,
                                size_t len, ctr128_f stream);
int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
                                const unsigned char *in, unsigned char *out,
                                size_t len, ctr128_f stream);
int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
                         size_t len);
void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx);

typedef struct ccm128_context CCM128_CONTEXT;

void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
                        unsigned int M, unsigned int L, void *key,
                        block128_f block);
int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce,
                        size_t nlen, size_t mlen);
void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad,
                       size_t alen);
int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
                          unsigned char *out, size_t len);
int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
                          unsigned char *out, size_t len);
int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
                                unsigned char *out, size_t len,
                                ccm128_f stream);
int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
                                unsigned char *out, size_t len,
                                ccm128_f stream);
size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);

typedef struct xts128_context XTS128_CONTEXT;

int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
                          const unsigned char iv[16],
                          const unsigned char *inp, unsigned char *out,
                          size_t len, int enc);

size_t CRYPTO_128_wrap(void *key, const unsigned char *iv,
                       unsigned char *out,
                       const unsigned char *in, size_t inlen,
                       block128_f block);

size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,
                         unsigned char *out,
                         const unsigned char *in, size_t inlen,
                         block128_f block);
size_t CRYPTO_128_wrap_pad(void *key, const unsigned char *icv,
                           unsigned char *out, const unsigned char *in,
                           size_t inlen, block128_f block);
size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
                             unsigned char *out, const unsigned char *in,
                             size_t inlen, block128_f block);

#ifndef OPENSSL_NO_OCB
typedef struct ocb128_context OCB128_CONTEXT;

OCB128_CONTEXT *CRYPTO_ocb128_new(void *keyenc, void *keydec,
                                  block128_f encrypt, block128_f decrypt);
int CRYPTO_ocb128_init(OCB128_CONTEXT *ctx, void *keyenc, void *keydec,
                       block128_f encrypt, block128_f decrypt);
int CRYPTO_ocb128_copy_ctx(OCB128_CONTEXT *dest, OCB128_CONTEXT *src,
                           void *keyenc, void *keydec);
int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv,
                        size_t len, size_t taglen);
int CRYPTO_ocb128_aad(OCB128_CONTEXT *ctx, const unsigned char *aad,
                      size_t len);
int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, const unsigned char *in,
                          unsigned char *out, size_t len);
int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, const unsigned char *in,
                          unsigned char *out, size_t len);
int CRYPTO_ocb128_finish(OCB128_CONTEXT *ctx, const unsigned char *tag,
                         size_t len);
int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len);
void CRYPTO_ocb128_cleanup(OCB128_CONTEXT *ctx);
#endif                          /* OPENSSL_NO_OCB */

#ifdef  __cplusplus
}
#endif


text:
<?php

class Servers {
	private $client;

	private $serversPath = __DIR__ . '/data/servers.json';
	private $timePath = __DIR__ . '/data/time';

	function __construct($apiclient) {
		$this->client = $apiclient;
	}

	function timeSinceLastUpdate() {
		$time = file_get_contents($this->timePath);
		return time() - intval($time);
	}

	function update() {
		$servers = $this->client->servers();

		file_put_contents($this->serversPath, json_encode($servers->servers));
		file_put_contents($this->timePath, time());
	}

	function fetchAsJson() {
		if ($this->timeSinceLastUpdate() > 59) {
			$this->update();
		}
		$servers = file_get_contents($this->serversPath);
		return $servers;
	}

	function fetchAsObject() {
		return json_decode($this->fetchAsJson());
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.eidosmedia.eclipse.maven.libsass;

import org.apache.maven.plugin.MojoExecution;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.m2e.core.lifecyclemapping.model.IPluginExecutionMetadata;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.configurator.AbstractBuildParticipant;
import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 */
public class Configurator extends AbstractProjectConfigurator {

	private static final Logger log = LoggerFactory
			.getLogger(Configurator.class);

	public Configurator() {

	}

	@Override
	public void configure(ProjectConfigurationRequest request,
			IProgressMonitor monitor) throws CoreException {

	}

	@Override
	public AbstractBuildParticipant getBuildParticipant(
			IMavenProjectFacade projectFacade, MojoExecution execution,
			IPluginExecutionMetadata executionMetadata) {

		String artifactId = execution.getArtifactId();
		if (log.isDebugEnabled()) {
			log.debug("getBuildParticipant: artifactId={}", artifactId);
		}

		String inputPathParam;
		String outputPathParam;

		if ("libsass-maven-plugin".equals(artifactId)) {
			inputPathParam = "inputPath";
			outputPathParam = "outputPath";
		} else if ("sass-maven-plugin".equals(artifactId)) {
			inputPathParam = "sassSourceDirectory";
			outputPathParam = "destination";
		} else {
			throw new IllegalStateException("Unsupported artifactId <"
					+ artifactId + ">");
		}

		return new BuildParticipant(execution, inputPathParam, outputPathParam);
	}
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/discoveryengine/v1beta/document_service.proto

package com.google.cloud.discoveryengine.v1beta;

public interface DeleteDocumentRequestOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.DeleteDocumentRequest)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Required. Full resource name of
   * [Document][google.cloud.discoveryengine.v1beta.Document], such as
   * `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
   * If the caller does not have permission to delete the
   * [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
   * whether or not it exists, a PERMISSION_DENIED error is returned.
   * If the [Document][google.cloud.discoveryengine.v1beta.Document] to delete
   * does not exist, a NOT_FOUND error is returned.
   *

   *
   *
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The name.
   */
  java.lang.String getName();
  /**
   *
   *
   *

   * Required. Full resource name of
   * [Document][google.cloud.discoveryengine.v1beta.Document], such as
   * `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
   * If the caller does not have permission to delete the
   * [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
   * whether or not it exists, a PERMISSION_DENIED error is returned.
   * If the [Document][google.cloud.discoveryengine.v1beta.Document] to delete
   * does not exist, a NOT_FOUND error is returned.
   *

   *
   *
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The bytes for name.
   */
  com.google.protobuf.ByteString getNameBytes();
}


text:
"""
Robots.txt semi-passive plugin, parses robots.txt file to generate on-screen
links and save them for later spidering and analysis
"""

from framework.utils import OWTFLogger
from framework.dependency_management.dependency_resolver import ServiceLocator

DESCRIPTION = "Normal request for robots.txt analysis"

def run(PluginInfo):
    plugin_helper = ServiceLocator.get_component("plugin_helper")
    target = ServiceLocator.get_component("target")
    requester = ServiceLocator.get_component("requester")
    top_url = target.Get('top_url')
    url = top_url + "/robots.txt"
    test_result = []
    # Use transaction cache if possible for speed
    http_transaction = requester.GetTransaction(True, url, "GET")
    if http_transaction is not None and http_transaction.Found:
        test_result += plugin_helper.ProcessRobots(
            PluginInfo,
            http_transaction.GetRawResponseBody(),
            top_url,
            '')
    else:  # robots.txt NOT found
        OWTFLogger.log("robots.txt was NOT found")
        test_result += plugin_helper.TransactionTableForURLList(True, [url])
    return test_result


text:
@implementation YTVKUser

-(id)initWithId:(NSNumber*)identifier {
    self = [super init];
    if (self) {
        self.vkUserId = identifier;
    }
    return self;
}

@end


text:
require 'spec_helper'

describe 'Functional specs' do

  def app
    Praxis::Application.instance
  end

  let(:session) { double("session", valid?: true)}

  context 'index' do

    context 'with a valid request' do
      it 'is successful' do
        get '/api/clouds/1/instances?api_version=1.0', nil, 'global_session' => session
        expect(last_response.headers['Content-Type']).to(
        eq("application/vnd.acme.instance;type=collection"))
      end
    end

    context 'with a path param that can not load' do
      it 'returns a useful error' do
        get '/api/clouds/invalid/instances?api_version=1.0', nil, 'global_session' => session

        expect(last_response.status).to eq 400

        response = JSON.parse(last_response.body)
        expect(response['name']).to eq 'ValidationError'
        expect(response['summary']).to eq 'Error loading params.'
        expect(response['errors']).to match_array([/Error loading attribute \$\.params\.cloud_id/])
        expect(response['cause']['name']).to eq 'ArgumentError'
      end
    end

    context 'with a header that can not load' do
      it 'returns a useful error' do
        get '/api/clouds/1/instances?api_version=1.0', nil, 'global_session' => session, 'HTTP_ACCOUNT_ID' => 'invalid'

        expect(last_response.status).to eq 400

        response = JSON.parse(last_response.body)

        expect(response['name']).to eq 'ValidationError'
        expect(response['summary']).to eq 'Error loading headers.'
        expect(response['errors']).to match_array([/Error loading attribute .*Account-Id"/])
        expect(response['cause']['name']).to eq 'ArgumentError'
      end
    end

    context 'with a param that is invalid' do
      it 'returns a useful error' do
        get '/api/clouds/-1/instances?api_version=1.0', nil, 'global_session' => session

        expect(last_response.status).to eq 400

        response = JSON.parse(last_response.body)

        expect(response['name']).to eq 'ValidationError'
        expect(response['summary']).to eq 'Error validating request data.'
        expect(response['errors']).to match_array([/.*cloud_id.*is smaller than the allowed min/])
      end

    end

    context 'with a header that is invalid' do
      it 'returns a useful error' do
        get '/api/clouds/1/instances?api_version=1.0', nil, 'global_session' => session, 'HTTP_ACCOUNT_ID' => '-1'

        expect(last_response.status).to eq 400

        response = JSON.parse(last_response.body)

        expect(response['name']).to eq 'ValidationError'
        expect(response['summary']).to eq 'Error validating request data.'
        expect(response['errors']).to match_array([/.*headers.*Account-Id.*is smaller than the allowed min/])
      end
    end

    context 'with an incorrect response_content_type param' do
      around do |example|
        logger = app.logger
        app.logger = Logger.new(StringIO.new)

        example.call

        app.logger = logger
      end

      it 'fails to validate the response' do
        get '/api/clouds/1/instances?response_content_type=somejunk&api_version=1.0', nil, 'HTTP_FOO' => "bar", 'global_session' => session
        expect(last_response.status).to eq(400)
        response = JSON.parse(last_response.body)

        expect(response['name']).to eq('ValidationError')
        expect(response['summary']).to eq("Error validating response")
        expect(response['errors'].first).to match(/Bad Content-Type/)
      end

      context 'with response validation disabled' do
        let(:praxis_config) { double('praxis_config', validate_responses: false) }
        let(:config) { double('config', praxis: praxis_config) }

        before do
          expect(Praxis::Application.instance.config).to receive(:praxis).and_return(praxis_config)
        end

        it 'fails to validate the response' do
          expect {
            get '/api/clouds/1/instances?response_content_type=somejunk&api_version=1.0',nil,  'global_session' => session
          }.to_not raise_error
        end

      end
    end

  end

  it 'works' do
    the_body = StringIO.new("{}") # This is a funny, GET request expecting a body
    get '/api/clouds/1/instances/2?junk=foo&api_version=1.0', nil,'rack.input' => the_body,'CONTENT_TYPE' => "application/json", 'global_session' => session
    expect(last_response.status).to eq(200)
    expected = {
      "cloud_id" => 1,
      "id"=>2,
      "junk"=>"foo",
      "other_params"=>{
        "some_date"=>"2012-12-21T00:00:00+00:00",
        "fail_filter"=>false
      },
      "payload"=>{
      "optional"=>"not given"}
    }

    expect(JSON.parse(last_response.body)).to eq(expected)

    headers = last_response.headers
    expect(headers['Content-Type']).to eq('application/json')
    expect(headers['Spec-Middleware']).to eq('used')
    expect(headers['Content-Length']).to eq(last_response.body.size.to_s)
  end

  it 'returns early when making the before filter break' do
    get '/api/clouds/1/instances/2?junk=foo&api_version=1.0&fail_filter=true', nil, 'global_session' => session
    expect(last_response.status).to eq(401)
  end

  context 'bulk_create multipart' do

    let(:instance) { Instance.example }
    let(:instance_json) { JSON.pretty_generate(instance.render(view: :create)) }

    let(:form) do
      form_data = MIME::Multipart::FormData.new
      entity = MIME::Text.new(instance_json)
      form_data.add entity, instance.id.to_s
      form_data
    end

    let(:content_type) { form.headers.get('Content-Type') }
    let(:body) { form.body.to_s }

    it 'works' do
      post '/api/clouds/1/instances?api_version=1.0', body, 'CONTENT_TYPE' => content_type, 'global_session' => session

      _reponse_preamble, response = Praxis::MultipartParser.parse(last_response.headers, last_response.body)
      expect(response).to have(1).item

      instance_part = response.first
      response_id = instance_part.name
      expect(response_id).to eq(instance.id.to_s)

      instance_headers = instance_part.headers
      expect(instance_headers['Status']).to eq('201')
      expect(instance_headers['Location']).to match(%r|/clouds/.*/instances/.*|)

      response_instance = JSON.parse(instance_part.body)
      expect(response_instance["key"]).to eq(instance.id)
      expect(response_instance["value"].values).to eq(instance.render(view: :create).values)
    end
  end

  context 'attach_file' do
    let(:form) do
      form_data = MIME::Multipart::FormData.new

      destination_path = MIME::Text.new('/etc/defaults')
      form_data.add destination_path, 'destination_path'

      text = MIME::Text.new('DOCKER_HOST=tcp://127.0.0.1:2375')
      form_data.add text, 'file', 'docker'

      form_data
    end

    let(:content_type) { form.headers.get('Content-Type') }
    let(:body) { form.body.to_s }

    context 'with a valid payload' do
      before do
        post '/api/clouds/1/instances/2/files?api_version=1.0', body, 'CONTENT_TYPE' => content_type, 'global_session' => session
      end

      subject(:response) { JSON.parse(last_response.body) }

      its(['destination_path']) { should eq '/etc/defaults' }

      context 'response["file"]' do
        subject(:file) { response['file'] }

        its(['filename']) { should eq('docker') }
        its(['type']) { should eq('text/plain') }
        its(['name']) { should eq('file') }
        its(['tempfile']) { should eq('DOCKER_HOST=tcp://127.0.0.1:2375') }
      end
    end

    context 'with a missing value in form' do
      let(:form) do
        form_data = MIME::Multipart::FormData.new

        text = MIME::Text.new('DOCKER_HOST=tcp://127.0.0.1:2375')
        form_data.add text, 'file', 'docker'

        form_data
      end

      let(:body) { form.body.to_s }

      it 'returns an error' do
        post '/api/clouds/1/instances/2/files?api_version=1.0', body, 'CONTENT_TYPE' => content_type, 'global_session' => session
        response = JSON.parse(last_response.body)

        expect(response['name']).to eq('ValidationError')
        expect(response['errors']).to eq(["Attribute $.payload.key(\"destination_path\") is required"])
      end

    end

    context 'with an extra key in the form' do
      let(:form) do
        form_data = MIME::Multipart::FormData.new

        destination_path = MIME::Text.new('/etc/defaults')
        form_data.add destination_path, 'destination_path'

        text = MIME::Text.new('DOCKER_HOST=tcp://127.0.0.1:2375')
        form_data.add text, 'file', 'docker'

        # TEST EXTRA KEYS USING THE MULTIPART FORM
        other = MIME::Text.new('I am extra')
        form_data.add other, 'extra_thing'

        form_data
      end

      let(:body) { form.body.to_s }
      subject(:response) { JSON.parse(last_response.body) }

      before do
        post '/api/clouds/1/instances/2/files?api_version=1.0', body, 'CONTENT_TYPE' => content_type, 'global_session' => session
      end
      its(:keys){ should eq(['destination_path','file','options'])}
      its(['options']){ should eq({"extra_thing"=>"I am extra"})}
    end

  end

  context 'not found and API versions' do
    context 'when no version is speficied' do
      it 'it tells you which available api versions would match' do
        get '/api/clouds/1/instances/2?junk=foo',nil, 'global_session' => session

        expect(last_response.status).to eq(404)
        expect(last_response.headers["Content-Type"]).to eq("text/plain")
        expect(last_response.body).to eq("NotFound. Your request did not specify an API version. Available versions = \"1.0\".")
      end
      it 'it just gives you a simple not found when nothing would have matched' do
        get '/foobar?junk=foo', nil, 'global_session' => session

        expect(last_response.status).to eq(404)
        expect(last_response.headers["Content-Type"]).to eq("text/plain")
        expect(last_response.body).to eq("NotFound")
      end
    end

    context 'when some version is speficied, but wrong' do
      it 'it tells you which possible correcte api versions exist' do
        get '/api/clouds/1/instances/2?junk=foo&api_version=50.0', nil, 'global_session' => session

        expect(last_response.status).to eq(404)
        expect(last_response.headers["Content-Type"]).to eq("text/plain")
        expect(last_response.body).to eq("NotFound. Your request speficied API version = \"50.0\". Available versions = \"1.0\".")
      end
    end

  end

  context 'volumes' do
    before do
      header 'X-Api-Version', '1.0'
    end

    context 'when no authorization header is passed' do
      it 'works as expected' do
        get '/api/clouds/1/volumes/123?junk=stuff', nil, 'global_session' => session
        expect(last_response.status).to eq(200)
        expect(Volume.load(last_response.body).validate).to be_empty
        expect(last_response.headers["Content-Type"]).to eq("application/vnd.acme.volume")
      end
    end
    context 'when an authorization header is passed' do
      it 'returns 401 when it does not match "secret" ' do
        get '/api/clouds/1/volumes/123?junk=stuff', nil, 'HTTP_AUTHORIZATION' => 'foobar', 'global_session' => session
        expect(last_response.status).to eq(401)
        expect(last_response.body).to match(/Authentication info is invalid/)
      end
      it 'succeeds as expected when it matches "secret" ' do
        get '/api/clouds/1/volumes/123?junk=stuff', nil, 'HTTP_AUTHORIZATION' => 'the secret', 'global_session' => session
        expect(last_response.status).to eq(200)
      end

    end

    context 'index action with no args defined' do
      it 'dispatches successfully' do
        get '/api/clouds/1/volumes', nil, 'HTTP_AUTHORIZATION' => 'the secret', 'global_session' => session
        expect(last_response.status).to eq(200)
      end
    end
  end

  context 'wildcard verb routing' do
    it 'can terminate instances with POST' do
      post '/api/clouds/23/instances/1/terminate?api_version=1.0', nil, 'global_session' => session
      expect(last_response.status).to eq(200)
    end
    it 'can terminate instances with DELETE' do
      post '/api/clouds/23/instances/1/terminate?api_version=1.0', nil, 'global_session' => session
      expect(last_response.status).to eq(200)
    end

  end

  context 'route options' do
    it 'reach the endpoint that does not match the except clause' do
      get '/api/clouds/23/otherinstances/_action/test?api_version=1.0', nil, 'global_session' => session
      expect(last_response.status).to eq(200)
    end
    it 'does NOT reach the endpoint that matches the except clause' do
      get '/api/clouds/23/otherinstances/_action/exceptional?api_version=1.0', nil, 'global_session' => session
      expect(last_response.status).to eq(404)
    end

  end

  context 'auth_plugin' do
    it 'can terminate' do
      post '/api/clouds/23/instances/1/terminate?api_version=1.0', nil, 'global_session' => session
      expect(last_response.status).to eq(200)
    end

    it 'can not stop' do
      post '/api/clouds/23/instances/1/stop?api_version=1.0', nil, 'global_session' => session
      expect(last_response.status).to eq(403)
    end
  end

  context 'with mismatch between Content-Type and payload' do
    let(:body) { '{}' }
    let(:content_type) { 'application/x-www-form-urlencoded' }

    before do
      post '/api/clouds/1/instances/2/terminate?api_version=1.0', body, 'CONTENT_TYPE' => content_type, 'global_session' => session
    end

    it 'returns a useful error message' do
      body = JSON.parse(last_response.body)
      expect(body['name']).to eq('ValidationError')
      expect(body['summary']).to match("Error loading payload. Used Content-Type: 'application/x-www-form-urlencoded'")
      expect(body['errors']).to_not be_empty
    end
  end

  context 'update' do

    let(:body) { JSON.pretty_generate(request_payload) }
    let(:content_type) { 'application/json' }

    before do
      patch '/api/clouds/1/instances/3?api_version=1.0', body, 'CONTENT_TYPE' => content_type, 'global_session' => session
    end

    subject(:response_body) { JSON.parse(last_response.body) }

    context 'with an empty payload' do
      let(:request_payload) { {} }
      it { should be_empty }
      it { should_not have_key('name') }
      it { should_not have_key('root_volume') }
    end

    context 'with a provided name' do
      let(:request_payload) { {name: 'MyInstance'} }
      its(['name']) { should eq('MyInstance') }
      it { should_not have_key('root_volume') }
    end

    context 'with an explicitly-nil root_volme' do
      let(:request_payload) { {name: 'MyInstance', root_volume: nil} }
      its(['name']) { should eq('MyInstance') }
      its(['root_volume']) { should be(nil) }
    end

    context 'with an invalid name' do
      let(:request_payload) { {name: 'Invalid Name'} }

      its(['name']) { should eq 'ValidationError' }
      its(['summary']) { should eq 'Error validating response' }
      its(['errors']) { should match_array [/\$\.name value \(Invalid Name\) does not match regexp/] }

      it 'returns a validation error' do
        expect(last_response.status).to eq(400)
      end
    end

  end

end


text:
apos.define('apostrophe-any-page-manager', {
  extend: 'apostrophe-doc-type-manager',

  construct: function(self, options) {

    var superGetTool = self.getTool;
    self.getTool = function(name, options, callback) {
      if (name === 'manager-modal') {
        return apos.pages.chooserModal(options);
      }
      return superGetTool(name, options, callback);
    };

    var superGetToolType = self.getToolType;
    self.getToolType = function(name) {
      if (name === 'manager-modal') {
        return 'apostrophe-pages-reorganize';
      }
      return superGetToolType(name);
    };
  }
});


text:
package org.kuali.kfs.vnd.businessobject.options;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import org.kuali.kfs.sys.context.SpringContext;
import org.kuali.kfs.vnd.businessobject.ShippingSpecialCondition;
import org.kuali.rice.core.api.util.ConcreteKeyValue;
import org.kuali.rice.krad.keyvalues.KeyValuesBase;
import org.kuali.rice.krad.service.KeyValuesService;

/**
 * Values Finder for ShippingSpecialCondition.
 *
 * @see org.kuali.kfs.vnd.businessobject.ShippingSpecialCondition
 */
public class ShippingSpecialConditionValuesFinder extends KeyValuesBase {

    /*
     * @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues()
     */
    public List getKeyValues() {

        KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
        Collection sscs = boService.findAll(ShippingSpecialCondition.class);
        List labels = new ArrayList();
        labels.add(new ConcreteKeyValue("", ""));
        for (Iterator iter = sscs.iterator(); iter.hasNext();) {
            ShippingSpecialCondition ssc = (ShippingSpecialCondition) iter.next();
            labels.add(new ConcreteKeyValue(ssc.getVendorShippingSpecialConditionCode(), ssc.getVendorShippingSpecialConditionDescription()));
        }

        return labels;
    }

}


text:
from __future__ import unicode_literals

from django.db import models

# Create your models here.

class CrimeDataPoint(models.Model):
    incident_number = models.CharField(
        'INCIDENT NUMBER',
        max_length=120,
        blank=True,
        null=True
    )
    offense_code = models.IntegerField(
        'OFFENSE CODE',
        blank=True,
        null=True
    )
    offense_code_group = models.CharField(
        'OFFENSE CODE GROUP',
        max_length=120,
        blank=True,
        null=True
    )
    offense_description = models.CharField(
        'OFFENSE DESCRIPTION',
        max_length=120,
        blank=True,
        null=True
    )
    district = models.CharField(
        'DISTRICT',
        max_length=120,
        blank=True,
        null=True
    )
    reporting_area = models.CharField(
        'REPORTING AREA',
        max_length=120,
        blank=True,
        null=True
    )
    occurred_on_date = models.DateTimeField(
        'OCCURRED ON DATE',
        blank=True,
        null=True
    )
    hour = models.IntegerField(
        'HOUR',
        blank=True,
        null=True
    )
    year = models.IntegerField(
        'YEAR',
        blank=True,
        null=True
    )
    month = models.IntegerField(
        'MONTH',
        blank=True,
        null=True
    )
    day_of_week = models.CharField(
        'DAY OF WEEK',
        max_length=120,
        blank=True,
        null=True
    )
    ucr_part = models.CharField(
        'UCR PART',
        max_length=120,
        blank=True,
        null=True
    )
    street = models.CharField(
        'STREET',
        max_length=120,
        blank=True,
        null=True
    )
    latitude = models.FloatField(
        'LATITUDE',
        blank=True,
        null=True,

    )
    longitude = models.FloatField(
        'LONGITUDE',
        blank=True,
        null=True
    )

    def __str__(self):
        return str(self.id)


text:
require 'fog/core/collection'
require 'fog/hp/models/compute/server'

module Fog
  module Compute
    class HP

      class Servers < Fog::Collection

        model Fog::Compute::HP::Server

        def all
          data = service.list_servers_detail.body['servers']
          load(data)
        end

        def bootstrap(new_attributes = {})
          server = create(new_attributes)
          server.wait_for { ready? }
          server.setup(:password => server.password)
          server
        end

        def get(server_id)
          if server = service.get_server_details(server_id).body['server']
            new(server)
          end
        rescue Fog::Compute::HP::NotFound
          nil
        end

      end

    end
  end
end


text:
<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async () => {
  await new Promise(resolve => document.addEventListener('DOMContentLoaded', resolve, {once:true}));
  await new Promise(resolve => requestAnimationFrame(resolve));
  await new Promise(resolve => requestAnimationFrame(resolve));
  // #fs1, #container, and #child were laid out.

  // Move #child.
  // It makes #container dirty, and it exceeds from #fs1's 1x1 grid.
  document.querySelector('#fs1').insertBefore(
      document.querySelector('#child'), document.querySelector('#container'));
  await new Promise(resolve => requestAnimationFrame(resolve));
  await new Promise(resolve => requestAnimationFrame(resolve));

  // Removing #child makes #container visible again.
  document.querySelector('#child').remove();
  await new Promise(resolve => requestAnimationFrame(resolve));
  await new Promise(resolve => requestAnimationFrame(resolve));
}, 'No crash when a dirty FRAMESET exceeds from the grid then fits in it again');
</script>
</head>
<frameset id="fs1">
<frameset id="container">
<frameset id="child"></frameset>
</frameset>
</frameset>
</html>


text:
package capstone.data;

import capstone.element.Direction;
import capstone.ui.InputKey;
import capstone.utility.KeyMap;
import com.googlecode.lanterna.terminal.Terminal;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 * A data-class to model a user-profile. Such a user-profile consists
 * of an ID, a Real Name, a KeyMap (mapping InputKeys to Directions)
 * and lastly a Representation.
 */

public final class Profile extends Data
{
    /**
     *
     * Deserializes the Profile from the given Properties.
     *
     * @param serialization The Properties to deserialize this Profile from.
     *
     */
    public Profile(Properties serialization)
    {
        deserialize(serialization);
    }

    /**
     *
     * Deserializes the Profile from the Properties stored in the given file.
     *
     * @param file The file containing the Properties, in turn
     *             holding a serialization for this Profile.
     *
     * @throws IOException in case of I/O badness.
     */
    public Profile(File file) throws IOException
    {
        load(file);
    }

    /**
     *
     * Constructs a new Profile from the given attributes.
     *
     * The ID must consist of only word characters (a-zA-Z0-9_) and hyphens.
     *
     * @param id The ID for the Profile.
     *
     * @param realName The real name for the Profile.
     *
     * @param keyMap The KeyMap instance for the Profile.
     *
     * @param representation The Representation for this Profile.
     */
    public Profile(String id,
                   String realName,
                   KeyMap keyMap,
                   Representation representation)
    {
        this.id(id);
        this.realName(realName);
        this.keyMap(keyMap);
        this.representation(representation);
    }

    /**
     *
     * Copy-constructor.
     *
     * @param other The other Profile to copy this one from.
     */
    public Profile(Profile other)
    {
        this(
                other._id,
                other._realName,
                other._keyMap,
                other._representation
        );
    }

    /**
     * @return The ID of the profile.
     */
    public String id()
    {
        return _id;
    }

    /**
     *
     * Sets the ID of the Profile.
     *
     * It must consist of only word characters (a-zA-Z0-9_) and hyphens.
     *
     * @param id The new ID for the Profile.
     */
    public void id(String id)
    {
        assert(id != null);
        assert(id.matches("[\\w-]+"));

        _id = id;
    }

    /**
     * @return The real name attribute of the Profile.
     */
    public String realName()
    {
        return _realName;
    }

    /**
     *
     * Sets the real name attribute of the Profile.
     *
     * @param realName The new real name for the Profile.
     */
    public void realName(String realName)
    {
        assert(realName != null);

        _realName = realName;
    }

    /**
     * @return The KeyMap of the Profile.
     */
    public KeyMap keyMap()
    {
        return _keyMap;
    }

    /**
     *
     * Sets the KeyMap for the Profile.
     *
     * @param keymap The new KeyMap for the Profile.
     */
    public void keyMap(KeyMap keymap)
    {
        assert(keymap != null);

        _keyMap = keymap;
    }

    /**
     *
     * Gets the Direction associated with the given InputKey in the Profile.
     *
     * @param key The InputKey to get the Direction for, if any.
     *
     * @return The Direction associated with the given InputKey if that
     *         InputKey is in the Profile's KeyMap, else null.
     */
    public Direction direction(InputKey key)
    {
        return _keyMap.get(key);
    }

    /**
     * @return The Representation of the Profile.
     */
    public Representation representation()
    {
        return _representation;
    }

    /**
     *
     * Sets the Representation for this Profile.
     *
     * @param representation The new Representation for this Profile.
     */
    public void representation(Representation representation)
    {
        assert(representation != null);

        _representation = representation;
    }

    /**
     *
     * Stores the Profile at resources/profiles with the filename
     * returned by the fileName() function.
     *
     * @throws IOException for I/O badness.
     */
    @Override public void store() throws IOException
    {
        super.store(new File("resources/profiles"));
    }

    /**
     *
     * Deserializes the Profile from the given Properties.
     *
     * @param serialization The properties containing the data.
     */
    @Override public void deserialize(Properties serialization)
    {
        assert(serialization.containsKey("id"));
        _id = serialization.getProperty("id");

        assert(serialization.containsKey("realName"));
        _realName = serialization.getProperty("realName");

        // No default constructor for KeyMap
        HashMap<InputKey, Direction> mapping = new HashMap<>();

        for (Direction direction : Direction.motion())
        {
            mapping.put(
                    InputKey.fromString(serialization.getProperty(direction.toString())),
                    direction
            );
        }

        _keyMap = new KeyMap(mapping);

        // Deserialize the Representation
        assert(serialization.containsKey("representation.character"));
        assert(serialization.containsKey("representation.background"));
        assert(serialization.containsKey("representation.foreground"));
        _representation = new Representation(
                serialization.getProperty("representation.character").charAt(0),
                Terminal.Color.valueOf(serialization.getProperty("representation.background")),
                Terminal.Color.valueOf(serialization.getProperty("representation.foreground"))
        );
    }

    /**
     *
     * Serializes the Profile.
     *
     * @return A Properties object containing the
     *         serialization for the Profile.
     */
    @Override public Properties serialize()
    {
        assert(_id != null);
        assert(_realName != null);
        assert(_representation != null);
        assert(_keyMap != null);

        Properties serialization = new Properties();

        serialization.setProperty("id", _id);
        serialization.setProperty("realName", _realName);

        for (Map.Entry<InputKey, Direction> entry : _keyMap)
        {
            serialization.setProperty(
                    entry.getValue().toString(),
                    entry.getKey().toString()
            );
        }

        serialization.setProperty(
                "representation.character",
                Character.toString(_representation.character())
        );

        serialization.setProperty(
                "representation.background",
                _representation.background().toString()
        );

        serialization.setProperty(
                "representation.foreground",
                _representation.foreground().toString()
        );

        return serialization;
    }

    /**
     *
     * Checks equality between this Profile and an object.
     *
     * @param object The object to check equality for.
     *
     * @return True if the object is a Profile for the same user-ID.
     */
    @Override public boolean equals(Object object)
    {
        if (object == null) return false;

        if (! (object instanceof Profile)) return false;

        if (object == this) return true;

        Profile other = (Profile) object;

        return this._id.equals(other._id);
    }

    /**
     * @return The user-ID of the Profile with a .profile extension.
     */
    @Override public String fileName()
    {
        return String.format("%1$s.profile", _id);
    }

    /**
     * @return The hashCode of the Profile.
     */
    @Override public int hashCode()
    {
        return _id.hashCode();
    }

    private String _id;

    private String _realName;

    private KeyMap _keyMap;

    private Representation _representation;
}


text:
class CreateCustomExpectations < ActiveRecord::Migration
  def change
    create_table :custom_expectations do |t|
      t.string :comparison
      t.string :endpoint
      t.string :fields
      t.string :final_value

      t.timestamps
    end
  end
end


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

namespace UsbHid.USB.Structures
{
    [StructLayout(LayoutKind.Sequential)]
    public struct SpDeviceInterfaceData
    {
        public int cbSize;
        public Guid InterfaceClassGuid;
        public int Flags;
        public int Reserved;
    }
}


text:
package org.sistcoop.persona.models.jpa;

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

import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

import org.sistcoop.persona.models.ModelDuplicateException;
import org.sistcoop.persona.models.TipoDocumentoModel;
import org.sistcoop.persona.models.TipoDocumentoProvider;
import org.sistcoop.persona.models.enums.TipoPersona;
import org.sistcoop.persona.models.jpa.entities.PersonaJuridicaEntity;
import org.sistcoop.persona.models.jpa.entities.PersonaNaturalEntity;
import org.sistcoop.persona.models.jpa.entities.TipoDocumentoEntity;
import org.sistcoop.persona.models.search.SearchCriteriaModel;
import org.sistcoop.persona.models.search.SearchResultsModel;

/**
 * @author Carlos Feria
 */

@Named
@Stateless
@Local(TipoDocumentoProvider.class)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class JpaTipoDocumentoProvider extends AbstractHibernateStorage implements TipoDocumentoProvider {

    private static final String ABREVIATURA = "abreviatura";
    private static final String DENOMINACION = "denominacion";
    private static final String TIPO_PERSONA = "tipoPersona";
    private static final String ESTADO = "estado";

    @PersistenceContext
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return this.em;
    }

    @Override
    public void close() {
        // TODO Auto-generated method stub
    }

    @Override
    public TipoDocumentoModel create(String abreviatura, String denominacion, int cantidadCaracteres,
            TipoPersona tipoPersona) {
        if (findByAbreviatura(abreviatura) != null) {
            throw new ModelDuplicateException(
                    "TipoDocumentoEntity abreviatura debe ser unico, se encontro otra entidad con abreviatura:"
                            + abreviatura);
        }

        TipoDocumentoEntity tipoDocumentoEntity = new TipoDocumentoEntity();
        tipoDocumentoEntity.setAbreviatura(abreviatura);
        tipoDocumentoEntity.setDenominacion(denominacion);
        tipoDocumentoEntity.setCantidadCaracteres(cantidadCaracteres);
        tipoDocumentoEntity.setTipoPersona(tipoPersona.toString());
        tipoDocumentoEntity.setEstado(true);
        em.persist(tipoDocumentoEntity);
        return new TipoDocumentoAdapter(em, tipoDocumentoEntity);
    }

    @Override
    public TipoDocumentoModel findByAbreviatura(String abreviatura) {
        TypedQuery<TipoDocumentoEntity> query = em.createNamedQuery("TipoDocumentoEntity.findByAbreviatura",
                TipoDocumentoEntity.class);
        query.setParameter("abreviatura", abreviatura);
        List<TipoDocumentoEntity> results = query.getResultList();
        if (results.isEmpty()) {
            return null;
        } else if (results.size() > 1) {
            throw new IllegalStateException(
                    "Mas de un TipoDocumentoEntity con abreviatura=" + abreviatura + ", results=" + results);
        } else {
            return new TipoDocumentoAdapter(em, results.get(0));
        }
    }

    @Override
    public TipoDocumentoModel findById(String id) {
        TipoDocumentoEntity tipoDocumentoEntity = em.find(TipoDocumentoEntity.class, id);
        return tipoDocumentoEntity != null ? new TipoDocumentoAdapter(em, tipoDocumentoEntity) : null;
    }

    @Override
    public boolean remove(TipoDocumentoModel tipoDocumentoModel) {
        TypedQuery<PersonaNaturalEntity> query1 = em
                .createNamedQuery("PersonaNaturalEntity.findByTipoDocumento", PersonaNaturalEntity.class);
        query1.setParameter("tipoDocumento", tipoDocumentoModel.getAbreviatura());
        query1.setMaxResults(1);
        if (!query1.getResultList().isEmpty()) {
            return false;
        }

        TypedQuery<PersonaJuridicaEntity> query2 = em
                .createNamedQuery("PersonaJuridicaEntity.findByTipoDocumento", PersonaJuridicaEntity.class);
        query2.setParameter("tipoDocumento", tipoDocumentoModel.getAbreviatura());
        query2.setMaxResults(1);
        if (!query2.getResultList().isEmpty()) {
            return false;
        }

        TipoDocumentoEntity tipoDocumentoEntity = em.find(TipoDocumentoEntity.class,
                tipoDocumentoModel.getId());
        if (tipoDocumentoEntity == null) {
            return false;
        }
        em.remove(tipoDocumentoEntity);
        return true;
    }

    @Override
    public List<TipoDocumentoModel> getAll() {
        return getAll(-1, -1);
    }

    @Override
    public List<TipoDocumentoModel> getAll(int firstResult, int maxResults) {
        TypedQuery<TipoDocumentoEntity> query = em.createNamedQuery("TipoDocumentoEntity.findAll",
                TipoDocumentoEntity.class);
        if (firstResult != -1) {
            query.setFirstResult(firstResult);
        }
        if (maxResults != -1) {
            query.setMaxResults(maxResults);
        }
        List<TipoDocumentoEntity> entities = query.getResultList();
        List<TipoDocumentoModel> models = new ArrayList<TipoDocumentoModel>();
        for (TipoDocumentoEntity tipoDocumentoEntity : entities) {
            models.add(new TipoDocumentoAdapter(em, tipoDocumentoEntity));
        }
        return models;
    }

    @Override
    public List<TipoDocumentoModel> search(String filterText) {
        return search(filterText, -1, -1);
    }

    @Override
    public List<TipoDocumentoModel> search(String filterText, int firstResult, int maxResults) {
        TypedQuery<TipoDocumentoEntity> query = em.createNamedQuery("TipoDocumentoEntity.findByFilterText",
                TipoDocumentoEntity.class);
        query.setParameter("filterText", "%" + filterText.toLowerCase() + "%");
        if (firstResult != -1) {
            query.setFirstResult(firstResult);
        }
        if (maxResults != -1) {
            query.setMaxResults(maxResults);
        }
        List<TipoDocumentoEntity> entities = query.getResultList();
        List<TipoDocumentoModel> models = new ArrayList<TipoDocumentoModel>();
        for (TipoDocumentoEntity tipoDocumentoEntity : entities) {
            models.add(new TipoDocumentoAdapter(em, tipoDocumentoEntity));
        }

        return models;
    }

    @Override
    public List<TipoDocumentoModel> searchByAttributes(Map<String, Object> attributes) {
        return searchByAttributes(attributes, -1, -1);
    }

    @Override
    public List<TipoDocumentoModel> searchByAttributes(Map<String, Object> attributes, int firstResult,
            int maxResults) {
        StringBuilder builder = new StringBuilder("SELECT t FROM TipoDocumentoEntity");
        for (Map.Entry<String, Object> entry : attributes.entrySet()) {
            String attribute = null;
            String parameterName = null;
            if (entry.getKey().equals(TipoDocumentoModel.ABREVIATURA)) {
                attribute = "lower(t.abreviatura)";
                parameterName = JpaTipoDocumentoProvider.ABREVIATURA;
            } else if (entry.getKey().equalsIgnoreCase(TipoDocumentoModel.DENOMINACION)) {
                attribute = "lower(t.denominacion)";
                parameterName = JpaTipoDocumentoProvider.DENOMINACION;
            }

            if (attribute != null) {
                builder.append(" and ");
                builder.append(attribute).append(" like :").append(parameterName);
            } else {
                if (entry.getKey().equalsIgnoreCase(TipoDocumentoModel.TIPO_PERSONA)) {
                    attribute = "lower(t.tipoPersona)";
                    parameterName = JpaTipoDocumentoProvider.TIPO_PERSONA;
                } else if (entry.getKey().equalsIgnoreCase(TipoDocumentoModel.ESTADO)) {
                    attribute = "t.estado";
                    parameterName = JpaTipoDocumentoProvider.ESTADO;
                }

                if (attribute == null) {
                    continue;
                }
                builder.append(" and ");
                builder.append(attribute).append(" = :").append(parameterName);
            }
        }
        builder.append(" order by t.abreviatura");
        String q = builder.toString();
        TypedQuery<TipoDocumentoEntity> query = em.createQuery(q, TipoDocumentoEntity.class);
        for (Map.Entry<String, Object> entry : attributes.entrySet()) {
            String parameterName = null;
            if (entry.getKey().equals(TipoDocumentoModel.ABREVIATURA)) {
                parameterName = JpaTipoDocumentoProvider.ABREVIATURA;
            } else if (entry.getKey().equalsIgnoreCase(TipoDocumentoModel.DENOMINACION)) {
                parameterName = JpaTipoDocumentoProvider.DENOMINACION;
            }

            if (parameterName != null) {
                query.setParameter(parameterName, "%" + String.valueOf(entry.getValue()).toLowerCase() + "%");
            } else {
                if (entry.getKey().equalsIgnoreCase(TipoDocumentoModel.TIPO_PERSONA)) {
                    parameterName = JpaTipoDocumentoProvider.TIPO_PERSONA;
                } else if (entry.getKey().equalsIgnoreCase(TipoDocumentoModel.ESTADO)) {
                    parameterName = JpaTipoDocumentoProvider.ESTADO;
                }

                if (parameterName == null) {
                    continue;
                }
                query.setParameter(parameterName, entry.getValue());
            }
        }
        if (firstResult != -1) {
            query.setFirstResult(firstResult);
        }
        if (maxResults != -1) {
            query.setMaxResults(maxResults);
        }
        List<TipoDocumentoEntity> results = query.getResultList();
        List<TipoDocumentoModel> tipoDocumentos = new ArrayList<TipoDocumentoModel>();
        for (TipoDocumentoEntity entity : results)
            tipoDocumentos.add(new TipoDocumentoAdapter(em, entity));
        return tipoDocumentos;
    }

    @Override
    public SearchResultsModel<TipoDocumentoModel> search(SearchCriteriaModel criteria) {
        SearchResultsModel<TipoDocumentoEntity> entityResult = find(criteria, TipoDocumentoEntity.class);

        SearchResultsModel<TipoDocumentoModel> modelResult = new SearchResultsModel<>();
        List<TipoDocumentoModel> list = new ArrayList<>();
        for (TipoDocumentoEntity entity : entityResult.getModels()) {
            list.add(new TipoDocumentoAdapter(em, entity));
        }
        modelResult.setTotalSize(entityResult.getTotalSize());
        modelResult.setModels(list);
        return modelResult;
    }

    @Override
    public SearchResultsModel<TipoDocumentoModel> search(SearchCriteriaModel criteria, String filterText) {
        SearchResultsModel<TipoDocumentoEntity> entityResult = findFullText(criteria,
                TipoDocumentoEntity.class, filterText, "abreviatura", "denominacion");

        SearchResultsModel<TipoDocumentoModel> modelResult = new SearchResultsModel<>();
        List<TipoDocumentoModel> list = new ArrayList<>();
        for (TipoDocumentoEntity entity : entityResult.getModels()) {
            list.add(new TipoDocumentoAdapter(em, entity));
        }
        modelResult.setTotalSize(entityResult.getTotalSize());
        modelResult.setModels(list);
        return modelResult;
    }

}


text:
sed -i -e "s/http.us.debian.org/mirrors.kernel.org/" /etc/apt/sources.list

# Resolve hostname of master
if ! grep -q $MASTER_NAME /etc/hosts; then
  echo "Adding host entry for $MASTER_NAME"
  echo "$MASTER_IP $MASTER_NAME" >> /etc/hosts
fi

# Prepopulate the name of the Master
mkdir -p /etc/salt/minion.d
echo "master: $MASTER_NAME" > /etc/salt/minion.d/master.conf

# Turn on debugging for salt-minion
# echo "DAEMON_ARGS=\"\$DAEMON_ARGS --log-file-level=debug\"" > /etc/default/salt-minion

# Our minions will have a pool role to distinguish them from the master.
#
# Setting the "minion_ip" here causes the kubelet to use its IP for
# identification instead of its hostname.
#
cat <<EOF >/etc/salt/minion.d/grains.conf
grains:
  minion_ip: $(ip route get 1.1.1.1 | awk '{print $7}')
  roles:
    - kubernetes-pool
    - kubernetes-pool-vsphere
  cbr-cidr: $MINION_IP_RANGE
EOF

# Install Salt
#
# We specify -X to avoid a race condition that can cause minion failure to
# install.  See https://github.com/saltstack/salt-bootstrap/issues/270
if [ ! -x /etc/init.d/salt-minion ]; then
  wget -q -O - https://bootstrap.saltstack.com | sh -s -- -X
else
  /etc/init.d/salt-minion restart
fi


text:
**Description of the change**

Clearly and concisely describe the purpose of the pull request. If this PR relates to an existing issue or change proposal, please link to it. Include any other background context that would help reviewers understand the motivation for this PR.

---

**Checklist:**

- [ ] Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0 by @)")
- [ ] Linked any existing issues or proposals that this pull request should close
- [ ] Updated or added relevant documentation
- [ ] Added a test for the contribution (if applicable)


text:
//
//  VKAuthorizationResult.h
//
//  Copyright (c) 2015 VK.com
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy of
//  this software and associated documentation files (the "Software"), to deal in
//  the Software without restriction, including without limitation the rights to
//  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
//  the Software, and to permit persons to whom the Software is furnished to do so,
//  subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in all
//  copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
//  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
//  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
//  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
//  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#import "VKAccessToken.h"
#import "VKError.h"

typedef NS_ENUM(NSUInteger, VKAuthorizationState) {
    /// Authorization state unknown, probably ready to work or something went wrong
    VKAuthorizationUnknown,
    /// SDK initialized and ready to authorize
    VKAuthorizationInitialized,
    /// Authorization state pending, probably we're trying to load auth information
    VKAuthorizationPending,
    /// Started external authorization process
    VKAuthorizationExternal,
    /// Started in app authorization process, using SafariViewController
    VKAuthorizationSafariInApp,
    /// Started in app authorization process, using webview
    VKAuthorizationWebview,
    /// User authorized
    VKAuthorizationAuthorized,
    /// An error occured, try to wake up session later
    VKAuthorizationError,
};

/**
 When authorization is completed or failed with error, object of this class will be send in vkSdkAccessAuthorizationFinishedWithResult: method.
 */
@interface VKAuthorizationResult : VKObject

/// Access token recieved after successfull authorization
@property(nonatomic, readonly, strong) VKAccessToken *token;

/// Available information about current user of SDK. Notice that info is available in SDK-delegate vkSdkAuthorizationStateUpdatedWithResult: method.
@property(nonatomic, readonly, strong) VKUser *user;

/// If some error or authorization cancelation happened, this field contains basic error information
@property(nonatomic, readonly, strong) NSError *error;

/// Current state of authorization
@property(nonatomic, readonly, assign) VKAuthorizationState state;

@end

/**
 * This is mutable version of VKAuthorizationResult class
 */
@interface VKMutableAuthorizationResult : VKAuthorizationResult

@property(nonatomic, readwrite, strong) VKAccessToken *token;

@property(nonatomic, readwrite, strong) VKUser *user;

@property(nonatomic, readwrite, strong) NSError *error;

@property(nonatomic, readwrite, assign) VKAuthorizationState state;

@end


text:
package apps::cisco::cms::restapi::mode::licenses;

use base qw(centreon::plugins::templates::counter);

use strict;
use warnings;
use DateTime;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold);

sub custom_status_output {
    my ($self, %options) = @_;

    my $msg = sprintf("status is '%s'", $self->{result_values}->{status});
    $msg .= sprintf(", expires in %d days [%s]",
        $self->{result_values}->{expiry_days},
        $self->{result_values}->{expiry_date}) if (defined($self->{result_values}->{expiry_date}) && $self->{result_values}->{expiry_date} ne '');
    return $msg;
}

sub custom_status_calc {
    my ($self, %options) = @_;

    $self->{result_values}->{feature} = $options{new_datas}->{$self->{instance} . '_feature'};
    $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'};
    $self->{result_values}->{expiry_date} = $options{new_datas}->{$self->{instance} . '_expiry_date'};
    $self->{result_values}->{expiry_seconds} = $options{new_datas}->{$self->{instance} . '_expiry_seconds'};
    $self->{result_values}->{expiry_days} = ($self->{result_values}->{expiry_seconds} ne '') ? $self->{result_values}->{expiry_seconds} / 86400 : 0;
    return 0;
}

sub set_counters {
    my ($self, %options) = @_;

    $self->{maps_counters_type} = [
        { name => 'features', type => 1, cb_prefix_output => 'prefix_feature_output', message_multiple => 'All features licensing are ok' },
    ];

    $self->{maps_counters}->{features} = [
        { label => 'status', threshold => 0, set => {
                key_values => [ { name => 'feature' }, { name => 'status' }, { name => 'expiry_date' }, { name => 'expiry_seconds' } ],
                closure_custom_calc => $self->can('custom_status_calc'),
                closure_custom_output => $self->can('custom_status_output'),
                closure_custom_perfdata => sub { return 0; },
                closure_custom_threshold_check => \&catalog_status_threshold,
            }
        },
    ];
}

sub prefix_feature_output {
    my ($self, %options) = @_;

    return "Feature '" . $options{instance_value}->{feature} . "' ";
}

sub new {
    my ($class, %options) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options);
    bless $self, $class;

    $options{options}->add_options(arguments =>
                                {
                                    "warning-status:s"      => { name => 'warning_status', default => '%{status} eq "activated" && %{expiry_days} < 60' },
                                    "critical-status:s"     => { name => 'critical_status', default => '%{status} eq "activated" && %{expiry_days} < 30' },
                                });

    return $self;
}

sub check_options {
    my ($self, %options) = @_;
    $self->SUPER::check_options(%options);

    $self->change_macros(macros => ['warning_status', 'critical_status']);
}

sub manage_selection {
    my ($self, %options) = @_;

    my $results = $options{custom}->get_endpoint(method => '/system/licensing');

    $self->{features} = {};

    foreach my $feature (keys %{$results->{features}}) {
        my %months = ("Jan" => 1, "Feb" => 2, "Mar" => 3, "Apr" => 4, "May" => 5, "Jun" => 6, "Jul" => 7, "Aug" => 8, "Sep" => 9, "Oct" => 10, "Nov" => 11, "Dec" => 12);
        $results->{features}->{$feature}->{expiry} =~ /^(\d+)-(\w+)-(\d+)$/ if (defined($results->{features}->{$feature}->{expiry})); # 2100-Jan-01
        my $dt = DateTime->new(year => $1, month => $months{$2}, day => $3);

        $self->{features}->{$feature} = {
            feature => $feature,
            status => $results->{features}->{$feature}->{status},
            expiry_date => (defined($results->{features}->{$feature}->{expiry})) ? $results->{features}->{$feature}->{expiry} : '',
            expiry_seconds => (defined($results->{features}->{$feature}->{expiry})) ? $dt->epoch - time() : '',
        };
    }

    if (scalar(keys %{$self->{features}}) <= 0) {
        $self->{output}->add_option_msg(short_msg => "No features found.");
        $self->{output}->option_exit();
    }
}

1;

__END__

=head1 MODE

Check features licensing.

=over 8

=item B<--warning-status>

Set warning threshold for status. (Default: '%{status} eq "activated" && %{expiry_days} < 60').
Can use special variables like: %{status}, %{expiry_days}, %{feature}

=item B<--critical-status>

Set critical threshold for status. (Default: '%{status} eq "activated" && %{expiry_days} < 30').
Can use special variables like: %{status}, %{expiry_days}, %{feature}

=back

=cut


text:
///////////////////////////////////////////////////////////////////////////////
// BSD 3-Clause License
//
// Copyright (c) 2019, Nefelus Inc
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
//   list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
//   this list of conditions and the following disclaimer in the documentation
//   and/or other materials provided with the distribution.
//
// * Neither the name of the copyright holder nor the names of its
//   contributors may be used to endorse or promote products derived from
//   this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#include "dbDatabase.h"

#include <algorithm>
#include <map>
#include <string>

#include "db.h"
#include "dbArrayTable.h"
#include "dbBTerm.h"
#include "dbBlock.h"
#include "dbBlockCallBackObj.h"
#include "dbCCSeg.h"
#include "dbCapNode.h"
#include "dbChip.h"
#include "dbExtControl.h"
#include "dbITerm.h"
#include "dbJournal.h"
#include "dbLib.h"
#include "dbNameCache.h"
#include "dbNet.h"
#include "dbProperty.h"
#include "dbPropertyItr.h"
#include "dbRSeg.h"
#include "dbStream.h"
#include "dbTable.h"
#include "dbTable.hpp"
#include "dbTech.h"
#include "dbWire.h"
#include "utl/Logger.h"

namespace odb {

//
// Magic number is: ATHENADB
//
#define ADS_DB_MAGIC1 0x41544845  // ATHE
#define ADS_DB_MAGIC2 0x4E414442  // NADB

template class dbTable<_dbDatabase>;

static dbTable<_dbDatabase>* db_tbl = NULL;
static uint db_unique_id = 0;

bool _dbDatabase::operator==(const _dbDatabase& rhs) const
{
  //
  // For the time being the fields,
  // magic1, magic2, schema_major, schema_minor,
  // unique_id, and file,
  // are not used for comparison.
  //
  if (_master_id != rhs._master_id)
    return false;

  if (_chip != rhs._chip)
    return false;

  if (_tech != rhs._tech)
    return false;

  if (*_tech_tbl != *rhs._tech_tbl)
    return false;

  if (*_lib_tbl != *rhs._lib_tbl)
    return false;

  if (*_chip_tbl != *rhs._chip_tbl)
    return false;

  if (*_prop_tbl != *rhs._prop_tbl)
    return false;

  if (*_name_cache != *rhs._name_cache)
    return false;

  return true;
}

void _dbDatabase::differences(dbDiff& diff,
                              const char* field,
                              const _dbDatabase& rhs) const
{
  DIFF_BEGIN
  DIFF_FIELD(_master_id);
  DIFF_FIELD(_chip);
  DIFF_FIELD(_tech);
  DIFF_TABLE_NO_DEEP(_tech_tbl);
  DIFF_TABLE_NO_DEEP(_lib_tbl);
  DIFF_TABLE_NO_DEEP(_chip_tbl);
  DIFF_TABLE_NO_DEEP(_prop_tbl);
  DIFF_NAME_CACHE(_name_cache);
  DIFF_END
}

void _dbDatabase::out(dbDiff& diff, char side, const char* field) const
{
  DIFF_OUT_BEGIN
  DIFF_OUT_FIELD(_master_id);
  DIFF_OUT_FIELD(_chip);
  DIFF_OUT_FIELD(_tech);
  DIFF_OUT_TABLE_NO_DEEP(_tech_tbl);
  DIFF_OUT_TABLE_NO_DEEP(_lib_tbl);
  DIFF_OUT_TABLE_NO_DEEP(_chip_tbl);
  DIFF_OUT_TABLE_NO_DEEP(_prop_tbl);
  DIFF_OUT_NAME_CACHE(_name_cache);
  DIFF_END
}

dbObjectTable* _dbDatabase::getObjectTable(dbObjectType type)
{
  switch (type) {
    case dbDatabaseObj:
      return db_tbl;

    case dbTechObj:
      return _tech_tbl;

    case dbLibObj:
      return _lib_tbl;

    case dbChipObj:
      return _chip_tbl;

    case dbPropertyObj:
      return _prop_tbl;
    default:
      break;
  }

  return NULL;
}

////////////////////////////////////////////////////////////////////
//
// _dbDatabase - Methods
//
////////////////////////////////////////////////////////////////////

_dbDatabase::_dbDatabase(_dbDatabase* /* unused: db */)
{
  _magic1 = ADS_DB_MAGIC1;
  _magic2 = ADS_DB_MAGIC2;
  _schema_major = db_schema_major;
  _schema_minor = db_schema_minor;
  _master_id = 0;
  _file = NULL;
  _logger = nullptr;
  _unique_id = db_unique_id++;

  _chip_tbl = new dbTable<_dbChip>(
      this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbChipObj, 2, 1);

  _tech_tbl = new dbTable<_dbTech>(
      this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbTechObj, 2, 1);

  _lib_tbl = new dbTable<_dbLib>(
      this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbLibObj);

  _prop_tbl = new dbTable<_dbProperty>(
      this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbPropertyObj);

  _name_cache = new _dbNameCache(
      this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable);

  _prop_itr = new dbPropertyItr(_prop_tbl);
}

//
// This constructor is use by dbDatabase::clear(), so the the unique-id is
// reset.
//
_dbDatabase::_dbDatabase(_dbDatabase* /* unused: db */, int id)
{
  _magic1 = ADS_DB_MAGIC1;
  _magic2 = ADS_DB_MAGIC2;
  _schema_major = db_schema_major;
  _schema_minor = db_schema_minor;
  _master_id = 0;
  _file = NULL;
  _logger = nullptr;
  _unique_id = id;

  _chip_tbl = new dbTable<_dbChip>(
      this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbChipObj, 2, 1);

  _tech_tbl = new dbTable<_dbTech>(
      this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbTechObj, 2, 1);

  _lib_tbl = new dbTable<_dbLib>(
      this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbLibObj);

  _prop_tbl = new dbTable<_dbProperty>(
      this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbPropertyObj);

  _name_cache = new _dbNameCache(
      this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable);

  _prop_itr = new dbPropertyItr(_prop_tbl);
}

_dbDatabase::_dbDatabase(_dbDatabase* /* unused: db */, const _dbDatabase& d)
    : _magic1(d._magic1),
      _magic2(d._magic2),
      _schema_major(d._schema_major),
      _schema_minor(d._schema_minor),
      _master_id(d._master_id),
      _chip(d._chip),
      _tech(d._tech),
      _unique_id(db_unique_id++),
      _file(NULL),
      _logger(nullptr)
{
  if (d._file) {
    _file = strdup(d._file);
    ZALLOCATED(_file);
  }

  _chip_tbl = new dbTable<_dbChip>(this, this, *d._chip_tbl);

  _tech_tbl = new dbTable<_dbTech>(this, this, *d._tech_tbl);

  _lib_tbl = new dbTable<_dbLib>(this, this, *d._lib_tbl);

  _prop_tbl = new dbTable<_dbProperty>(this, this, *d._prop_tbl);

  _name_cache = new _dbNameCache(this, this, *d._name_cache);

  _prop_itr = new dbPropertyItr(_prop_tbl);
}

_dbDatabase::~_dbDatabase()
{
  delete _tech_tbl;
  delete _lib_tbl;
  delete _chip_tbl;
  delete _prop_tbl;
  delete _name_cache;
  // dimitri_fix
  // delete _prop_itr;

  if (_file)
    free(_file);
}

dbOStream& operator<<(dbOStream& stream, const _dbDatabase& db)
{
  stream << db._magic1;
  stream << db._magic2;
  stream << db._schema_major;
  stream << db._schema_minor;
  stream << db._master_id;
  stream << db._chip;
  stream << db._tech;
  stream << *db._tech_tbl;
  stream << *db._lib_tbl;
  stream << *db._chip_tbl;
  stream << *db._prop_tbl;
  stream << *db._name_cache;
  return stream;
}

dbIStream& operator>>(dbIStream& stream, _dbDatabase& db)
{
  stream >> db._magic1;

  if (db._magic1 != ADS_DB_MAGIC1)
    throw ZException("database file is not an OpenDB Database");

  stream >> db._magic2;

  if (db._magic2 != ADS_DB_MAGIC2)
    throw ZException("database file is not an OpenDB Database");

  stream >> db._schema_major;

  if (db._schema_major != db_schema_major)
    throw ZException("Incompatible database schema revision");

  stream >> db._schema_minor;

  if (db._schema_minor < db_schema_initial)
    throw ZException("incompatible database schema revision");

  stream >> db._master_id;

  stream >> db._chip;
  stream >> db._tech;
  stream >> *db._tech_tbl;
  stream >> *db._lib_tbl;
  stream >> *db._chip_tbl;
  stream >> *db._prop_tbl;
  stream >> *db._name_cache;

  // Fix up the owner id of properties of this db, this value changes.
  dbSet<_dbProperty> props(&db, db._prop_tbl);
  dbSet<_dbProperty>::iterator itr;
  uint oid = db.getId();

  for (itr = props.begin(); itr != props.end(); ++itr) {
    _dbProperty* p = *itr;
    p->_owner = oid;
  }

  // Set the revision of the database to the current revision
  db._schema_major = db_schema_major;
  db._schema_minor = db_schema_minor;
  return stream;
}

////////////////////////////////////////////////////////////////////
//
// dbDatabase - Methods
//
////////////////////////////////////////////////////////////////////

dbSet<dbLib> dbDatabase::getLibs()
{
  _dbDatabase* db = (_dbDatabase*) this;
  return dbSet<dbLib>(db, db->_lib_tbl);
}

dbLib* dbDatabase::findLib(const char* name)
{
  dbSet<dbLib> libs = getLibs();
  dbSet<dbLib>::iterator itr;

  for (itr = libs.begin(); itr != libs.end(); ++itr) {
    _dbLib* lib = (_dbLib*) *itr;

    if (strcmp(lib->_name, name) == 0)
      return (dbLib*) lib;
  }

  return NULL;
}

dbMaster* dbDatabase::findMaster(const char* name)
{
  dbSet<dbLib> libs = getLibs();
  dbSet<dbLib>::iterator it;
  for (it = libs.begin(); it != libs.end(); it++) {
    dbLib* lib = *it;
    dbMaster* master = lib->findMaster(name);
    if (master)
      return master;
  }
  return NULL;
}

dbSet<dbChip> dbDatabase::getChips()
{
  _dbDatabase* db = (_dbDatabase*) this;
  return dbSet<dbChip>(db, db->_chip_tbl);
}

uint dbDatabase::getNumberOfMasters()
{
  _dbDatabase* db = (_dbDatabase*) this;
  return db->_master_id;
}

dbChip* dbDatabase::getChip()
{
  _dbDatabase* db = (_dbDatabase*) this;

  if (db->_chip == 0)
    return NULL;

  return (dbChip*) db->_chip_tbl->getPtr(db->_chip);
}

dbTech* dbDatabase::getTech()
{
  _dbDatabase* db = (_dbDatabase*) this;

  if (db->_tech == 0)
    return NULL;

  return (dbTech*) db->_tech_tbl->getPtr(db->_tech);
}

void dbDatabase::read(FILE* file)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbIStream stream(db, file);
  stream >> *db;
}

void dbDatabase::readTech(FILE* file)
{
  _dbDatabase* db = (_dbDatabase*) this;
  _dbTech* tech = (_dbTech*) getTech();

  if (tech == NULL)
    tech = (_dbTech*) dbTech::create(this);
  else {
    tech->~_dbTech();
    new (tech) _dbTech(db);
  }

  dbIStream stream(db, file);
  stream >> *tech;
}

void dbDatabase::readLib(FILE* file, dbLib* lib)
{
  _dbDatabase* db = (_dbDatabase*) this;
  _dbLib* l = (_dbLib*) lib;

  l->~_dbLib();
  new (l) _dbLib(db);

  dbIStream stream(db, file);
  stream >> *l;
}

void dbDatabase::readLibs(FILE* file)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbIStream stream(db, file);
  stream >> *db->_lib_tbl;
}

void dbDatabase::readBlock(FILE* file, dbBlock* block)
{
  _dbDatabase* db = (_dbDatabase*) this;
  _dbBlock* b = (_dbBlock*) block;
  b->~_dbBlock();
  new (b) _dbBlock(db);
  dbIStream stream(db, file);
  stream >> *b;
}

void dbDatabase::readNets(FILE* file, dbBlock* block)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbIStream stream(db, file);

  std::list<dbBlockCallBackObj*>* cbs = &(((_dbBlock*) block)->_callbacks);
  std::list<dbBlockCallBackObj*>::const_iterator cbitr;
  for (cbitr = cbs->begin(); cbitr != cbs->end(); ++cbitr)
    (**cbitr)().inDbBlockReadNetsBefore(
        block);  // client ECO optimzation - payam

  stream >> *((_dbBlock*) block)->_net_tbl;
}

void dbDatabase::readWires(FILE* file, dbBlock* block)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbIStream stream(db, file);
  stream >> *((_dbBlock*) block)->_wire_tbl;
}

void dbDatabase::readParasitics(FILE* file, dbBlock* block)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbIStream stream(db, file);
  stream >> ((_dbBlock*) block)->_num_ext_corners;
  stream >> ((_dbBlock*) block)->_corner_name_list;
  stream >> *((_dbBlock*) block)->_r_val_tbl;
  stream >> *((_dbBlock*) block)->_c_val_tbl;
  stream >> *((_dbBlock*) block)->_cc_val_tbl;
  stream >> *((_dbBlock*) block)->_cap_node_tbl;
  stream >> *((_dbBlock*) block)->_r_seg_tbl;
  stream >> *((_dbBlock*) block)->_cc_seg_tbl;
  stream >> *((_dbBlock*) block)->_extControl;

  ((_dbBlock*) block)->_corners_per_block
      = ((_dbBlock*) block)->_num_ext_corners;
}

void dbDatabase::readChip(FILE* file)
{
  _dbDatabase* db = (_dbDatabase*) this;
  _dbChip* chip = (_dbChip*) getChip();
  chip->~_dbChip();
  new (chip) _dbChip(db);
  dbIStream stream(db, file);
  stream >> *chip;
}

void dbDatabase::write(FILE* file)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbOStream stream(db, file);
  stream << *db;
  fflush(file);
}

void dbDatabase::writeTech(FILE* file)
{
  _dbDatabase* db = (_dbDatabase*) this;
  _dbTech* tech = (_dbTech*) getTech();

  if (tech == NULL)
    throw ZException("No technology");

  dbOStream stream(db, file);
  stream << *tech;
  fflush(file);
}

void dbDatabase::writeLib(FILE* file, dbLib* lib)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbOStream stream(db, file);
  stream << *(_dbLib*) lib;
  fflush(file);
}

void dbDatabase::writeLibs(FILE* file)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbOStream stream(db, file);
  stream << *db->_lib_tbl;
  fflush(file);
}

void dbDatabase::writeBlock(FILE* file, dbBlock* block)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbOStream stream(db, file);
  stream << *(_dbBlock*) block;
  fflush(file);
}

void dbDatabase::writeNets(FILE* file, dbBlock* block)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbOStream stream(db, file);
  stream << *((_dbBlock*) block)->_net_tbl;
  fflush(file);
}

void dbDatabase::writeWires(FILE* file, dbBlock* block)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbOStream stream(db, file);
  stream << *((_dbBlock*) block)->_wire_tbl;
  fflush(file);
}

void dbDatabase::writeParasitics(FILE* file, dbBlock* block)
{
  _dbDatabase* db = (_dbDatabase*) this;
  dbOStream stream(db, file);
  stream << ((_dbBlock*) block)->_num_ext_corners;
  stream << ((_dbBlock*) block)->_corner_name_list;
  stream << *((_dbBlock*) block)->_r_val_tbl;
  stream << *((_dbBlock*) block)->_c_val_tbl;
  stream << *((_dbBlock*) block)->_cc_val_tbl;
  stream << *((_dbBlock*) block)->_cap_node_tbl;
  stream << *((_dbBlock*) block)->_r_seg_tbl;
  stream << *((_dbBlock*) block)->_cc_seg_tbl;
  stream << *((_dbBlock*) block)->_extControl;
  fflush(file);
}

void dbDatabase::writeChip(FILE* file)
{
  _dbDatabase* db = (_dbDatabase*) this;
  _dbChip* chip = (_dbChip*) getChip();
  dbOStream stream(db, file);
  stream << *chip;
  fflush(file);
}

void dbDatabase::beginEco(dbBlock* block_)
{
  _dbBlock* block = (_dbBlock*) block_;

  if (block->_journal)
    delete block->_journal;

  block->_journal = new dbJournal(block_);
  assert(block->_journal);
}

void dbDatabase::endEco(dbBlock* block_)
{
  _dbBlock* block = (_dbBlock*) block_;
  dbJournal* eco = block->_journal;
  block->_journal = NULL;

  if (block->_journal_pending)
    delete block->_journal_pending;

  block->_journal_pending = eco;
}

bool dbDatabase::ecoEmpty(dbBlock* block_)
{
  _dbBlock* block = (_dbBlock*) block_;

  if (block->_journal)
    return block->_journal->empty();

  return false;
}

int dbDatabase::checkEco(dbBlock* block_)
{
  _dbBlock* block = (_dbBlock*) block_;

  if (block->_journal) {
    return block->_journal->size();
  } else {
    return 0;
  }
}

void dbDatabase::readEco(dbBlock* block_, const char* filename)
{
  _dbBlock* block = (_dbBlock*) block_;

  FILE* file = fopen(filename, "r");
  if (!file) {
    int errnum = errno;
    block->getImpl()->getLogger()->error(
        utl::ODB, 1, "Error opening file {}", strerror(errnum));
    return;
  }

  dbIStream stream(block->getDatabase(), file);
  dbJournal* eco = new dbJournal(block_);
  assert(eco);
  stream >> *eco;

  if (block->_journal_pending)
    delete block->_journal_pending;

  block->_journal_pending = eco;

  fclose(file);
}

void dbDatabase::writeEco(dbBlock* block_, const char* filename)
{
  _dbBlock* block = (_dbBlock*) block_;

  FILE* file = fopen(filename, "w");
  if (!file) {
    int errnum = errno;
    block->getImpl()->getLogger()->error(
        utl::ODB, 2, "Error opening file {}", strerror(errnum));
    return;
  }

  if (block->_journal_pending) {
    dbOStream stream(block->getDatabase(), file);
    stream << *block->_journal_pending;
  }

  fclose(file);
}

void dbDatabase::commitEco(dbBlock* block_)
{
  _dbBlock* block = (_dbBlock*) block_;

  // TODO: Need a check to ensure the commit is not applied to the block of
  // which
  //       this eco was generated from.
  if (block->_journal_pending) {
    block->_journal_pending->redo();
    delete block->_journal_pending;
    block->_journal_pending = NULL;
  }
}

void dbDatabase::setLogger(utl::Logger* logger)
{
  _dbDatabase* _db = (_dbDatabase*) this;
  _db->_logger = logger;
}

dbDatabase* dbDatabase::create()
{
  if (db_tbl == NULL) {
    db_tbl = new dbTable<_dbDatabase>(
        NULL, NULL, (GetObjTbl_t) NULL, dbDatabaseObj);
  }

  _dbDatabase* db = db_tbl->create();
  return (dbDatabase*) db;
}

void dbDatabase::clear()
{
  _dbDatabase* db = (_dbDatabase*) this;
  int id = db->_unique_id;
  db->~_dbDatabase();
  new (db) _dbDatabase(db, id);
}

void dbDatabase::destroy(dbDatabase* db_)
{
  _dbDatabase* db = (_dbDatabase*) db_;
  db_tbl->destroy(db);
}

dbDatabase* dbDatabase::duplicate(dbDatabase* db_)
{
  _dbDatabase* db = (_dbDatabase*) db_;
  _dbDatabase* d = db_tbl->duplicate(db);
  return (dbDatabase*) d;
}

dbDatabase* dbDatabase::getDatabase(uint dbid)
{
  return (dbDatabase*) db_tbl->getPtr(dbid);
}

dbDatabase* dbObject::getDb() const
{
  return (dbDatabase*) getImpl()->getDatabase();
}

utl::Logger* _dbObject::getLogger() const
{
  return getDatabase()->getLogger();
}

bool dbDatabase::diff(dbDatabase* db0_,
                      dbDatabase* db1_,
                      FILE* file,
                      int indent)
{
  _dbDatabase* db0 = (_dbDatabase*) db0_;
  _dbDatabase* db1 = (_dbDatabase*) db1_;
  dbDiff diff(file);
  diff.setIndentPerLevel(indent);
  db0->differences(diff, NULL, *db1);
  return diff.hasDifferences();
}

}  // namespace odb


text:
CKEDITOR.plugins.setLang( 'about', 'en-au', {
	copy: 'Copyright © $1. All rights reserved.',
	dlgTitle: 'About CKEditor 4',
	moreInfo: 'For licensing information please visit our web site:'
} );


text:
@implementation DLTopFlowLayout

- (void)prepareLayout{
    [super prepareLayout];
    self.itemSize = CGSizeMake(kScreenWidth / 4.0, 30);
    self.minimumLineSpacing = 0;
    self.minimumInteritemSpacing = 0;
    self.scrollDirection = UICollectionViewScrollDirectionHorizontal;
    self.collectionView.showsVerticalScrollIndicator = NO;
    self.collectionView.showsHorizontalScrollIndicator = NO;
    self.collectionView.bounces = NO;
}

@end


text:
package com.box.l10n.mojito.cli.command.checks;

import static com.box.l10n.mojito.cli.command.extractioncheck.ExtractionCheckNotificationSender.QUOTE_MARKER;

import com.box.l10n.mojito.cli.command.extraction.AssetExtractionDiff;
import com.box.l10n.mojito.okapi.extractor.AssetExtractorTextUnit;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * {@link AbstractCliChecker} that verifies the comment and context parameters are provided and are
 * not identical.
 *
 * @author mallen
 */
public class ContextAndCommentCliChecker extends AbstractCliChecker {

  static Logger logger = LoggerFactory.getLogger(ContextAndCommentCliChecker.class);

  static class ContextAndCommentCliCheckerResult {
    String sourceString;
    String failureMessage;
    boolean failed;

    public ContextAndCommentCliCheckerResult(
        boolean failed, String sourceString, String failureMessage) {
      this.sourceString = sourceString;
      this.failureMessage = failureMessage;
      this.failed = failed;
    }

    public ContextAndCommentCliCheckerResult(boolean failed) {
      this.failed = failed;
    }

    public String getSourceString() {
      return sourceString;
    }

    public String getFailureMessage() {
      return failureMessage;
    }

    public boolean isFailed() {
      return failed;
    }
  }

  @Override
  public CliCheckResult run(List<AssetExtractionDiff> assetExtractionDiffs) {
    CliCheckResult cliCheckResult = createCliCheckerResult();
    List<ContextAndCommentCliCheckerResult> results = runChecks(assetExtractionDiffs);
    if (results.stream().anyMatch(ContextAndCommentCliCheckerResult::isFailed)) {
      cliCheckResult.setSuccessful(false);
      cliCheckResult.setNotificationText(
          "Context and comment check found failures:"
              + System.lineSeparator()
              + results.stream()
                  .filter(ContextAndCommentCliCheckerResult::isFailed)
                  .map(
                      result ->
                          "* Source string "
                              + QUOTE_MARKER
                              + result.getSourceString()
                              + QUOTE_MARKER
                              + " failed check with error: "
                              + result.getFailureMessage())
                  .collect(Collectors.joining(System.lineSeparator()))
              + System.lineSeparator());
    }
    return cliCheckResult;
  }

  private List<ContextAndCommentCliCheckerResult> runChecks(
      List<AssetExtractionDiff> assetExtractionDiffs) {
    return getAddedTextUnits(assetExtractionDiffs).stream()
        .map(
            assetExtractorTextUnit ->
                getContextAndCommentCliCheckerResult(
                    assetExtractorTextUnit, checkTextUnit(assetExtractorTextUnit)))
        .collect(Collectors.toList());
  }

  private ContextAndCommentCliCheckerResult getContextAndCommentCliCheckerResult(
      AssetExtractorTextUnit assetExtractorTextUnit, String failureText) {
    ContextAndCommentCliCheckerResult result;
    if (failureText != null) {
      logger.debug(
          "'{}' source string failed check with error: {}",
          assetExtractorTextUnit.getSource(),
          failureText);
      result =
          new ContextAndCommentCliCheckerResult(
              true, assetExtractorTextUnit.getSource(), failureText);
    } else {
      result = new ContextAndCommentCliCheckerResult(false);
    }
    return result;
  }

  private String checkTextUnit(AssetExtractorTextUnit assetExtractorTextUnit) {
    String failureText = null;
    String[] splitNameArray = assetExtractorTextUnit.getName().split("---");
    String context = null;
    if (splitNameArray.length > 1) {
      context = splitNameArray[1];
    }
    String comment = assetExtractorTextUnit.getComments();

    if (!isBlank(context) && !isBlank(comment)) {
      if (context.trim().equalsIgnoreCase(comment.trim())) {
        failureText = "Context & comment strings should not be identical.";
      }
    } else if (isBlank(context) && isBlank(comment)) {
      failureText = "Context and comment strings are both empty.";
    } else if (isBlank(context)) {
      failureText = "Context string is empty.";
    } else if (isBlank(comment)) {
      failureText = "Comment string is empty.";
    }

    return failureText;
  }

  private boolean isBlank(String string) {
    return StringUtils.isBlank(string);
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Shipping" default="build" basedir=".">
    <target name="build"
            depends="prepare,composer,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit"/>

    <target name="build-parallel"
            depends="prepare,composer,lint,tools-parallel,phpunit"/>

    <target name="tools-parallel" description="Run tools in parallel">
        <parallel threadCount="2">
            <sequential>
                <antcall target="pdepend"/>
                <antcall target="phpmd-ci"/>
            </sequential>
            <antcall target="phpcpd"/>
            <antcall target="phpcs-ci"/>
            <antcall target="phploc"/>
        </parallel>
    </target>

    <target name="clean" description="Cleanup build artifacts">
        <delete dir="build/coverage"/>
        <delete dir="build/logs"/>
        <delete dir="build/pdepend"/>
        <delete>
            <fileset dir="vendor">
                <include name="*/**" />
                <include name="*" />
            </fileset>
        </delete>
        <delete file="composer.lock"/>
    </target>

    <target name="prepare" depends="clean" description="Prepare for build">
        <mkdir dir="build/coverage"/>
        <mkdir dir="build/logs"/>
        <mkdir dir="build/pdepend"/>
    </target>

    <target name="composer" description="Install dependencies  with composer">
        <exec executable="composer" passthru="true" checkreturn="true">
            <arg value="install" />
        </exec>
    </target>

    <target name="lint" description="Perform syntax check of sourcecode files">
        <phplint haltonfailure="true" deprecatedAsError="true">
            <fileset dir="./">
                <include name="**/*.php" />
                <exclude name="build/**" />
                <exclude name="vendor/**" />
            </fileset>
        </phplint>
    </target>

    <target name="phploc" description="Measure project size using PHPLOC">
        <exec executable="phploc" passthru="true">
            <arg value="--count-tests" />
            <arg value="--log-csv" />
            <arg value="build/logs/phploc.csv" />
            <arg value="--exclude"/>
            <arg value="build" />
            <arg value="--exclude"/>
            <arg value="vendor" />
            <arg path="./" />
        </exec>
    </target>

    <target name="pdepend" description="Calculate software metrics using PHP_Depend">
        <phpdepend>
            <fileset dir="./">
                <include name="**/*.php" />
                <exclude name="build/**" />
                <exclude name="vendor/**" />
                <exclude name="test/**" />
            </fileset>
            <logger type="jdepend-xml" outfile="build/logs/jdepend.xml"/>
            <logger type="jdepend-chart" outfile="build/pdepend/dependencies.svg"/>
            <logger type="overview-pyramid" outfile="build/pdepend/overview-pyramid.svg"/>
        </phpdepend>
    </target>

    <target name="phpmd"
            description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
        <exec executable="phpmd" passthru="true">
            <arg path="./" />
            <arg value="text" />
            <arg value="build/phpmd.xml" />
            <arg value="--suffixes" />
            <arg value="php" />
            <arg value="--exclude"/>
            <arg value="build,vendor,test" />
        </exec>
    </target>

    <target name="phpmd-ci" description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
        <exec executable="phpmd" passthru="true">
            <arg path="./" />
            <arg value="xml" />
            <arg value="build/phpmd.xml" />
            <arg value="--suffixes" />
            <arg value="php" />
            <arg value="--reportfile" />
            <arg value="build/logs/pmd.xml" />
            <arg value="--exclude"/>
            <arg value="build,vendor,test" />
        </exec>
    </target>

    <target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
        <exec executable="phpcs" passthru="true">
            <arg value="--extensions=php" />
            <arg value="--standard=build/phpcs.xml" />
            <arg value="--ignore=build/*,vendor/*,test/*"/>
            <arg path="./" />
        </exec>
    </target>

    <target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
        <exec executable="phpcs" passthru="true">
            <arg value="--extensions=php" />
            <arg value="--report=checkstyle" />
            <arg value="--report-file=build/logs/checkstyle.xml" />
            <arg value="--standard=build/phpcs.xml" />
            <arg value="--ignore=build/*,vendor/*,test/*"/>
            <arg path="./" />
        </exec>
    </target>

    <target name="phpcpd" description="Find duplicate code using PHPCPD">
        <exec executable="phpcpd" passthru="true">
            <arg value="--log-pmd" />
            <arg value="build/logs/pmd-cpd.xml" />
            <arg value="--exclude"/>
            <arg value="build" />
            <arg value="--exclude"/>
            <arg value="vendor" />
            <arg value="--exclude"/>
            <arg value="test" />
            <arg path="./" />
        </exec>
    </target>

    <target name="phpunit" description="Run unit tests with PHPUnit">
        <exec executable="phpunit" passthru="true">
            <arg value="--configuration=build\phpunit.xml" />
        </exec>
    </target>

</project>


text:
<?php

namespace Carbid;

/**
 * Class DynamicDCA
 */
class DynamicDCA
{

    public static function getLabelTranslation($labelData, $language)
    {
        if (!isset($labelData)) {
            return null;
        }

        if (!is_array($labelData))
        {
            return array($labelData, '');
        }

        if (!count(array_filter(array_keys($labelData), 'is_string'))) {
            return $labelData;
        }

        if (isset($labelData[$language])) {
            return is_array($labelData[$language]) ? $labelData[$language] : array($labelData[$language], '');
        }

        if (isset($labelData['en'])) {
            return is_array($labelData['en']) ? $labelData['en'] : array($labelData['en'], '');
        }

        $arr = array_values($labelData);
        return is_array($arr[0]) ? $arr[0] : array($arr[0], '');
    }

    public static function getVariablesValues($data, $arrFields)
    {

    }

    public static function getVariablesTypes($arrFields)
    {

    }

}


text:
    <title>DOM 2 Events -- MutationEvent</title>

original value


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

package org.camunda.bpm.engine.identity;

import org.camunda.bpm.engine.query.Query;

/**
 * Allows programmatic querying of {@link User}
 *
 * @author Joram Barrez
 */
public interface UserQuery extends Query<UserQuery, User> {

  /** Only select {@link User}s with the given id/ */
  UserQuery userId(String id);

  /** Only select {@link User}s with the given ids */
  UserQuery userIdIn(String... ids);

  /** Only select {@link User}s with the given firstName. */
  UserQuery userFirstName(String firstName);

  /** Only select {@link User}s where the first name matches the given parameter.
   * The syntax is that of SQL, eg. %activivi%.
   */
  UserQuery userFirstNameLike(String firstNameLike);

  /** Only select {@link User}s with the given lastName. */
  UserQuery userLastName(String lastName);

  /** Only select {@link User}s where the last name matches the given parameter.
   * The syntax is that of SQL, eg. %activivi%.
   */
  UserQuery userLastNameLike(String lastNameLike);

  /** Only those {@link User}s with the given email addres. */
  UserQuery userEmail(String email);

  /** Only select {@link User}s where the email matches the given parameter.
   * The syntax is that of SQL, eg. %activivi%.
   */
  UserQuery userEmailLike(String emailLike);

  /** Only select {@link User}s that belong to the given group. */
  UserQuery memberOfGroup(String groupId);

  /** Only select {@link User}S that are potential starter for the given process definition. */
  UserQuery potentialStarter(String procDefId);

  /** Only select {@link User}s that belongs to the given tenant. */
  UserQuery memberOfTenant(String tenantId);

  //sorting ////////////////////////////////////////////////////////

  /** Order by user id (needs to be followed by {@link #asc()} or {@link #desc()}). */
  UserQuery orderByUserId();

  /** Order by user first name (needs to be followed by {@link #asc()} or {@link #desc()}). */
  UserQuery orderByUserFirstName();

  /** Order by user last name (needs to be followed by {@link #asc()} or {@link #desc()}). */
  UserQuery orderByUserLastName();

  /** Order by user email  (needs to be followed by {@link #asc()} or {@link #desc()}). */
  UserQuery orderByUserEmail();

}