text:
package pqt

import "fmt"

// Type ...
type Type interface {
	fmt.Stringer
	// Fingerprint returns unique identifier of the type. Two different types can have same SQL representation.
	Fingerprint() string
}

// BaseType ...
type BaseType struct {
	name string
}

// String implements Stringer interface.
func (bt BaseType) String() string {
	return bt.name
}

// Fingerprint implements Type interface.
func (bt BaseType) Fingerprint() string {
	return fmt.Sprintf("base: %s", bt.name)
}

// TypeDecimal ...
func TypeDecimal(precision, scale int) BaseType {
	switch {
	case precision == 0:
		return BaseType{name: "DECIMAL"}
	case precision != 0 && scale == 0:
		return BaseType{name: fmt.Sprintf("DECIMAL(%d)", precision)}
	default:
		return BaseType{name: fmt.Sprintf("DECIMAL(%d,%d)", precision, scale)}
	}
}

// TypeReal ...
func TypeReal() BaseType {
	return BaseType{name: "REAL"}
}

// TypeSerial ...
func TypeSerial() BaseType {
	return BaseType{name: "SERIAL"}
}

// TypeSerialSmall ...
func TypeSerialSmall() BaseType {
	return BaseType{name: "SMALLSERIAL"}
}

// TypeSerialBig ...
func TypeSerialBig() BaseType {
	return BaseType{name: "BIGSERIAL"}
}

// TypeInteger is the common choice, as it offers the best balance between range, storage size, and performance.
func TypeInteger() BaseType {
	return BaseType{name: "INTEGER"}
}

// TypeIntegerSmall is generally only used if disk space is at a premium.
func TypeIntegerSmall() BaseType {
	return BaseType{name: "SMALLINT"}
}

// TypeIntegerBig is designed to be used when the range of the TypeInteger is insufficient.
func TypeIntegerBig() BaseType {
	return BaseType{name: "BIGINT"}
}

// TypeIntegerArray ...
func TypeIntegerArray(l int) BaseType {
	if l == 0 {
		return BaseType{name: "INTEGER[]"}
	}
	return BaseType{name: fmt.Sprintf("INTEGER[%d]", l)}
}

// TypeIntegerBigArray ...
func TypeIntegerBigArray(l int) BaseType {
	if l == 0 {
		return BaseType{name: "BIGINT[]"}
	}
	return BaseType{name: fmt.Sprintf("BIGINT[%d]", l)}
}

// TypeIntegerSmallArray ...
func TypeIntegerSmallArray(l int) BaseType {
	if l == 0 {
		return BaseType{name: "SMALLINT[]"}
	}
	return BaseType{name: fmt.Sprintf("SMALLINT[%d]", l)}
}

// TypeDoubleArray ...
func TypeDoubleArray(l int) BaseType {
	if l == 0 {
		return BaseType{name: "DOUBLE PRECISION[]"}
	}
	return BaseType{name: fmt.Sprintf("DOUBLE PRECISION[%d]", l)}
}

// TypeNumeric can store numbers with a very large number of digits.
// It is especially recommended for storing monetary amounts and other quantities where exactness is required.
// Calculations with numeric values yield exact results where possible, e.g. addition, subtraction, multiplication.
// However, calculations on numeric values are very slow compared to the integer types, or to the floating-point types described in the next section.
func TypeNumeric(precision, scale int) BaseType {
	switch {
	case precision == 0:
		return BaseType{name: "NUMERIC"}
	case precision != 0 && scale == 0:
		return BaseType{name: fmt.Sprintf("NUMERIC(%d)", precision)}
	default:
		return BaseType{name: fmt.Sprintf("NUMERIC(%d,%d)", precision, scale)}
	}
}

// TypeDoublePrecision is a numeric type with 15 decimal digits precision.
func TypeDoublePrecision() BaseType {
	return BaseType{name: "DOUBLE PRECISION"}
}

// TypeBool is a state of true or false.
func TypeBool() BaseType {
	return BaseType{name: "BOOL"}
}

// TypeUUID stores Universally Unique Identifiers (UUID) as defined by RFC 4122, ISO/IEC 9834-8:2005, and related standards.
// (Some systems refer to this data type as a globally unique identifier, or GUID, instead.)
// This identifier is a 128-bit quantity that is generated by an algorithm chosen to make it very unlikely that the same identifier will be generated by anyone else in the known universe using the same algorithm.
// Therefore, for distributed systems, these identifiers provide a better uniqueness guarantee than sequence generators, which are only unique within a single database.
func TypeUUID() BaseType {
	return BaseType{name: "UUID"}
}

// TypeCharacter is physically padded with spaces to the specified width n, and are stored and displayed that way.
func TypeCharacter(l int) BaseType {
	return BaseType{name: fmt.Sprintf("CHARACTER[%d]", l)}
}

// TypeText is variable-length character string.
func TypeText() BaseType {
	return BaseType{name: "TEXT"}
}

// TypeTextArray ...
func TypeTextArray(l int) BaseType {
	if l == 0 {
		return BaseType{name: "TEXT[]"}
	}
	return BaseType{name: fmt.Sprintf("TEXT[%d]", l)}
}

// TypeVarchar ...
func TypeVarchar(l int) BaseType {
	if l == 0 {
		return BaseType{name: "VARCHAR"}

	}
	return BaseType{name: fmt.Sprintf("VARCHAR(%d)", l)}
}

// TypeBytea ...
func TypeBytea() BaseType {
	return BaseType{name: "BYTEA"}
}

// TypeTimestamp is a date and time (no time zone).
func TypeTimestamp() BaseType {
	return BaseType{name: "TIMESTAMP"}
}

// TypeTimestampTZ is a date and time, including time zone
func TypeTimestampTZ() BaseType {
	return BaseType{name: "TIMESTAMPTZ"}
}

// TypeJSON is for storing JSON (JavaScript Object Notation) data, as specified in RFC 7159.
// Such data can also be stored as text, but the JSON data types have the advantage of enforcing that each stored value is valid according to the JSON rules.
func TypeJSON() BaseType {
	return BaseType{name: "JSON"}
}

// TypeJSONB in compare to TypeJSON is stored in a decomposed binary format that makes it slightly slower to input due to added conversion overhead, but significantly faster to process, since no reparsing is needed.
// JSONB also supports indexing, which can be a significant advantage.
func TypeJSONB() BaseType {
	return BaseType{name: "JSONB"}
}

// CompositeType represents the structure of a row or record.
// It is essentially just a list of field names and their data types.
// PostgreSQL allows composite types to be used in many of the same ways that simple types can be used.
// For example, a column of a table can be declared to be of a composite type.
// EXPERIMENTAL
type CompositeType struct {
	name       string
	Attributes []*Attribute
}

// String implements Stringer interface.
func (ct CompositeType) String() string {
	return "" // TODO: ?
}

// Fingerprint implements Type interface.
func (ct CompositeType) Fingerprint() string {
	return fmt.Sprintf("composite: %v", ct)
}

// TypeComposite allocates CompositeType with given name and attributes.
func TypeComposite(name string, attributes ...*Attribute) CompositeType {
	return CompositeType{
		name:       name,
		Attributes: attributes,
	}
}

// EnumeratedType ...
// EXPERIMENTAL
type EnumeratedType struct {
	name  string
	Enums []string
}

// String implements Stringer interface.
func (et EnumeratedType) String() string {
	return et.name
}

// Fingerprint implements Type interface.
func (et EnumeratedType) Fingerprint() string {
	return fmt.Sprintf("enumarated: %v", et)
}

// TypeEnumerated ...
func TypeEnumerated(name string, enums ...string) EnumeratedType {
	return EnumeratedType{
		name:  name,
		Enums: enums,
	}
}

// PseudoType ...
// EXPERIMENTAL
type PseudoType struct {
	name string
	//	input, output Function
}

// String implements Stringer interface.
func (pt PseudoType) String() string {
	return pt.name
}

// Fingerprint implements Type interface.
func (pt PseudoType) Fingerprint() string {
	return fmt.Sprintf("pseudo: %v", pt)
}

// TypePseudo ...
func TypePseudo(name string) PseudoType {
	return PseudoType{
		name: name,
	}
}

// MappableType ...
type MappableType struct {
	From    Type
	Mapping []Type
}

// String implements Stringer interface.
func (mt MappableType) String() string {
	return mt.From.String()
}

// Fingerprint implements Type interface.
func (mt MappableType) Fingerprint() string {
	return fmt.Sprintf("mappable: %v", mt)
}

// TypeMappable ...
func TypeMappable(from Type, mapping ...Type) MappableType {
	return MappableType{
		From:    from,
		Mapping: mapping,
	}
}


text:
package eloqua

import (
	"fmt"
)

// ContentSectionService provides access to all the endpoints related
// to content section data within eloqua
//
// Eloqua API docs: https://goo.gl/cKpFbL
type ContentSectionService struct {
	client *Client
}

// ContentSection represents an Eloqua content section object.
// In Eloqua these are known as 'Shared Content'
type ContentSection struct {
	Type        string      `json:"type,omitempty"`
	ID          int         `json:"id,omitempty,string"`
	CreatedAt   int         `json:"createdAt,omitempty,string"`
	CreatedBy   int         `json:"createdBy,omitempty,string"`
	Depth       string      `json:"depth,omitempty"`
	Name        string      `json:"name,omitempty"`
	Description string      `json:"description,omitempty"`
	UpdatedAt   int         `json:"updatedAt,omitempty,string"`
	UpdatedBy   int         `json:"updatedBy,omitempty,string"`
	ContentHTML string      `json:"contentHtml,omitempty"`
	ContentText string      `json:"contentText,omitempty"`
	Scope       string      `json:"scope,omitempty"`
	Forms       []Form      `json:"forms,omitempty"`
	Hyperlinks  []Hyperlink `json:"hyperlinks,omitempty"`
	Images      []Image     `json:"images,omitempty"`
	Size        Size        `json:"size,omitempty"`
}

// Create a new content section in eloqua
func (e *ContentSectionService) Create(name string, contentSection *ContentSection) (*ContentSection, *Response, error) {
	if contentSection == nil {
		contentSection = &ContentSection{}
	}

	contentSection.Name = name
	endpoint := "/assets/contentSection"
	resp, err := e.client.postRequestDecode(endpoint, contentSection)
	return contentSection, resp, err
}

// Get a content section object via its ID
func (e *ContentSectionService) Get(id int) (*ContentSection, *Response, error) {
	endpoint := fmt.Sprintf("/assets/contentSection/%d?depth=complete", id)
	contentSection := &ContentSection{}
	resp, err := e.client.getRequestDecode(endpoint, contentSection)
	return contentSection, resp, err
}

// List many eloqua content sections
func (e *ContentSectionService) List(opts *ListOptions) ([]ContentSection, *Response, error) {
	endpoint := "/assets/contentSections"
	contentSections := new([]ContentSection)
	resp, err := e.client.getRequestListDecode(endpoint, contentSections, opts)
	return *contentSections, resp, err
}

// Update an existing content section in eloqua
func (e *ContentSectionService) Update(id int, name string, contentSection *ContentSection) (*ContentSection, *Response, error) {
	if contentSection == nil {
		contentSection = &ContentSection{}
	}

	contentSection.ID = id
	contentSection.Name = name

	endpoint := fmt.Sprintf("/assets/contentSection/%d", contentSection.ID)
	resp, err := e.client.putRequestDecode(endpoint, contentSection)
	return contentSection, resp, err
}

// Delete an existing content section from eloqua
func (e *ContentSectionService) Delete(id int) (*Response, error) {
	contentSection := &ContentSection{ID: id}
	endpoint := fmt.Sprintf("/assets/contentSection/%d", contentSection.ID)
	resp, err := e.client.deleteRequest(endpoint, contentSection)
	return resp, err
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class org.apache.hadoop.hbase.util.ChecksumType (HBase 0.98.6-hadoop2 API)</title>
<meta name="date" content="2014-09-03">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.hadoop.hbase.util.ChecksumType

Packages that use ChecksumType

Package
Description

org.apache.hadoop.hbase.io.hfile

Provides the hbase data+index+metadata file.

org.apache.hadoop.hbase.regionserver

org.apache.hadoop.hbase.util

Uses of ChecksumType in org.apache.hadoop.hbase.io.hfile

Fields in org.apache.hadoop.hbase.io.hfile declared as ChecksumType

Modifier and Type
Field and Description

static ChecksumType
HFile.DEFAULT_CHECKSUM_TYPE

static ChecksumType
HFileContext.DEFAULT_CHECKSUM_TYPE

static ChecksumType
HFileContextBuilder.DEFAULT_CHECKSUM_TYPE

Methods in org.apache.hadoop.hbase.io.hfile that return ChecksumType

Modifier and Type
Method and Description

ChecksumType
HFileContext.getChecksumType()

Methods in org.apache.hadoop.hbase.io.hfile with parameters of type ChecksumType

Modifier and Type
Method and Description

HFileContextBuilder
HFileContextBuilder.withChecksumType(ChecksumType checkSumType)

Constructors in org.apache.hadoop.hbase.io.hfile with parameters of type ChecksumType

Constructor and Description

HFileContext(boolean useHBaseChecksum,
            boolean includesMvcc,
            boolean includesTags,
            Compression.Algorithm compressAlgo,
            boolean compressTags,
            ChecksumType checksumType,
            int bytesPerChecksum,
            int blockSize,
            DataBlockEncoding encoding,
            Encryption.Context cryptoContext)

Uses of ChecksumType in org.apache.hadoop.hbase.regionserver

Fields in org.apache.hadoop.hbase.regionserver declared as ChecksumType

Modifier and Type
Field and Description

protected ChecksumType
StoreFile.Writer.checksumType

Checksum type

Methods in org.apache.hadoop.hbase.regionserver that return ChecksumType

Modifier and Type
Method and Description

static ChecksumType
HStore.getChecksumType(org.apache.hadoop.conf.Configuration conf)

Returns the configured checksum algorithm.

Uses of ChecksumType in org.apache.hadoop.hbase.util

Methods in org.apache.hadoop.hbase.util that return ChecksumType

Modifier and Type
Method and Description

static ChecksumType
ChecksumType.codeToType(byte b)

Cannot rely on enum ordinals .

static ChecksumType
ChecksumType.nameToType(String name)

Map a checksum name to a specific type.

static ChecksumType
ChecksumType.valueOf(String name)

Returns the enum constant of this type with the specified name.

static ChecksumType[]
ChecksumType.values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2014 The Apache Software Foundation. All rights reserved.


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PluginScript" inherits="Script" version="4.0">
	<brief_description>
	</brief_description>
	<description>
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="new" qualifiers="vararg">
			<return type="Variant" />
			<description>
				Returns a new instance of the script.
			</description>
		</method>
	</methods>
</class>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Overview List
</TITLE>

<META NAME="date" CONTENT="2012-08-10">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

All Classes

Packages

edu.stolaf.cs.wmrserver

edu.stolaf.cs.wmrserver.db

edu.stolaf.cs.wmrserver.streaming

edu.stolaf.cs.wmrserver.testjob

edu.stolaf.cs.wmrserver.thrift


text:
"""Tests for models."""

import functools
from typing import Any, Dict, Mapping, Sequence

from absl.testing import absltest
from absl.testing import parameterized
import flax
import jax
from jax import numpy as jnp
import ml_collections
import numpy as np

from sparse_mixers import models
from sparse_mixers.configs import base as base_config

# Type Stubs
ClassificationStats = models.ClassificationStats
DispatchAlgorithm = base_config.DispatchAlgorithm
FrozenDict = flax.core.frozen_dict.FrozenDict
LayerLayout = base_config.LayerLayout
Model = Any
ModelArchitecture = base_config.ModelArchitecture
PRNGKey = models.PRNGKey

def dummy_config(model_arch):
  """Creates a dummy model config that can be used by all tests."""
  config = base_config.get_config()
  config.model_arch = model_arch.name
  config.d_emb = 2
  config.d_model = 2
  config.d_ff = 2
  config.max_seq_length = 4
  config.num_heads = 1
  config.num_layers = 2
  config.vocab_size = 16
  config.pad_id = 0
  config.train_batch_size = 3
  config.eval_batch_size = 2
  config.use_fft = True
  config.num_experts = 2
  config.num_moe_layers = 0
  config.num_attention_layers = 0
  config.max_group_size = 2
  config.auxiliary_loss_factor = 0.01
  config.router_z_loss_factor = 0.01
  config.dispatch_algorithm = DispatchAlgorithm.MASK_TOKENS_CHOOSE
  config.dtype = jnp.float32

  return config

def dummy_inputs(
    key,
    config):
  """Creates a dummy model base inputs."""
  return {
      "input_ids":
          jax.random.randint(
              key, (config.train_batch_size, config.max_seq_length),
              minval=0,
              maxval=10),
      "type_ids":
          jax.random.randint(
              key, (config.train_batch_size, config.max_seq_length),
              minval=0,
              maxval=config.type_vocab_size)
  }

def init_encoder_batch(
    config):
  """Creates a batch of inputs used to initialize the models.EncoderModel."""
  return {
      "input_ids": jnp.ones((1, config.max_seq_length), jnp.int32),
      "type_ids": jnp.ones((1, config.max_seq_length), jnp.int32)
  }

def init_model_params(
    key, model,
    init_batch):
  """Initializes model parameters."""
  dropout_key, jitter_key = jax.random.split(key)
  jit_init = jax.jit(model.init)
  initial_variables = jit_init(
      {
          "params": key,
          "dropout": dropout_key,
          "jitter": jitter_key
      }, **init_batch)
  return initial_variables["params"]

class ModelsTest(parameterized.TestCase):

  @parameterized.parameters(
      dict(model_arch=ModelArchitecture.F_NET),
      dict(model_arch=ModelArchitecture.H_NET))
  def test_unparametrized_mixing(self, model_arch):
    config = dummy_config(model_arch=model_arch)
    frozen_config = ml_collections.FrozenConfigDict(config)

    encoder = models.EncoderModel(config=frozen_config)

    rng = jax.random.PRNGKey(0)
    init_batch = init_encoder_batch(config=frozen_config)
    params = init_model_params(rng, encoder, init_batch)
    # Unparameterized mixing encoders do not have any parameters in their mixing
    # layers, so their mixing layer names do not show up in params.
    expected_keys = {
        "embedder", "encoder_0", "encoder_1", "feed_forward_0",
        "feed_forward_1", "pooler"
    }
    self.assertEqual(params.keys(), expected_keys)

    inputs = dummy_inputs(rng, config=frozen_config)
    encoder_output = encoder.apply({"params": params},
                                   rngs={"dropout": rng},
                                   **inputs)
    expected_sequence_output_shape = (config.train_batch_size,
                                      config.max_seq_length, config.d_model)
    self.assertEqual(encoder_output.sequence_output.shape,
                     expected_sequence_output_shape)
    expected_pooled_output_shape = (config.train_batch_size, config.d_model)
    self.assertEqual(encoder_output.pooled_output.shape,
                     expected_pooled_output_shape)

  def test_f_net_bad_long_seq(self):
    config = dummy_config(model_arch=ModelArchitecture.F_NET)
    with config.unlocked():
      config.use_fft = True
      config.max_seq_length = 8194  # Long seq but not power of 2
    frozen_config = ml_collections.FrozenConfigDict(config)

    encoder = models.EncoderModel(config=frozen_config)

    rng = jax.random.PRNGKey(0)
    init_batch = init_encoder_batch(config=frozen_config)

    with self.assertRaisesRegex(
        ValueError,
        "must be a power of 2 to take advantage of FFT optimizations"):
      _ = init_model_params(rng, encoder, init_batch)

  @parameterized.parameters(
      dict(model_arch=ModelArchitecture.BERT, mixing_layer_name="attention"),
      dict(
          model_arch=ModelArchitecture.LINEAR,
          mixing_layer_name="linear_transform"),
      dict(
          model_arch=ModelArchitecture.C_NET,
          mixing_layer_name="circulant_transform"),
      dict(
          model_arch=ModelArchitecture.T_NET,
          mixing_layer_name="toeplitz_transform"))
  def test_parameterized_mixing(self, model_arch,
                                mixing_layer_name):
    config = dummy_config(model_arch=model_arch)
    with config.unlocked():
      config.use_fft = True
    frozen_config = ml_collections.FrozenConfigDict(config)

    encoder = models.EncoderModel(config=frozen_config)

    rng = jax.random.PRNGKey(0)
    init_batch = init_encoder_batch(config=frozen_config)
    params = init_model_params(rng, encoder, init_batch)
    expected_keys = {
        "embedder", "encoder_0", "encoder_1", "feed_forward_0",
        "feed_forward_1", f"{mixing_layer_name}_0", f"{mixing_layer_name}_1",
        "pooler"
    }
    self.assertEqual(params.keys(), expected_keys)

    inputs = dummy_inputs(rng, config=frozen_config)
    encoder_output = encoder.apply({"params": params},
                                   rngs={"dropout": rng},
                                   **inputs)
    expected_sequence_output_shape = (config.train_batch_size,
                                      config.max_seq_length, config.d_model)
    self.assertEqual(encoder_output.sequence_output.shape,
                     expected_sequence_output_shape)
    expected_pooled_output_shape = (config.train_batch_size, config.d_model)
    self.assertEqual(encoder_output.pooled_output.shape,
                     expected_pooled_output_shape)

  @parameterized.parameters(
      dict(
          attention_layout=LayerLayout.BOTTOM,
          num_attention_layers=0,
          expected_attention_layers=[]),
      dict(
          attention_layout=LayerLayout.MIDDLE,
          num_attention_layers=2,
          expected_attention_layers=[1, 2]),
      dict(
          attention_layout=LayerLayout.MIXED,
          num_attention_layers=2,
          expected_attention_layers=[0, 2]),
      dict(
          attention_layout=LayerLayout.TOP,
          num_attention_layers=1,
          expected_attention_layers=[3]))
  def test_hybrid(self, attention_layout,
                  num_attention_layers,
                  expected_attention_layers):
    config = dummy_config(model_arch=ModelArchitecture.F_NET)
    with config.unlocked():
      config.num_layers = 4  # More layers so we can test different layouts
      config.attention_layout = attention_layout
      config.num_attention_layers = num_attention_layers
    frozen_config = ml_collections.FrozenConfigDict(config)

    encoder = models.EncoderModel(config=frozen_config)

    rng = jax.random.PRNGKey(0)
    init_batch = init_encoder_batch(config=frozen_config)
    params = init_model_params(rng, encoder, init_batch)

    expected_keys = {
        "embedder", "encoder_0", "encoder_1", "encoder_2", "encoder_3",
        "feed_forward_0", "feed_forward_1", "feed_forward_2", "feed_forward_3",
        "pooler"
    }
    for expected_attention_layer in expected_attention_layers:
      expected_keys.add(f"attention_{expected_attention_layer}")

    self.assertEqual(params.keys(), expected_keys)

    inputs = dummy_inputs(rng, config=frozen_config)
    encoder_output = encoder.apply({"params": params},
                                   rngs={"dropout": rng},
                                   **inputs)
    expected_sequence_output_shape = (config.train_batch_size,
                                      config.max_seq_length, config.d_model)
    self.assertEqual(encoder_output.sequence_output.shape,
                     expected_sequence_output_shape)
    expected_pooled_output_shape = (config.train_batch_size, config.d_model)
    self.assertEqual(encoder_output.pooled_output.shape,
                     expected_pooled_output_shape)

  @parameterized.parameters(
      dict(
          moe_layout=LayerLayout.BOTTOM,
          num_moe_layers=0,
          expected_ff_layer_keys=[
              "feed_forward_0", "feed_forward_1", "feed_forward_2",
              "feed_forward_3"
          ],
          expected_moe_layer_keys=[],
          expected_moe_keys=[]),
      dict(
          moe_layout=LayerLayout.MIDDLE,
          num_moe_layers=1,
          expected_ff_layer_keys=[
              "feed_forward_0", "feed_forward_1", "feed_forward_3"
          ],
          expected_moe_layer_keys=["moe_2"],
          expected_moe_keys=["expert_2", "router_weights_2"]),
      dict(
          moe_layout=LayerLayout.MIXED,
          num_moe_layers=2,
          expected_ff_layer_keys=["feed_forward_1", "feed_forward_3"],
          expected_moe_layer_keys=["moe_0", "moe_2"],
          expected_moe_keys=[
              "expert_0", "expert_2", "router_weights_0", "router_weights_2"
          ]),
      dict(
          moe_layout=LayerLayout.TOP,
          num_moe_layers=2,
          expected_ff_layer_keys=["feed_forward_0", "feed_forward_1"],
          expected_moe_layer_keys=["moe_2", "moe_3"],
          expected_moe_keys=[
              "expert_2", "expert_3", "router_weights_2", "router_weights_3"
          ]))
  def test_moe(self, moe_layout, num_moe_layers,
               expected_ff_layer_keys,
               expected_moe_layer_keys,
               expected_moe_keys):
    config = dummy_config(model_arch=ModelArchitecture.T_NET)
    with config.unlocked():
      config.num_layers = 4  # More layers so we can test different layouts
      config.moe_layout = moe_layout
      config.num_moe_layers = num_moe_layers
    frozen_config = ml_collections.FrozenConfigDict(config)

    encoder = models.EncoderModel(config=frozen_config)

    rng = jax.random.PRNGKey(0)
    init_batch = init_encoder_batch(config=frozen_config)
    params = init_model_params(rng, encoder, init_batch)

    expected_keys = {
        "embedder", "encoder_0", "encoder_1", "encoder_2", "encoder_3",
        "pooler", "toeplitz_transform_0", "toeplitz_transform_1",
        "toeplitz_transform_2", "toeplitz_transform_3"
    }
    expected_keys.update(expected_ff_layer_keys)
    expected_keys.update(expected_moe_keys)

    self.assertEqual(params.keys(), expected_keys)

    rng, dropout_key, jitter_key = jax.random.split(rng, num=3)
    inputs = dummy_inputs(rng, config=frozen_config)
    encoder_output, state = encoder.apply({"params": params},
                                          rngs={
                                              "dropout": dropout_key,
                                              "jitter": jitter_key
                                          },
                                          mutable=["intermediates"],
                                          **inputs)

    expected_sequence_output_shape = (config.train_batch_size,
                                      config.max_seq_length, config.d_model)
    self.assertEqual(encoder_output.sequence_output.shape,
                     expected_sequence_output_shape)
    expected_pooled_output_shape = (config.train_batch_size, config.d_model)
    self.assertEqual(encoder_output.pooled_output.shape,
                     expected_pooled_output_shape)

    if num_moe_layers > 0:
      self.assertIn("intermediates", state)
      for layer in expected_moe_layer_keys:
        self.assertIn(layer, state["intermediates"])
        self.assertIn("diversity_metrics", state["intermediates"][layer])
    else:
      self.assertNotIn("intermediates", state)

class PretrainingModelTest(absltest.TestCase):

  def test_pretraining_model(self):
    config = dummy_config(model_arch=ModelArchitecture.F_NET)
    with config.unlocked():
      config.max_predictions_per_seq = 2
      config.num_attention_layers = 1
      config.num_moe_layers = 1
      num_tokens = config.train_batch_size * config.max_seq_length
      config.max_group_size = num_tokens
    frozen_config = ml_collections.FrozenConfigDict(config)

    model = models.PreTrainingModel(config=frozen_config)

    rng = jax.random.PRNGKey(0)
    init_batch = init_encoder_batch(config=frozen_config)
    # Pre-training model needs MLM and NSP inputs to be initialized.
    init_batch.update({
        "masked_lm_positions":
            jnp.ones((1, config.max_predictions_per_seq), jnp.int32),
        "masked_lm_labels":
            jnp.ones((1, config.max_predictions_per_seq), jnp.int32),
        "masked_lm_weights":
            jnp.ones((1, config.max_predictions_per_seq), jnp.float32),
        "next_sentence_labels":
            jnp.ones((1, 1), jnp.int32)
    })

    params = init_model_params(rng, model, init_batch)
    expected_keys = {
        "encoder", "predictions_dense", "predictions_output", "classification",
        "predictions_layer_norm"
    }
    self.assertEqual(params.keys(), expected_keys)

    rng, dropout_key, jitter_key = jax.random.split(rng, num=3)
    inputs = dummy_inputs(rng, config=frozen_config)
    inputs.update({
        "masked_lm_positions":
            jnp.ones((config.train_batch_size, config.max_predictions_per_seq),
                     jnp.int32),
        "masked_lm_labels":
            jnp.ones((config.train_batch_size, config.max_predictions_per_seq),
                     jnp.int32),
        "masked_lm_weights":
            jnp.ones((config.train_batch_size, config.max_predictions_per_seq),
                     jnp.int32),
        "next_sentence_labels":
            jnp.ones((config.train_batch_size, 1), jnp.int32)
    })
    metrics, state = model.apply({"params": params},
                                 rngs={
                                     "dropout": dropout_key,
                                     "jitter": jitter_key
                                 },
                                 mutable=["intermediates"],
                                 **inputs)

    self.assertAlmostEqual(metrics.masked_lm_loss, 16.818085, places=5)
    self.assertAlmostEqual(metrics.next_sentence_loss, 2.0803921)
    self.assertEqual(metrics.masked_lm_correct, 0)
    self.assertEqual(metrics.masked_lm_normalization, 6)
    self.assertEqual(metrics.masked_lm_total, 6)
    self.assertEqual(metrics.next_sentence_correct, 0)
    self.assertEqual(metrics.num_next_sentence_labels, 3.)

    self.assertIn("intermediates", state)
    jax.tree_util.tree_map(
        functools.partial(np.testing.assert_allclose, rtol=1e-6),
        state["intermediates"],
        FrozenDict({
            "encoder": {
                "moe_1": {
                    "diversity_metrics":
                        models.DiversityMetrics(
                            auxiliary_loss=1.0073242,
                            router_z_loss=0.50146484,
                            fraction_tokens_left_behind=0.25,
                            expert_usage=0.75,
                            router_confidence=0.51171875)
                }
            }
        }))

class SequenceClassificationModelTest(absltest.TestCase):

  def test_classification_model(self):
    n_classes = 2

    config = dummy_config(model_arch=ModelArchitecture.BERT)
    with config.unlocked():
      config.dataset_name = "dummy/classification_dataset"
    frozen_config = ml_collections.FrozenConfigDict(config)

    model = models.SequenceClassificationModel(
        config=frozen_config, n_classes=n_classes)

    rng = jax.random.PRNGKey(0)
    init_batch = init_encoder_batch(config=frozen_config)
    params = init_model_params(rng, model, init_batch)
    self.assertEqual(params.keys(), {"encoder", "classification"})

    # Logits for eval/prediction (no labels supplied).
    eval_inputs = dummy_inputs(rng, config=frozen_config)
    eval_inputs["deterministic"] = True
    logits = model.apply({"params": params}, **eval_inputs)
    expected_logits_shape = (config.train_batch_size, n_classes)
    self.assertEqual(jnp.shape(logits), expected_logits_shape)

    # Metrics for training (labels supplied).
    train_inputs = dummy_inputs(rng, config=frozen_config)
    train_inputs["labels"] = jnp.ones(config.train_batch_size, jnp.int32)
    metrics = model.apply({"params": params},
                          rngs={"dropout": rng},
                          **train_inputs)

    expected_metrics = ClassificationStats(
        batch_loss=0.6932529,
        num_labels=3,
        correct_predictions=1,
        expert_metrics=None)
    self.assertEqual(metrics, expected_metrics)

  def test_regression_model(self):
    n_classes = 1  # Only one label for regression

    config = dummy_config(model_arch=ModelArchitecture.F_NET)
    with config.unlocked():
      config.dataset_name = "glue/stsb"  # regression task dataset
      config.num_moe_layers = 1  # Add moe layer to verify expert metrics
      num_tokens = config.train_batch_size * config.max_seq_length
      config.max_group_size = num_tokens
    frozen_config = ml_collections.FrozenConfigDict(config)

    model = models.SequenceClassificationModel(
        config=frozen_config, n_classes=n_classes)

    rng = jax.random.PRNGKey(0)
    init_batch = init_encoder_batch(config=frozen_config)
    params = init_model_params(rng, model, init_batch)
    self.assertEqual(params.keys(), {"encoder", "classification"})

    # Logits for eval/prediction (no labels supplied).
    eval_inputs = dummy_inputs(rng, config=frozen_config)
    eval_inputs["deterministic"] = True
    logits = model.apply({"params": params}, **eval_inputs)
    expected_logits_shape = (config.train_batch_size, n_classes)
    self.assertEqual(jnp.shape(logits), expected_logits_shape)

    # Metrics for training (labels supplied).
    train_inputs = dummy_inputs(rng, config=frozen_config)
    label_key, dropout_key, jitter_key = jax.random.split(rng, num=3)
    train_inputs["labels"] = jax.random.uniform(
        label_key, (config.train_batch_size,), minval=0., maxval=1.)

    metrics, state = model.apply({"params": params},
                                 rngs={
                                     "dropout": dropout_key,
                                     "jitter": jitter_key
                                 },
                                 mutable=["intermediates"],
                                 **train_inputs)

    self.assertAlmostEqual(metrics.batch_loss, 1.0100806, places=6)
    self.assertEqual(metrics.num_labels, 3)

    self.assertIn("intermediates", state)
    jax.tree_util.tree_map(
        functools.partial(np.testing.assert_allclose, rtol=1e-6),
        state["intermediates"],
        FrozenDict({
            "encoder": {
                "moe_1": {
                    "diversity_metrics":
                        models.DiversityMetrics(
                            auxiliary_loss=1.0073242,
                            router_z_loss=0.45751953,
                            fraction_tokens_left_behind=0.25,
                            expert_usage=0.75,
                            router_confidence=0.51171875)
                }
            }
        }))

if __name__ == "__main__":
  absltest.main()


text:
<!DOCTYPE html>
<html>
<head>
    <title>demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<div id="demo">
    loading...
</div>
<script src="//unpkg.com/react/dist/react.min.js"></script>
<script src="//unpkg.com/react-dom/dist/react-dom.min.js"></script>
<script src="demo.js"></script>
</body>
</html>


text:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="org.openott.ioclient.fragments.GPIOFragment">

<!--    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent" > -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:orientation="horizontal"
            android:layout_weight="7">
            <GridView
                android:id="@+id/gpio_connector_1"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:numColumns="2"
                android:columnWidth="50dp"
                android:verticalSpacing="2dp"
                android:horizontalSpacing="2dp"
                android:stretchMode="columnWidth"
                android:gravity="center" >
            </GridView>

            <GridView
                android:id="@+id/gpio_connector_2"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:numColumns="2"
                android:columnWidth="50dp"
                android:verticalSpacing="2dp"
                android:horizontalSpacing="2dp"
                android:stretchMode="columnWidth"
                android:gravity="center" >
            </GridView>
        </LinearLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="horizontal"
            android:padding="5dp">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="3dp"
                android:text="Legend"/>
            <GridView
                android:id="@+id/gpio_legend_grid"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:numColumns="8"
                android:verticalSpacing="4dp"
                android:horizontalSpacing="4dp">
            </GridView>
        </LinearLayout>
    </LinearLayout>
</FrameLayout>


text:
/*
	2_malloc_2d_arrays.c - Yevheniy Chuba - 01/30/2016
	Example of how to declare and use a two-dimensional array that can be
	passed to a function. For a trully dynamic implementation, replace ROW
	and COL with variables...
*/

#include <stdio.h>
#include <stdlib.h>

#define ROW 10
#define COL 12

// function prototypes
int sum(int *a[]);
void build_array_positions(int **a);

// main
main() {
	int **arrays; // declare an array of pointers - at this point - a pointer to a pointer of type int
	int i, j;

	// (int **) - cast to an array of pointers to type int
	arrays = (int **) malloc(ROW * sizeof(int *));

	// for each pointer dynamically allocate a row having correct number of columns
	for (i = 0; i < ROW; i++)
		arrays[i] = (int *) malloc(COL * sizeof(int)); // point to allocated storage for row

	/*
		So far we have allocated enough memory to build 2D structure:
			- array -> {pointer-1(first-int), pointer-2(first-int), ...pointer-10(first-int}
				- where first-int is the first element (int) in the array representing the columns
			- pointer-1 -> {int-1(4 bytes), int-2(4 bytes), ...int-12(4 bytes)}
				- int-1 == first-int pointed by pointer-1
			- pointer-2 -> {int-1(4 bytes), int-2(4 bytes), ...int-12(4 bytes)}
				- int-1 == first-int pointed by pointer-2
	*/

	// let's put some values inside the 2D array
	// the value in each position is: row * col
	for (i = 0; i < ROW; i++)
		for (j = 0; j < COL; j++)
			arrays[i][j] = i * j; // note that we can access elements normally

	printf("sum = %d\n\n\n", sum(arrays)); // here we pass the array

	/*
		Print more information about 2D array positions
	*/
	printf("========= check array positions below: ==========\n\n");
	build_array_positions(arrays);
}

/*
	sum: sums the contents of the array passed to it
*/
int sum(int *a[]) {
	int i, j;
	int sum = 0;

	// loop through each item in the 2D array, sum it and
	// show what we stored in each position (which is multiplication of i and j)
	for (i = 0; i < ROW; i++) {
		for (j = 0; j < COL; j++) {
			sum += a[i][j];
			printf("%4d", a[i][j]);
		}
		printf("\n");
	}

	return sum;
}

/*
	build_array_positions: array representation with the i and j positions
*/
void build_array_positions(int **a) {
	int i, j;

	for (i = 0; i < ROW; i++) {
		for (j = 0; j < COL; j++) {
			printf("%4d,%d", i, j);
		}
		printf("\n");
	}
}

/*
	NOTE: int sum(int *a[]) == int sum(int **a) -> after all a[] == *a

*/


text:
		<title>Reserva</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" type="text/css" href="Css/Estilo.css">

		<form form action="Graciasporelegirnos.html" method="post" class=usuario>

			<fieldset>
				<legend>Tu Reservacion</legend>

Correo Electronico:<input type ="text" name="Correo Electronico" Value="" required />

Tarjeta De Credito:<input type ="text" name="Tarjeta De Credito" Value="" required />

					Planes Disponibles
					<select id="" name="">

					<option>Paquete 1</option>
					<option>Paquete 2</option>
					<option>Paquete 3</option>
					<option>Paquete 4</option>
					<option>Paquete 5</option>
					<option>Paquete 6</option>
					<option>Paquete 7</option>
				</select>

			</fieldset>

			<fieldset>

					Tarjetas
					<select id="" name="">
					<option>Visa</option>
					<option>MasterCard</option>
					<option>American Espress</option>

			</fieldset>

<input type="submit" value="Reservar">

		</form>


text:
from msrest.serialization import Model

class ResourceCollection(Model):
    """ResourceCollection

    :param productresource:
    :type productresource: :class:`FlattenedProduct
     <fixtures.acceptancetestsmodelflattening.models.FlattenedProduct>`
    :param arrayofresources:
    :type arrayofresources: list of :class:`FlattenedProduct
     <fixtures.acceptancetestsmodelflattening.models.FlattenedProduct>`
    :param dictionaryofresources:
    :type dictionaryofresources: dict
    """

    _attribute_map = {
        'productresource': {'key': 'productresource', 'type': 'FlattenedProduct'},
        'arrayofresources': {'key': 'arrayofresources', 'type': '[FlattenedProduct]'},
        'dictionaryofresources': {'key': 'dictionaryofresources', 'type': '{FlattenedProduct}'},
    }

    def __init__(self, productresource=None, arrayofresources=None, dictionaryofresources=None, **kwargs):
        self.productresource = productresource
        self.arrayofresources = arrayofresources
        self.dictionaryofresources = dictionaryofresources


text:
classdef GanglionLayer < CellLayer
    %Ganglion Layer contains an array of ganglion cells

    properties (Constant)
        name = 'Ganglion Layer';
    end

    properties
        bipolar_layer
        amacrine_layer
    end

    methods
        function obj = GanglionLayer(number_of_cells, bipolar_layer, amacrine_layer)
            % cells
            obj@CellLayer(number_of_cells, @Ganglion);

            % bipolar layer
            obj.bipolar_layer = bipolar_layer;

            % amacrine layer
            obj.amacrine_layer = amacrine_layer;

            % receptive field
            obj.make_receptive_field_of_cells();
        end

        function make_receptive_field_of_cells(obj)
            for i = 1:length(obj.cells)
                % biplar
                obj.cells{i}.rf.bipolar_layer = [];

                for j = 1:length(obj.bipolar_layer.cells)
                    if abs(obj.cells{i}.center - obj.bipolar_layer.cells{j}.center) <= obj.cells{i}.radius
                        obj.cells{i}.rf.bipolar_layer(end + 1) = j;
                    end
                end

                % amacrine
                obj.cells{i}.rf.amacrine_layer = [];

                for j = 1:length(obj.amacrine_layer.cells)
                    if abs(obj.cells{i}.center - obj.amacrine_layer.cells{j}.center) <= obj.cells{i}.radius
                        obj.cells{i}.rf.amacrine_layer(end + 1) = j;
                    end
                end
            end
        end

        function run(obj)
            threshold = 0;
            for i = 1:length(obj.cells)
                ganglion = obj.cells{i};

                % bipolar_layer
                ganglion.output = [];
                for j = ganglion.rf.bipolar_layer
                    bipolar = obj.bipolar_layer.cells{j};
                    if isempty(ganglion.output)
                        ganglion.output = bipolar.output;
                    else
                        ganglion.output = ganglion.output + bipolar.output;
                    end

                end

                offset = 0.1;
                % amacrine_layer
                for j = ganglion.rf.amacrine_layer
                    amacrine = obj.amacrine_layer.cells{j};
                    ganglion.output = ganglion.output - ...
                        (1 / ganglion.radius) * (abs(ganglion.center - amacrine.center) + offset) * amacrine.output;
                end

                % threshold
                ganglion.output(ganglion.output < threshold) = 0;
            end
        end
    end
end


text:
<?php

namespace Zicht\Bundle\PageBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController as BaseAbstractController;
use Zicht\Bundle\PageBundle\Manager\PageManager;

abstract class AbstractController extends BaseAbstractController
{
    public static function getSubscribedServices(): array
    {
        return array_merge(parent::getSubscribedServices(), ['zicht_page.page_manager' => PageManager::class]);
    }

    public function getPageManager(): PageManager
    {
        return $this->get('zicht_page.page_manager');
    }
}


text:
<?php

/*
    Author: Danny Althoff
    Website: http://www.dynamicfiles.de
    Contact: info@dynamicfiles.de
*/
/**
 * Metadata version
 */
$sMetadataVersion = '1.1';

/**
 * Module information
 */
$aModule = array(
    'id'           => 'noPriceAlert',
    'title'        => 'Anti-Preisalarm',
    'description'  => 'Deaktiviert das Preisalarm-Feature im Frontend (OXID 4.8.x).',
    'version'      => '1.2',
    'author'       => 'Danny Althoff',
    'url'          => 'http://www.dynamicfiles.de',
    'email'        => 'info@dynamicfiles.de',
    'extend'       => array(
        'details'					=> 'dynamicfiles/noPriceAlert/controllers/nopricealert_details',
        'oxwarticledetails'			=> 'dynamicfiles/noPriceAlert/widgets/nopricealert_oxwarticledetails',
    ),
);


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Cact. Succ. J. Gr. Brit. 40:53. 1978

#### Original name
null

### Remarks
null


text:
// constructs for describing code blobs to Realm

#ifndef REALM_CODEDESC_H
#define REALM_CODEDESC_H

#include "realm/realm_config.h"

#include "realm/serialize.h"

#include <stddef.h>
#include <vector>
#include <iostream>

namespace Realm {

  // we need a way to describe types of functions and arguments - every JIT framework
  //  (e.g. llvm) has their own way of doing this, so this is intended to be a generic
  //  version that knows how to convert to/from implementation-specific versions

  // Types have value semantics and are implemented as a tagged union
  class Type {
  public:
    // default constructor creates an invalid type
    Type(void);

    // copy and assignment do what you want
    Type(const Type& rhs);
    Type& operator=(const Type& rhs);

    ~Type(void);

    // construction of useful types is usually done via template-fu
    template <typename T>
    static Type from_cpp_type(void);

    template <typename T>
    static Type from_cpp_value(const T& value);

    // exact equality
    bool operator==(const Type& rhs) const;
    bool operator!=(const Type& rhs) const;

    // testing for the kind
    bool is_valid(void) const;

    template <typename T>
    bool is(void) const;

    template <typename T>
    T& as(void);

    template <typename T>
    const T& as(void) const;

    // accessors/mutators for common fields
    size_t& size_bits(void);
    const size_t& size_bits(void) const;

    size_t& alignment_bits(void);
    const size_t& alignment_bits(void) const;

    // pretty-printing
    friend std::ostream& operator<<(std::ostream& os, const Type& t);

    // serializer/deserializer functions
    template <typename S>
    friend bool serialize(S& os, const Type& t);

    template <typename S>
    friend bool deserialize(S& os, Type& t);

#define REALM_TYPE_KINDS(__func__) \
    __func__(OpaqueKind, OpaqueFields, f_opaque) \
    __func__(IntegerKind, IntegerFields, f_integer) \
    __func__(FloatingPointKind, FloatingPointFields, f_float) \
    __func__(PointerKind, PointerFields, f_pointer) \
    __func__(FunctionPointerKind, FunctionPointerFields, f_funcptr)

    enum Kind {
      InvalidKind,
#define KINDS_ENUM(k, f, n) k,
      REALM_TYPE_KINDS(KINDS_ENUM)
#undef KINDS_ENUM
    };

  protected:
#define FIELDOBJ_METHODS(classname) \
      void destroy(void); \
      void copy_from(const classname &rhs); \
      bool is_equal(const classname& rhs) const; \
      template <typename S> bool serialize(S& s) const; \
      template <typename S> bool deserialize(S& s)
    struct CommonFields {
      Kind kind;
      size_t size_bits;
      size_t alignment_bits;

      FIELDOBJ_METHODS(CommonFields);
    };
    struct OpaqueFields : public CommonFields {
      // nothing

      FIELDOBJ_METHODS(OpaqueFields);
    };
    struct IntegerFields : public CommonFields {
      bool is_signed;

      FIELDOBJ_METHODS(IntegerFields);
    };
    struct FloatingPointFields : public CommonFields {
      // nothing

      FIELDOBJ_METHODS(FloatingPointFields);
    };
    struct PointerFields : public CommonFields {
      Type *base_type;
      bool is_const;

      FIELDOBJ_METHODS(PointerFields);
    };
    struct FunctionPointerFields : public CommonFields {
      Type *return_type;
      std::vector<Type> *param_types;

      FIELDOBJ_METHODS(FunctionPointerFields);
    };
#undef FIELDOBJ_METHODS

    union {
      CommonFields f_common;
#define FIELDS_ENTRY(k, f, n) f n;
      REALM_TYPE_KINDS(FIELDS_ENTRY)
#undef FIELDS_ENTRY
    };

    void destroy(void);
    void copy_from(const Type& rhs);

    // only used by subclass constructors
    Type(Kind _kind, size_t _size_bits, size_t _alignment_bits);

  };

  class OpaqueType : public Type {
  public:
    static const Type::Kind KIND = OpaqueKind;

    OpaqueType(size_t _size_bits, size_t _alignment_bits = 0);
  };

  class IntegerType : public Type {
  public:
    static const Type::Kind KIND = IntegerKind;

    IntegerType(size_t _size_bits, bool _signed, size_t _alignment_bits = 0);

    bool& is_signed(void);
    const bool& is_signed(void) const;
  };

  class PointerType : public Type {
  public:
    static const Type::Kind KIND = PointerKind;

    PointerType(const Type& _base_type, bool _const = false,
		size_t _size_bits = 0, size_t _alignment_bits = 0);

    Type& base_type(void);
    const Type& base_type(void) const;

    bool& is_const(void);
    const bool& is_const(void) const;
  };

  class FunctionPointerType : public Type {
  public:
    static const Type::Kind KIND = FunctionPointerKind;

    // different constructors for each number of parameters...
    FunctionPointerType(const Type &_return_type,
			size_t _size_bits = 0, size_t _alignment_bits = 0);
    FunctionPointerType(const Type &_return_type,
			const Type &_param1_type,
			size_t _size_bits = 0, size_t _alignment_bits = 0);
    FunctionPointerType(const Type &_return_type,
			const Type &_param1_type,
			const Type &_param2_type,
			size_t _size_bits = 0, size_t _alignment_bits = 0);
    FunctionPointerType(const Type &_return_type,
			const Type &_param1_type,
			const Type &_param2_type,
			const Type &_param3_type,
			size_t _size_bits = 0, size_t _alignment_bits = 0);
    FunctionPointerType(const Type &_return_type,
			const Type &_param1_type,
			const Type &_param2_type,
			const Type &_param3_type,
			const Type &_param4_type,
			size_t _size_bits = 0, size_t _alignment_bits = 0);
    FunctionPointerType(const Type &_return_type,
			const Type &_param1_type,
			const Type &_param2_type,
			const Type &_param3_type,
			const Type &_param4_type,
			const Type &_param5_type,
			size_t _size_bits = 0, size_t _alignment_bits = 0);

    Type& return_type(void);
    const Type& return_type(void) const;

    std::vector<Type>& param_types(void);
    const std::vector<Type>& param_types(void) const;
  };

  namespace TypeConv {
    // these generate a Type object from a C++ type or value
    template <typename T> Type from_cpp_type(void);
    template <typename T> Type from_cpp_value(const T& value);
  };

  // a CodeDescriptor is an object that describes a blob of code as a callable function
  // it includes:
  // a) its type, as a Type object
  // b) zero or more "implementations" (e.g. function pointer, or LLVM IR, or DSO reference)
  // c) zero or more "properties" (e.g. "this function is pure")

  class CodeImplementation;
  class CodeProperty;

  class REALM_PUBLIC_API CodeDescriptor {
  public:
    CodeDescriptor(void);
    explicit CodeDescriptor(const Type& _t);

    // a common pattern is to make a code descriptor from a function pointer - we
    //  can use template magic to do this all at once
    // TODO: use some SFINAE trick to make this only work if T is a function pointer?
    template <typename T>
    explicit CodeDescriptor(T fnptr);

    // copy and assignment
    CodeDescriptor(const CodeDescriptor& rhs);
    CodeDescriptor& operator=(const CodeDescriptor& rhs);

    ~CodeDescriptor(void);

    // erase contents
    void clear(void);

    CodeDescriptor& set_type(const Type& _t);

    // add an implementation - becomes owned by the descriptor
    CodeDescriptor& add_implementation(CodeImplementation *impl);

    // add a property - becomes owned by the descriptor
    CodeDescriptor& add_property(CodeProperty *prop);

    const Type& type(void) const;
    const std::vector<CodeImplementation *>& implementations(void) const;
    const std::vector<CodeProperty *>& properties(void) const;

    // are any of the code implementations marked as "portable" (i.e.
    //  usable in another process/address space)?
    bool has_portable_implementations(void) const;

    // attempt to make a portable implementation from what we have
    bool create_portable_implementation(void);

    template <typename T>
    const T *find_impl(void) const;

    // pretty-printing
    friend std::ostream& operator<<(std::ostream& os, const CodeDescriptor& cd);

    // serialization/deserialization - note that the standard << serializer will
    //  not serialize non-portable implementations
    template <typename S>
    bool serialize(S& serializer, bool portable) const;

    template <typename S>
    bool deserialize(S& deserializer);

  protected:
    void copy_from(const CodeDescriptor& rhs);

    Type m_type;
    std::vector<CodeImplementation *> m_impls;
    std::vector<CodeProperty *> m_props;
  };

  template <typename S>
  bool serialize(S& serializer, const CodeDescriptor& cd);

  template <typename S>
  bool deserialize(S& deserializer, CodeDescriptor& cd);

  // this is the interface that actual CodeImplementations must follow
  class REALM_PUBLIC_API CodeImplementation {
  protected:
    // not directly constructed
    CodeImplementation(void);

  public:
    virtual ~CodeImplementation(void);

    virtual CodeImplementation *clone(void) const = 0;

    // is this implementation meaningful in another address space?
    virtual bool is_portable(void) const = 0;

    //template <typename S>
    //bool serialize(S& serializer) const;

    template <typename S>
    static CodeImplementation *deserialize_new(S& deserializer);

    // pretty-printing
    friend std::ostream& operator<<(std::ostream& os, const CodeImplementation& ci);

  protected:
    virtual void print(std::ostream& os) const = 0;
  };

  template <typename S>
  bool serialize(S& serializer, const CodeImplementation& ci);

  // this is the interface that actual CodePropertys must follow
  class REALM_PUBLIC_API CodeProperty {
  protected:
    // not directly constructed
    CodeProperty(void);

  public:
    virtual ~CodeProperty(void);

    virtual CodeProperty *clone(void) const = 0;

    // is this implementation meaningful in another address space?
    virtual bool is_portable(void) const = 0;

    // TODO: serialization/deserialization stuff
  };

  // abstract class that describes a code translator that can convert a code implementation
  //  of one type into one of another type - in order to be extensible by add-on modules, it
  //  uses c++ dynamic type info support
  class CodeTranslator {
  protected:
    CodeTranslator(const std::string& _name);

  public:
    virtual ~CodeTranslator(void);

    virtual bool can_translate(const std::type_info& source_impl_type,
			       const std::type_info& target_impl_type) = 0;

    // default version just iterates over all the implementations in the source
    virtual bool can_translate(const CodeDescriptor& source_codedesc,
			       const std::type_info& target_impl_type);

    virtual CodeImplementation *translate(const CodeImplementation *source,
					  const std::type_info& target_impl_type) = 0;

    // default version just iterates over all the implementations in the source
    virtual CodeImplementation *translate(const CodeDescriptor& source_codedesc,
					  const std::type_info& target_impl_type);

    // template versions when target type is statically known
    template <typename TARGET_TYPE>
    bool can_translate(const std::type_info& source_impl_type);

    template <typename TARGET_TYPE>
    bool can_translate(const CodeDescriptor& source_codedesc);

    template <typename TARGET_TYPE>
    TARGET_TYPE *translate(const CodeImplementation *source);

    template <typename TARGET_TYPE>
    TARGET_TYPE *translate(const CodeDescriptor& source_codedesc);

    std::string name;
  };

  // two simple implementations:
  // 1) raw function pointers - non-portable
  // 2) DSO references (i.e. name of shared object, name of symbol) - portable

  class REALM_PUBLIC_API FunctionPointerImplementation : public CodeImplementation {
  public:
    // note that this implementation forgets the actual function prototype - it's
    //  up to the surrounding CodeDescriptor object to remember that
    FunctionPointerImplementation(void (*_fnptr)());

    virtual ~FunctionPointerImplementation(void);

    virtual CodeImplementation *clone(void) const;

    virtual bool is_portable(void) const;

    template<typename T>
    inline T get_impl(void) const { return reinterpret_cast<T>(fnptr); }

    template <typename S>
    bool serialize(S& serializer) const;

    template <typename S>
    static CodeImplementation *deserialize_new(S& deserializer);

  protected:
    REALM_INTERNAL_API_EXTERNAL_LINKAGE
    FunctionPointerImplementation(void);

    static Serialization::PolymorphicSerdezSubclass<CodeImplementation, FunctionPointerImplementation> serdez_subclass;

    virtual void print(std::ostream& os) const;

  public:
    void (*fnptr)();
  };

#ifdef REALM_USE_DLFCN
  class REALM_PUBLIC_API DSOReferenceImplementation : public CodeImplementation {
  public:
    DSOReferenceImplementation(const std::string& _dso_name,
			       const std::string& _symbol_name);

    virtual ~DSOReferenceImplementation(void);

    virtual CodeImplementation *clone(void) const;

    virtual bool is_portable(void) const;

    template <typename S>
    bool serialize(S& serializer) const;

    template <typename S>
    static CodeImplementation *deserialize_new(S& deserializer);

  protected:
    DSOReferenceImplementation(void);

    static Serialization::PolymorphicSerdezSubclass<CodeImplementation, DSOReferenceImplementation> serdez_subclass;

    virtual void print(std::ostream& os) const;

#ifdef REALM_USE_DLADDR
    friend class CodeDescriptor;
    static DSOReferenceImplementation *cvt_fnptr_to_dsoref(const FunctionPointerImplementation *fpi,
                                                           bool quiet = false);
#endif
  public:
    std::string dso_name, symbol_name;
  };

  // converts DSOReferenceImplementation -> FunctionPointerImplementation and
  //  (if dladdr is available) the reverse
  // NOTE: this is exported for now due to issue #818
  class REALM_INTERNAL_API_EXTERNAL_LINKAGE DSOCodeTranslator : public CodeTranslator {
  public:
    DSOCodeTranslator(void);

    virtual ~DSOCodeTranslator(void);

    virtual bool can_translate(const std::type_info& source_impl_type,
                               const std::type_info& target_impl_type);

    virtual CodeImplementation *translate(const CodeImplementation *source,
					  const std::type_info& target_impl_type);

    // C++ considers the above a "partial override" and wants these defined too
    virtual bool can_translate(const CodeDescriptor& source_codedesc,
			       const std::type_info& target_impl_type);

    virtual CodeImplementation *translate(const CodeDescriptor& source_codedesc,
					  const std::type_info& target_impl_type);

  protected:
    std::map<std::string, void *> modules_loaded;
  };
#endif

}; // namespace Realm

#include "realm/codedesc.inl"

#undef REALM_TYPE_KINDS

#endif


text:
package rms.common.interceptor;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * ControllerInterceptorクラス
 * @author
 */
@Aspect
@Component
public class ControllerInterceptor {

    /** logger */
    private static final Logger logger = LoggerFactory.getLogger(ControllerInterceptor.class);

    /** Controller Method */
    // XXX システム独自仕様
    private static final String controllerClassPath = "rms.web..*Controller*";

    /**
     * Controllerクラス内のメソッド開始時にログを出力
     * @param joinPoint
     * @return
     * @throws Throwable
     */
    @Around("within(" + controllerClassPath + ")")
    public Object invokeControllerAround(ProceedingJoinPoint joinPoint) throws Throwable {

        // クラス名・メソッド名の取得
        String classNm = joinPoint.getTarget().getClass().getName();
        String methodNm = joinPoint.getSignature().getName();

        /*
         * 処理実行前のログ出力
         */
        logger.info("called start -> {}#{}", classNm, methodNm);

        /*
         * 処理の実行
         */
        Object retVal = null;
        try {
            retVal = joinPoint.proceed();
        } catch (Exception e) {
            logger.error("called fail -> {}#{}", classNm, methodNm);
            throw e;
        }

        return retVal;
    }

}


text:
namespace v8 {
namespace internal {
namespace compiler {

#define TRACE(...)                                      \
  do {                                                  \
    if (FLAG_trace_turbo_inlining) PrintF(__VA_ARGS__); \
  } while (false)

// Provides convenience accessors for the common layout of nodes having either
// the {JSCallFunction} or the {JSCallConstruct} operator.
class JSCallAccessor {
 public:
  explicit JSCallAccessor(Node* call) : call_(call) {
    DCHECK(call->opcode() == IrOpcode::kJSCallFunction ||
           call->opcode() == IrOpcode::kJSCallConstruct);
  }

  Node* target() {
    // Both, {JSCallFunction} and {JSCallConstruct}, have same layout here.
    return call_->InputAt(0);
  }

  Node* receiver() {
    DCHECK_EQ(IrOpcode::kJSCallFunction, call_->opcode());
    return call_->InputAt(1);
  }

  Node* new_target() {
    DCHECK_EQ(IrOpcode::kJSCallConstruct, call_->opcode());
    return call_->InputAt(formal_arguments() + 1);
  }

  Node* frame_state() {
    // Both, {JSCallFunction} and {JSCallConstruct}, have frame state.
    return NodeProperties::GetFrameStateInput(call_, 0);
  }

  int formal_arguments() {
    // Both, {JSCallFunction} and {JSCallConstruct}, have two extra inputs:
    //  - JSCallConstruct: Includes target function and new target.
    //  - JSCallFunction: Includes target function and receiver.
    return call_->op()->ValueInputCount() - 2;
  }

 private:
  Node* call_;
};

Reduction JSInliner::InlineCall(Node* call, Node* new_target, Node* context,
                                Node* frame_state, Node* start, Node* end) {
  // The scheduler is smart enough to place our code; we just ensure {control}
  // becomes the control input of the start of the inlinee, and {effect} becomes
  // the effect input of the start of the inlinee.
  Node* control = NodeProperties::GetControlInput(call);
  Node* effect = NodeProperties::GetEffectInput(call);

  int const inlinee_new_target_index =
      static_cast<int>(start->op()->ValueOutputCount()) - 3;
  int const inlinee_arity_index =
      static_cast<int>(start->op()->ValueOutputCount()) - 2;
  int const inlinee_context_index =
      static_cast<int>(start->op()->ValueOutputCount()) - 1;

  // {inliner_inputs} counts JSFunction, receiver, arguments, but not
  // new target value, argument count, context, effect or control.
  int inliner_inputs = call->op()->ValueInputCount();
  // Iterate over all uses of the start node.
  for (Edge edge : start->use_edges()) {
    Node* use = edge.from();
    switch (use->opcode()) {
      case IrOpcode::kParameter: {
        int index = 1 + ParameterIndexOf(use->op());
        DCHECK_LE(index, inlinee_context_index);
        if (index < inliner_inputs && index < inlinee_new_target_index) {
          // There is an input from the call, and the index is a value
          // projection but not the context, so rewire the input.
          Replace(use, call->InputAt(index));
        } else if (index == inlinee_new_target_index) {
          // The projection is requesting the new target value.
          Replace(use, new_target);
        } else if (index == inlinee_arity_index) {
          // The projection is requesting the number of arguments.
          Replace(use, jsgraph_->Int32Constant(inliner_inputs - 2));
        } else if (index == inlinee_context_index) {
          // The projection is requesting the inlinee function context.
          Replace(use, context);
        } else {
          // Call has fewer arguments than required, fill with undefined.
          Replace(use, jsgraph_->UndefinedConstant());
        }
        break;
      }
      default:
        if (NodeProperties::IsEffectEdge(edge)) {
          edge.UpdateTo(effect);
        } else if (NodeProperties::IsControlEdge(edge)) {
          edge.UpdateTo(control);
        } else if (NodeProperties::IsFrameStateEdge(edge)) {
          edge.UpdateTo(frame_state);
        } else {
          UNREACHABLE();
        }
        break;
    }
  }

  NodeVector values(local_zone_);
  NodeVector effects(local_zone_);
  NodeVector controls(local_zone_);
  for (Node* const input : end->inputs()) {
    switch (input->opcode()) {
      case IrOpcode::kReturn:
        values.push_back(NodeProperties::GetValueInput(input, 0));
        effects.push_back(NodeProperties::GetEffectInput(input));
        controls.push_back(NodeProperties::GetControlInput(input));
        break;
      case IrOpcode::kDeoptimize:
      case IrOpcode::kTerminate:
      case IrOpcode::kThrow:
        NodeProperties::MergeControlToEnd(jsgraph_->graph(), jsgraph_->common(),
                                          input);
        Revisit(jsgraph_->graph()->end());
        break;
      default:
        UNREACHABLE();
        break;
    }
  }
  DCHECK_EQ(values.size(), effects.size());
  DCHECK_EQ(values.size(), controls.size());

  // Depending on whether the inlinee produces a value, we either replace value
  // uses with said value or kill value uses if no value can be returned.
  if (values.size() > 0) {
    int const input_count = static_cast<int>(controls.size());
    Node* control_output = jsgraph_->graph()->NewNode(
        jsgraph_->common()->Merge(input_count), input_count, &controls.front());
    values.push_back(control_output);
    effects.push_back(control_output);
    Node* value_output = jsgraph_->graph()->NewNode(
        jsgraph_->common()->Phi(MachineRepresentation::kTagged, input_count),
        static_cast<int>(values.size()), &values.front());
    Node* effect_output = jsgraph_->graph()->NewNode(
        jsgraph_->common()->EffectPhi(input_count),
        static_cast<int>(effects.size()), &effects.front());
    ReplaceWithValue(call, value_output, effect_output, control_output);
    return Changed(value_output);
  } else {
    ReplaceWithValue(call, call, call, jsgraph_->Dead());
    return Changed(call);
  }
}

Node* JSInliner::CreateArtificialFrameState(Node* node, Node* outer_frame_state,
                                            int parameter_count,
                                            FrameStateType frame_state_type,
                                            Handle<SharedFunctionInfo> shared) {
  const FrameStateFunctionInfo* state_info =
      jsgraph_->common()->CreateFrameStateFunctionInfo(
          frame_state_type, parameter_count + 1, 0, shared);

  const Operator* op = jsgraph_->common()->FrameState(
      BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info);
  const Operator* op0 = jsgraph_->common()->StateValues(0);
  Node* node0 = jsgraph_->graph()->NewNode(op0);
  NodeVector params(local_zone_);
  for (int parameter = 0; parameter < parameter_count + 1; ++parameter) {
    params.push_back(node->InputAt(1 + parameter));
  }
  const Operator* op_param =
      jsgraph_->common()->StateValues(static_cast<int>(params.size()));
  Node* params_node = jsgraph_->graph()->NewNode(
      op_param, static_cast<int>(params.size()), &params.front());
  return jsgraph_->graph()->NewNode(op, params_node, node0, node0,
                                    jsgraph_->UndefinedConstant(),
                                    node->InputAt(0), outer_frame_state);
}

Node* JSInliner::CreateTailCallerFrameState(Node* node, Node* frame_state) {
  FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state);
  Handle<SharedFunctionInfo> shared;
  frame_info.shared_info().ToHandle(&shared);

  Node* function = frame_state->InputAt(kFrameStateFunctionInput);

  // If we are inlining a tail call drop caller's frame state and an
  // arguments adaptor if it exists.
  frame_state = NodeProperties::GetFrameStateInput(frame_state, 0);
  if (frame_state->opcode() == IrOpcode::kFrameState) {
    FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state);
    if (frame_info.type() == FrameStateType::kArgumentsAdaptor) {
      frame_state = NodeProperties::GetFrameStateInput(frame_state, 0);
    }
  }

  const FrameStateFunctionInfo* state_info =
      jsgraph_->common()->CreateFrameStateFunctionInfo(
          FrameStateType::kTailCallerFunction, 0, 0, shared);

  const Operator* op = jsgraph_->common()->FrameState(
      BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info);
  const Operator* op0 = jsgraph_->common()->StateValues(0);
  Node* node0 = jsgraph_->graph()->NewNode(op0);
  return jsgraph_->graph()->NewNode(op, node0, node0, node0,
                                    jsgraph_->UndefinedConstant(), function,
                                    frame_state);
}

namespace {

// TODO(mstarzinger,verwaest): Move this predicate onto SharedFunctionInfo?
bool NeedsImplicitReceiver(Handle<SharedFunctionInfo> shared_info) {
  DisallowHeapAllocation no_gc;
  Isolate* const isolate = shared_info->GetIsolate();
  Code* const construct_stub = shared_info->construct_stub();
  return construct_stub != *isolate->builtins()->JSBuiltinsConstructStub() &&
         construct_stub !=
             *isolate->builtins()->JSBuiltinsConstructStubForDerived() &&
         construct_stub != *isolate->builtins()->JSConstructStubApi();
}

bool IsNonConstructible(Handle<SharedFunctionInfo> shared_info) {
  DisallowHeapAllocation no_gc;
  Isolate* const isolate = shared_info->GetIsolate();
  Code* const construct_stub = shared_info->construct_stub();
  return construct_stub == *isolate->builtins()->ConstructedNonConstructable();
}

}  // namespace

Reduction JSInliner::Reduce(Node* node) {
  if (!IrOpcode::IsInlineeOpcode(node->opcode())) return NoChange();

  // This reducer can handle both normal function calls as well a constructor
  // calls whenever the target is a constant function object, as follows:
  //  - JSCallFunction(target:constant, receiver, args...)
  //  - JSCallConstruct(target:constant, args..., new.target)
  HeapObjectMatcher match(node->InputAt(0));
  if (!match.HasValue() || !match.Value()->IsJSFunction()) return NoChange();
  Handle<JSFunction> function = Handle<JSFunction>::cast(match.Value());

  return ReduceJSCall(node, function);
}

Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) {
  DCHECK(IrOpcode::IsInlineeOpcode(node->opcode()));
  JSCallAccessor call(node);
  Handle<SharedFunctionInfo> shared_info(function->shared());

  // Function must be inlineable.
  if (!shared_info->IsInlineable()) {
    TRACE("Not inlining %s into %s because callee is not inlineable\n",
          shared_info->DebugName()->ToCString().get(),
          info_->shared_info()->DebugName()->ToCString().get());
    return NoChange();
  }

  // Constructor must be constructable.
  if (node->opcode() == IrOpcode::kJSCallConstruct &&
      IsNonConstructible(shared_info)) {
    TRACE("Not inlining %s into %s because constructor is not constructable.\n",
          shared_info->DebugName()->ToCString().get(),
          info_->shared_info()->DebugName()->ToCString().get());
    return NoChange();
  }

  // Class constructors are callable, but [[Call]] will raise an exception.
  // See ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList ).
  if (node->opcode() == IrOpcode::kJSCallFunction &&
      IsClassConstructor(shared_info->kind())) {
    TRACE("Not inlining %s into %s because callee is a class constructor.\n",
          shared_info->DebugName()->ToCString().get(),
          info_->shared_info()->DebugName()->ToCString().get());
    return NoChange();
  }

  // Function contains break points.
  if (shared_info->HasDebugInfo()) {
    TRACE("Not inlining %s into %s because callee may contain break points\n",
          shared_info->DebugName()->ToCString().get(),
          info_->shared_info()->DebugName()->ToCString().get());
    return NoChange();
  }

  // Disallow cross native-context inlining for now. This means that all parts
  // of the resulting code will operate on the same global object.
  // This also prevents cross context leaks for asm.js code, where we could
  // inline functions from a different context and hold on to that context (and
  // closure) from the code object.
  // TODO(turbofan): We might want to revisit this restriction later when we
  // have a need for this, and we know how to model different native contexts
  // in the same graph in a compositional way.
  if (function->context()->native_context() !=
      info_->context()->native_context()) {
    TRACE("Not inlining %s into %s because of different native contexts\n",
          shared_info->DebugName()->ToCString().get(),
          info_->shared_info()->DebugName()->ToCString().get());
    return NoChange();
  }

  // TODO(turbofan): TranslatedState::GetAdaptedArguments() currently relies on
  // not inlining recursive functions. We might want to relax that at some
  // point.
  for (Node* frame_state = call.frame_state();
       frame_state->opcode() == IrOpcode::kFrameState;
       frame_state = frame_state->InputAt(kFrameStateOuterStateInput)) {
    FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state);
    Handle<SharedFunctionInfo> frame_shared_info;
    if (frame_info.shared_info().ToHandle(&frame_shared_info) &&
        *frame_shared_info == *shared_info) {
      TRACE("Not inlining %s into %s because call is recursive\n",
            shared_info->DebugName()->ToCString().get(),
            info_->shared_info()->DebugName()->ToCString().get());
      return NoChange();
    }
  }

  // TODO(turbofan): Inlining into a try-block is not yet supported.
  if (NodeProperties::IsExceptionalCall(node)) {
    TRACE("Not inlining %s into %s because of surrounding try-block\n",
          shared_info->DebugName()->ToCString().get(),
          info_->shared_info()->DebugName()->ToCString().get());
    return NoChange();
  }

  Zone zone(info_->isolate()->allocator());
  ParseInfo parse_info(&zone, function);
  CompilationInfo info(&parse_info, function);
  if (info_->is_deoptimization_enabled()) info.MarkAsDeoptimizationEnabled();
  if (info_->is_type_feedback_enabled()) info.MarkAsTypeFeedbackEnabled();

  if (!Compiler::ParseAndAnalyze(info.parse_info())) {
    TRACE("Not inlining %s into %s because parsing failed\n",
          shared_info->DebugName()->ToCString().get(),
          info_->shared_info()->DebugName()->ToCString().get());
    if (info_->isolate()->has_pending_exception()) {
      info_->isolate()->clear_pending_exception();
    }
    return NoChange();
  }

  if (!Compiler::EnsureDeoptimizationSupport(&info)) {
    TRACE("Not inlining %s into %s because deoptimization support failed\n",
          shared_info->DebugName()->ToCString().get(),
          info_->shared_info()->DebugName()->ToCString().get());
    return NoChange();
  }

  // Remember that we inlined this function. This needs to be called right
  // after we ensure deoptimization support so that the code flusher
  // does not remove the code with the deoptimization support.
  info_->AddInlinedFunction(shared_info);

  // ----------------------------------------------------------------
  // After this point, we've made a decision to inline this function.
  // We shall not bailout from inlining if we got here.

  TRACE("Inlining %s into %s\n",
        shared_info->DebugName()->ToCString().get(),
        info_->shared_info()->DebugName()->ToCString().get());

  // If function was lazily compiled, it's literals array may not yet be set up.
  JSFunction::EnsureLiterals(function);

  // Create the subgraph for the inlinee.
  Node* start;
  Node* end;
  {
    // Run the loop assignment analyzer on the inlinee.
    AstLoopAssignmentAnalyzer loop_assignment_analyzer(&zone, &info);
    LoopAssignmentAnalysis* loop_assignment =
        loop_assignment_analyzer.Analyze();

    // Run the type hint analyzer on the inlinee.
    TypeHintAnalyzer type_hint_analyzer(&zone);
    TypeHintAnalysis* type_hint_analysis =
        type_hint_analyzer.Analyze(handle(shared_info->code(), info.isolate()));

    // Run the AstGraphBuilder to create the subgraph.
    Graph::SubgraphScope scope(graph());
    AstGraphBuilder graph_builder(&zone, &info, jsgraph(), loop_assignment,
                                  type_hint_analysis);
    graph_builder.CreateGraph(false);

    // Extract the inlinee start/end nodes.
    start = graph()->start();
    end = graph()->end();
  }

  Node* frame_state = call.frame_state();
  Node* new_target = jsgraph_->UndefinedConstant();

  // Inline {JSCallConstruct} requires some additional magic.
  if (node->opcode() == IrOpcode::kJSCallConstruct) {
    // Insert nodes around the call that model the behavior required for a
    // constructor dispatch (allocate implicit receiver and check return value).
    // This models the behavior usually accomplished by our {JSConstructStub}.
    // Note that the context has to be the callers context (input to call node).
    Node* receiver = jsgraph_->UndefinedConstant();  // Implicit receiver.
    if (NeedsImplicitReceiver(shared_info)) {
      Node* frame_state_before = NodeProperties::FindFrameStateBefore(node);
      Node* effect = NodeProperties::GetEffectInput(node);
      Node* context = NodeProperties::GetContextInput(node);
      Node* create = jsgraph_->graph()->NewNode(
          jsgraph_->javascript()->Create(), call.target(), call.new_target(),
          context, frame_state_before, effect);
      NodeProperties::ReplaceEffectInput(node, create);
      // Insert a check of the return value to determine whether the return
      // value
      // or the implicit receiver should be selected as a result of the call.
      Node* check = jsgraph_->graph()->NewNode(
          jsgraph_->javascript()->CallRuntime(Runtime::kInlineIsJSReceiver, 1),
          node, context, node, start);
      Node* select = jsgraph_->graph()->NewNode(
          jsgraph_->common()->Select(MachineRepresentation::kTagged), check,
          node, create);
      NodeProperties::ReplaceUses(node, select, check, node, node);
      NodeProperties::ReplaceValueInput(select, node, 1);
      NodeProperties::ReplaceValueInput(check, node, 0);
      NodeProperties::ReplaceEffectInput(check, node);
      receiver = create;  // The implicit receiver.
    }

    // Swizzle the inputs of the {JSCallConstruct} node to look like inputs to a
    // normal {JSCallFunction} node so that the rest of the inlining machinery
    // behaves as if we were dealing with a regular function invocation.
    new_target = call.new_target();  // Retrieve new target value input.
    node->RemoveInput(call.formal_arguments() + 1);  // Drop new target.
    node->InsertInput(jsgraph_->graph()->zone(), 1, receiver);

    // Insert a construct stub frame into the chain of frame states. This will
    // reconstruct the proper frame when deoptimizing within the constructor.
    frame_state = CreateArtificialFrameState(
        node, frame_state, call.formal_arguments(),
        FrameStateType::kConstructStub, info.shared_info());
  }

  // The inlinee specializes to the context from the JSFunction object.
  // TODO(turbofan): We might want to load the context from the JSFunction at
  // runtime in case we only know the SharedFunctionInfo once we have dynamic
  // type feedback in the compiler.
  Node* context = jsgraph_->Constant(handle(function->context()));

  // Insert a JSConvertReceiver node for sloppy callees. Note that the context
  // passed into this node has to be the callees context (loaded above). Note
  // that the frame state passed to the JSConvertReceiver must be the frame
  // state _before_ the call; it is not necessary to fiddle with the receiver
  // in that frame state tho, as the conversion of the receiver can be repeated
  // any number of times, it's not observable.
  if (node->opcode() == IrOpcode::kJSCallFunction &&
      is_sloppy(parse_info.language_mode()) && !shared_info->native()) {
    const CallFunctionParameters& p = CallFunctionParametersOf(node->op());
    Node* frame_state_before = NodeProperties::FindFrameStateBefore(node);
    Node* effect = NodeProperties::GetEffectInput(node);
    Node* convert = jsgraph_->graph()->NewNode(
        jsgraph_->javascript()->ConvertReceiver(p.convert_mode()),
        call.receiver(), context, frame_state_before, effect, start);
    NodeProperties::ReplaceValueInput(node, convert, 1);
    NodeProperties::ReplaceEffectInput(node, convert);
  }

  // If we are inlining a JS call at tail position then we have to pop current
  // frame state and its potential arguments adaptor frame state in order to
  // make the call stack be consistent with non-inlining case.
  // After that we add a tail caller frame state which lets deoptimizer handle
  // the case when the outermost function inlines a tail call (it should remove
  // potential arguments adaptor frame that belongs to outermost function when
  // deopt happens).
  if (node->opcode() == IrOpcode::kJSCallFunction) {
    const CallFunctionParameters& p = CallFunctionParametersOf(node->op());
    if (p.tail_call_mode() == TailCallMode::kAllow) {
      frame_state = CreateTailCallerFrameState(node, frame_state);
    }
  }

  // Insert argument adaptor frame if required. The callees formal parameter
  // count (i.e. value outputs of start node minus target, receiver, new target,
  // arguments count and context) have to match the number of arguments passed
  // to the call.
  int parameter_count = info.literal()->parameter_count();
  DCHECK_EQ(parameter_count, start->op()->ValueOutputCount() - 5);
  if (call.formal_arguments() != parameter_count) {
    frame_state = CreateArtificialFrameState(
        node, frame_state, call.formal_arguments(),
        FrameStateType::kArgumentsAdaptor, shared_info);
  }

  return InlineCall(node, new_target, context, frame_state, start, end);
}

Graph* JSInliner::graph() const { return jsgraph()->graph(); }

}  // namespace compiler
}  // namespace internal
}  // namespace v8


text:
class DistanceAttempt < ApplicationRecord
  include Competeable
  include Placeable
  include CachedSetModel
  delegate :competition, to: :judge # override to use judge path instead of competitor path
  # because on object creation, competitor doesn't exist.
  include CompetitorAutoCreation

  belongs_to :judge

  validates :judge, presence: true
  validates :distance, presence: true, numericality: { greater_than_or_equal_to: 0, less_than: 1000 }

  validate :must_not_have_new_attempt_less_than_existing_attempt
  validate :cannot_have_new_attempts_after_certain_jumps

  def self.cache_set_field
    :competitor_id
  end

  def result
    distance
  end

  def disqualified?
    fault
  end

  private

  def must_not_have_new_attempt_less_than_existing_attempt
    if new_record?
      unless competitor.nil? || distance.nil?
        unless competitor.acceptable_distance?(distance)
          errors.add(:distance, competitor.acceptable_distance_error(distance))
        end
      end
    end
  end

  def cannot_have_new_attempts_after_certain_jumps
    if new_record?
      unless competitor.nil? || distance.nil?
        if competitor.reload.no_more_jumps?
          errors.add(:base, "Unable to make new attempts - #{competitor.distance_attempt_status}")
        end
      end
    end
  end
end


text:
// +build !ignore_autogenerated

// This file was autogenerated by deepcopy-gen. Do not edit it manually!

package v1alpha1

import (
	api "k8s.io/kubernetes/pkg/api"
	unversioned "k8s.io/kubernetes/pkg/api/unversioned"
	conversion "k8s.io/kubernetes/pkg/conversion"
)

func init() {
	if err := api.Scheme.AddGeneratedDeepCopyFuncs(
		DeepCopy_v1alpha1_KubeProxyConfiguration,
		DeepCopy_v1alpha1_KubeSchedulerConfiguration,
		DeepCopy_v1alpha1_LeaderElectionConfiguration,
	); err != nil {
		// if one of the deep copy functions is malformed, detect it immediately.
		panic(err)
	}
}

func DeepCopy_v1alpha1_KubeProxyConfiguration(in KubeProxyConfiguration, out *KubeProxyConfiguration, c *conversion.Cloner) error {
	if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
		return err
	}
	out.BindAddress = in.BindAddress
	out.ClusterCIDR = in.ClusterCIDR
	out.HealthzBindAddress = in.HealthzBindAddress
	out.HealthzPort = in.HealthzPort
	out.HostnameOverride = in.HostnameOverride
	if in.IPTablesMasqueradeBit != nil {
		in, out := in.IPTablesMasqueradeBit, &out.IPTablesMasqueradeBit
		*out = new(int32)
		**out = *in
	} else {
		out.IPTablesMasqueradeBit = nil
	}
	if err := unversioned.DeepCopy_unversioned_Duration(in.IPTablesSyncPeriod, &out.IPTablesSyncPeriod, c); err != nil {
		return err
	}
	out.KubeconfigPath = in.KubeconfigPath
	out.MasqueradeAll = in.MasqueradeAll
	out.Master = in.Master
	if in.OOMScoreAdj != nil {
		in, out := in.OOMScoreAdj, &out.OOMScoreAdj
		*out = new(int32)
		**out = *in
	} else {
		out.OOMScoreAdj = nil
	}
	out.Mode = in.Mode
	out.PortRange = in.PortRange
	out.ResourceContainer = in.ResourceContainer
	if err := unversioned.DeepCopy_unversioned_Duration(in.UDPIdleTimeout, &out.UDPIdleTimeout, c); err != nil {
		return err
	}
	out.ConntrackMax = in.ConntrackMax
	if err := unversioned.DeepCopy_unversioned_Duration(in.ConntrackTCPEstablishedTimeout, &out.ConntrackTCPEstablishedTimeout, c); err != nil {
		return err
	}
	return nil
}

func DeepCopy_v1alpha1_KubeSchedulerConfiguration(in KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, c *conversion.Cloner) error {
	if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
		return err
	}
	out.Port = in.Port
	out.Address = in.Address
	out.AlgorithmProvider = in.AlgorithmProvider
	out.PolicyConfigFile = in.PolicyConfigFile
	if in.EnableProfiling != nil {
		in, out := in.EnableProfiling, &out.EnableProfiling
		*out = new(bool)
		**out = *in
	} else {
		out.EnableProfiling = nil
	}
	out.KubeAPIQPS = in.KubeAPIQPS
	out.KubeAPIBurst = in.KubeAPIBurst
	out.SchedulerName = in.SchedulerName
	if err := DeepCopy_v1alpha1_LeaderElectionConfiguration(in.LeaderElection, &out.LeaderElection, c); err != nil {
		return err
	}
	return nil
}

func DeepCopy_v1alpha1_LeaderElectionConfiguration(in LeaderElectionConfiguration, out *LeaderElectionConfiguration, c *conversion.Cloner) error {
	if in.LeaderElect != nil {
		in, out := in.LeaderElect, &out.LeaderElect
		*out = new(bool)
		**out = *in
	} else {
		out.LeaderElect = nil
	}
	if err := unversioned.DeepCopy_unversioned_Duration(in.LeaseDuration, &out.LeaseDuration, c); err != nil {
		return err
	}
	if err := unversioned.DeepCopy_unversioned_Duration(in.RenewDeadline, &out.RenewDeadline, c); err != nil {
		return err
	}
	if err := unversioned.DeepCopy_unversioned_Duration(in.RetryPeriod, &out.RetryPeriod, c); err != nil {
		return err
	}
	return nil
}


text:
<?php

namespace patterns;

class multiFavorite extends \core\AbstractAction {

    public $description = 'Favorite an array of patterns.';

    public function execute() {
        $urlIds = $this->getValue("patternIds");

        // Each id needs to be a number.
        $idList = quoteStringArray(array_map(function($id) {
            return intval($id);
        }, $urlIds));

        $existingIds = $this->db->query("SELECT id FROM patterns WHERE id IN ($idList)");
        $cleanIds = [];

        if (!is_null($existingIds)) {
            $idList = [];
            $userProfile = $this->getUserProfile();

            for ($i=0; $i < count($existingIds); $i++) {
                $id = $existingIds[$i]->id;
                $cleanIds[] = convertToURL($id);
                $idList[] = "('{$userProfile->userId}', '{$id}')";
                $this->db->query("INSERT IGNORE INTO favorites (userId, patternId) VALUES ". implode(",", $idList));
            }
        }

        return new \core\Result($cleanIds);
    }

    public function getSchema() {
        return array(
            "patternIds" => array("type"=>self::JSON, "required"=>true)
        );
    }
}


text:
Migrations Documentation
=================

The Doctrine Migrations documentation is a reference guide to everything you need
to know about the migrations project.

Getting Help
------------

If this documentation is not helping to answer questions you have about
Doctrine Migrations don't panic. You can get help from different sources:

-  The `Doctrine Mailing List <https://groups.google.com/group/doctrine-user>`_
-  Slack chat room `#migrations <https://www.doctrine-project.org/slack>`_
-  Report a bug on `GitHub <https://github.com/doctrine/migrations/issues>`_.
-  On `StackOverflow <https://stackoverflow.com/questions/tagged/doctrine-migrations>`_

Getting Started
---------------

The best way to get started is with the :doc:`Introduction <introduction>` section.
Use the sidebar to browse other documentation for the Doctrine PHP Migrations project.