text:
import unittest

# the rules of the game
# v1
# gestures = ['rock', 'paper', 'scissors']
# def evaluate(player_move, computer_move):
#     if player_move == computer_move:
#         return 'Draw!'
#     elif player_move == 'paper' and computer_move == 'rock':
#         return "Player wins!"
#     elif player_move == 'rock' and computer_move == 'scissors':
#         return "Player wins!"
#     elif player_move == 'scissors' and computer_move == 'paper':
#         return "Player wins!"
#     else:
#         return "Computer wins!"

# v2: simplify conditions
player_wins = [('paper', 'rock'), ('rock', 'scissors'), ('scissors', 'paper')]

def evaluate(player_move, computer_move):
    if player_move == computer_move:
        return 'Draw!'
    elif (player_move, computer_move) in player_wins:
        return 'Player wins!'
    else:
        return 'Computer wins!'

# let's test our implementation of the rules
class Tests(unittest.TestCase):
    def test_evaluate(self):
        # not very robust way of testing!
        self.assertEqual(evaluate('rock', 'paper'), 'Computer wins!')
        self.assertEqual(evaluate('rock', 'scissors'), 'Player wins!')
        self.assertEqual(evaluate('rock', 'rock'), 'Draw!')

        # more robust, automated way of testing!
        # 1. test for draw
        for g in ['rock', 'paper', 'scissors']:
            self.assertEqual(evaluate(g, g), 'Draw!')
        # 2. test for player victory
        for g1, g2 in player_wins:
            self.assertEqual(evaluate(g1, g2), 'Player wins!')
        # note that we don't have to test for the conditions when
        # computer wins as there are no other possibilities

if __name__ == '__main__':
    unittest.main()


text:
// ----- this file has been automatically generated - do not edit
import { QualifiedName } from "node-opcua-data-model"
import { NodeId } from "node-opcua-nodeid"
import { Byte } from "node-opcua-basic-types"
import { ExtensionObject } from "node-opcua-extension-object"
import { DTDataTypeDescription } from "./dt_data_type_description"
import { DTEnumDefinition } from "./dt_enum_definition"
/**
 * |           |                                                  |
 * |-----------|--------------------------------------------------|
 * | namespace |http://opcfoundation.org/UA/                      |
 * | nodeClass |DataType                                          |
 * | name      |EnumDescription                                   |
 * | isAbstract|false                                             |
 */
export interface DTEnumDescription extends DTDataTypeDescription {
  dataTypeId: NodeId; // NodeId ns=0;i=17
  name: QualifiedName; // QualifiedName ns=0;i=20
  enumDefinition: DTEnumDefinition; // ExtensionObject ns=0;i=100
  builtInType: Byte; // Byte ns=0;i=3
}
export interface UDTEnumDescription extends ExtensionObject, DTEnumDescription {};

redpajama_set_name: RedPajamaGithub


text:
#include "Doom.h"

/**********************************

	Machine independent data for DOOM!

**********************************/

ammotype_t WeaponAmmos[NUMWEAPONS] = {	/* Ammo types for all weapons */
	am_noammo,		/* Fists */
	am_clip,		/* Pistol */
	am_shell,		/* Shotgun */
	am_clip,		/* Chain gun */
	am_misl,		/* Rocket launcher */
	am_cell,		/* Plasma rifle */
	am_cell,		/* BFG 9000 */
	am_noammo		/* Chainsaw */
};
Word maxammo[NUMAMMO] = {200,50,300,50};		/* Max ammo for ammo types */

Word PadAttack = PadA;	/* Joypad bit for attack */
Word PadUse = PadB;		/* Joypad bit for use */
Word PadSpeed = PadC;	/* Joypad bit for high speed */
Word ControlType;		/* Determine settings for PadAttack,Use,Speed */
Word TotalGameTicks;	/* Total number of ticks since game start */
Word ElapsedTime;		/* Ticks elapsed between frames */
Word MaxLevel;			/* Highest level selectable in menu (1-23) */
Word *DemoDataPtr;		/* Running pointer to demo data */
Word *DemoBuffer;		/* Pointer to demo data */
Word JoyPadButtons;		/* Current joypad */
Word PrevJoyPadButtons;	/* Previous joypad */
Word NewJoyPadButtons;	/* New joypad button downs */
skill_t StartSkill;		/* Default skill level */
Word StartMap;			/* Default map start */
void *BigNumFont;		/* Cached pointer to the big number font */
Word TotalKillsInLevel;		/* Number of monsters killed */
Word ItemsFoundInLevel;		/* Number of items found */
Word SecretsFoundInLevel;		/* Number of secrets discovered */
Word tx_texturelight;	/* Light value to pass to hardware */
Fixed lightsub;
Fixed lightcoef;
Fixed lightmin;
Fixed lightmax;
player_t players;	/* Current player stats */
gameaction_t gameaction;	/* Current game state */
skill_t gameskill;		/* Current skill level */
Word gamemap; 			/* Current game map # */
Word nextmap;			/* The map to go to after the stats */
Word ScreenSize;		/* Screen size to use */
Boolean LowDetail;		/* Use low detail mode */
Boolean DemoRecording;	/* True if demo is being recorded */
Boolean DemoPlayback;	/* True if demo is being played */
Boolean DoWipe;			/* True if I should do the DOOM wipe */


text:
namespace glm
{
	/// @addtogroup core_func_geometric
	/// @{

	/// Returns the length of x, i.e., sqrt(x * x).
	///
	/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
	/// @tparam T Floating-point scalar types.
	///
	/// @see GLSL length man page
	/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL T length(vec<L, T, Q> const& x);

	/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
	///
	/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
	/// @tparam T Floating-point scalar types.
	///
	/// @see GLSL distance man page
	/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL T distance(vec<L, T, Q> const& p0, vec<L, T, Q> const& p1);

	/// Returns the dot product of x and y, i.e., result = x * y.
	///
	/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
	/// @tparam T Floating-point scalar types.
	///
	/// @see GLSL dot man page
	/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL GLM_CONSTEXPR T dot(vec<L, T, Q> const& x, vec<L, T, Q> const& y);

	/// Returns the cross product of x and y.
	///
	/// @tparam T Floating-point scalar types.
	///
	/// @see GLSL cross man page
	/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions
	template<typename T, qualifier Q>
	GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y);

	/// Returns a vector in the same direction as x but with length of 1.
	/// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error.
	///
	/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
	/// @tparam T Floating-point scalar types.
	///
	/// @see GLSL normalize man page
	/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> normalize(vec<L, T, Q> const& x);

	/// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
	///
	/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
	/// @tparam T Floating-point scalar types.
	///
	/// @see GLSL faceforward man page
	/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> faceforward(
		vec<L, T, Q> const& N,
		vec<L, T, Q> const& I,
		vec<L, T, Q> const& Nref);

	/// For the incident vector I and surface orientation N,
	/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
	///
	/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
	/// @tparam T Floating-point scalar types.
	///
	/// @see GLSL reflect man page
	/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> reflect(
		vec<L, T, Q> const& I,
		vec<L, T, Q> const& N);

	/// For the incident vector I and surface normal N,
	/// and the ratio of indices of refraction eta,
	/// return the refraction vector.
	///
	/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
	/// @tparam T Floating-point scalar types.
	///
	/// @see GLSL refract man page
	/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> refract(
		vec<L, T, Q> const& I,
		vec<L, T, Q> const& N,
		T eta);

	/// @}
}//namespace glm

#include "detail/func_geometric.inl"


text:
<link rel="stylesheet" href="./dolls.css" />
<script src="../../dist/js/tether.js"></script>
<script src="./dolls.js"></script>
<body>
  <div class="scroll">
  </div>
</body>


text:
<?php
/**
 * The template for displaying comments
 *
 * The area of the page that contains both current comments
 * and the comment form.
 *
 * @package David James
 * @subpackage david-james
 * @since David James 1.0.1
 */

/*
 * If the current post is protected by a password and
 * the visitor has not yet entered the password we will
 * return early without loading the comments.
 */
if ( post_password_required() ) {
	return;
}
?>

	<?php if ( have_comments() ) : ?>

			<?php
				printf( _nx( 'Comments (%1$s)', 'Comments (%1$s)', get_comments_number(), 'comments title', 'twentyfifteen' ),
					number_format_i18n( get_comments_number() ), get_the_title() );
			?>

		<?php twentyfifteen_comment_nav(); ?>

		<?php $args = array(
			'walker'            => null,
			'max_depth'         => '',
			'style'             => 'ul',
			'callback'          => null,
			'end-callback'      => null,
			'type'              => 'all',
			'reply_text'        => 'Reply',
			'avatar_size'       => 32,
			'reverse_top_level' => null,
			'reverse_children'  => '',
			'format'            => 'html5', // or 'xhtml' if no 'HTML5' theme support
			'short_ping'        => false,   // @since 3.6
		  'echo'              => true     // boolean, default is true
		); ?>
			<?php
				wp_list_comments($args);
			?>

		<?php twentyfifteen_comment_nav(); ?>

	<?php endif; // have_comments() ?>

	<?php
		// If comments are closed and there are comments, let's leave a little note, shall we?
		if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
	?>

<?php _e( 'Comments are closed.', 'twentyfifteen' ); ?>

	<?php endif; ?>

	<?php comment_form(); ?>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Acquaintance.Logging;
using Acquaintance.PubSub;
using Acquaintance.Utility;

namespace Acquaintance.Scanning
{
    public class SubscriptionScanner
    {
        private readonly ILogger _logger;
        private readonly UntypedSubscriptionBuilder _builder;

        public SubscriptionScanner(IPubSubBus messageBus, ILogger logger)
        {
            Assert.ArgumentNotNull(messageBus, nameof(messageBus));

            _logger = logger ?? messageBus.Logger;
            _builder = new UntypedSubscriptionBuilder(messageBus);
        }

        public IDisposable DetectAndWireUp(object obj, bool useWeakReferences = false)
        {
            var tokens = DetectAndWireUpAll(obj, useWeakReferences);
            return new DisposableCollection(tokens);
        }

        public IEnumerable<IDisposable> DetectAndWireUpAll(object obj, bool useWeakReference = false)
        {
            Assert.ArgumentNotNull(obj, nameof(obj));

            var type = obj.GetType();
            var methods = GetSubscribeableMethods(type).ToList();
            return methods.Select(m => WireupMethod(obj, m, type, useWeakReference));
        }

        private IDisposable WireupMethod(object obj, SubscribeableMethod method, Type type, bool useWeakReference)
        {
            if (method.PayloadType == null)
            {
                _logger.Error($"Could not determine payload type for subscription {type.Name}.{method.Method.Name}");
                return null;
            }

            var methodInfo = method.Method;

            // If the method does not have a parameter, subscribe a trampoline to get to that method
            // TODO: Instead of a trampoline to MethodInfo.Invoke, can we compile an expression to do this?
            if (method.ParameterType == null)
                return _builder.SubscribeUntyped(method.PayloadType, method.Subscription.Topics, () => methodInfo.Invoke(obj, new object[0]), useWeakReference);

            // If the method has a parameter, and it's an Envelope<> type, subscribe it that way
            if (method.IsEnvelopeType)
                return _builder.SubscribeEnvelopeUntyped(method.PayloadType, method.Subscription.Topics, obj, methodInfo, useWeakReference);

            // If the parameter type is assignable from the payload type, subscribe it that way
            if (method.ParameterType.IsAssignableFrom(method.PayloadType))
                return _builder.SubscribeUntyped(method.PayloadType, method.Subscription.Topics, obj, methodInfo, useWeakReference);

            // We can't match the type, log an error
            _logger.Error($"Could not add subscription {type.Name}.{methodInfo.Name} because parameter of type {method.ParameterType.Name} is not assignable from {method.PayloadType.Name}");
            return null;
        }

        private class CandidateSubscribableMethod
        {
            public CandidateSubscribableMethod(MethodInfo method)
            {
                Method = method;
                Subscriptions = method.GetCustomAttributes(typeof(SubscriptionAttribute))
                    .OfType<SubscriptionAttribute>()
                    .ToArray();
                Parameters = method.GetParameters();
            }

            public MethodInfo Method { get;  }
            public SubscriptionAttribute[] Subscriptions { get;  }
            public ParameterInfo[] Parameters { get; }
        }

        private class SubscribeableMethod
        {
            public SubscribeableMethod(MethodInfo method, SubscriptionAttribute subscription, Type payloadType, Type parameterType, bool isEnvelope)
            {
                Method = method;
                Subscription = subscription;
                PayloadType = payloadType;
                ParameterType = parameterType;
                IsEnvelopeType = isEnvelope;
            }

            public MethodInfo Method { get; }
            public SubscriptionAttribute Subscription { get; }
            public Type PayloadType { get; }
            public Type ParameterType { get; }
            public bool IsEnvelopeType { get; }
        }

        private IEnumerable<SubscribeableMethod> GetSubscribeableMethods(Type type)
        {
            return type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.InvokeMethod)
                .Where(m => m.ReturnType == typeof(void))
                .Where(m => !m.IsAbstract)
                .Select(m => new CandidateSubscribableMethod(m))
                .SelectMany(c => GetSubscribeableMethods(type, c));
        }

        private IEnumerable<SubscribeableMethod> GetSubscribeableMethods(Type type, CandidateSubscribableMethod candidateSubscribable)
        {
            if (candidateSubscribable?.Subscriptions == null || !candidateSubscribable.Subscriptions.Any())
                return Enumerable.Empty<SubscribeableMethod>();
            if (candidateSubscribable.Parameters.Length > 1)
            {
                _logger.Error($"Could not add subscription {type.Name}.{candidateSubscribable.Method.Name} because it has too many parameters");
                return Enumerable.Empty<SubscribeableMethod>();
            }

            return candidateSubscribable.Subscriptions
                .Select(s => GetSubscribeableMethod(candidateSubscribable.Method, s))
                .Where(m => m != null);
        }

        private SubscribeableMethod GetSubscribeableMethod(MethodInfo method, SubscriptionAttribute subscription)
        {
            Type payloadType = subscription.PayloadType.UnwrapEnvelopeType();

            // void MyMethod<T>(T) or void MyMethod<T>() or void MyMethod<T>(Envelope<T>)
            // If the method is generic, we can try to fill in the type parameters with the value from the attribute
            if (method.IsGenericMethodDefinition)
            {
                if (method.GetGenericArguments().Length != 1 || payloadType == null)
                {
                    _logger.Error($"Cannot subscribe method {method.Name} because method is generic and there is not enough information to construct it");
                    return null;
                }
                method = method.MakeGenericMethod(payloadType);
            }

            Type parameterType = method.GetParameters().FirstOrDefault()?.ParameterType;

            // void MyMethod()
            // There is no parameter, so see if we have enough information to construct a trampoline
            if (parameterType == null)
            {
                // We have no type information at all, so we can't do anything
                if (payloadType == null)
                {
                    _logger.Error($"Could not determine which channel to use because payload type is not provided and there is no parameter");
                    return null;
                }

                // This is not a fully-constructed type, so we can't determine a channel for it
                if (payloadType.IsGenericType && !payloadType.IsConstructedGenericType)
                {
                    _logger.Error($"Payload type {payloadType.Name} is not fully-constructed and cannot be used to define a channel");
                    return null;
                }

                // Use the payload type from the attribute to create a trampoline to a method with no parameters
                return new SubscribeableMethod(method, subscription, payloadType, null, false);
            }

            // parameterType is the type of the raw parameter, which may include Envelope<>
            // parameterPayloadType is the type of the payload without Envelope<>

            bool isEnvelope = parameterType.IsEnvelopeType();
            Type parameterPayloadType = parameterType.UnwrapEnvelopeType();

            if (payloadType == null)
                payloadType = parameterPayloadType;

            // void MyMethod<T>(T payload) or void MyMethod<T>(Envelope<T> payload)
            // This is not a fully-constructed type, so we can't determine a channel for it
            if (payloadType.IsGenericType && !payloadType.IsConstructedGenericType)
            {
                _logger.Error($"Payload type {payloadType.Name} is not fully-constructed and cannot be used");
                return null;
            }

            // Check that the type information between parameter and specified payload type are assignable
            if (!parameterPayloadType.IsAssignableFrom(payloadType))
            {
                _logger.Error($"Cannot subscribe method {method.Name} because specified payload type {payloadType.Name} is not assignable to parameter type {parameterPayloadType.Name}");
                return null;
            }

            return new SubscribeableMethod(method, subscription, payloadType, parameterType, isEnvelope);
        }
    }
}


text:
package com.gamerscave.acrabackend;

import android.app.Activity;
import android.support.design.widget.CollapsingToolbarLayout;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import com.gamerscave.acrabackend.content.Content;
import com.gamerscave.acrabackend.content.HomeSCR;
import com.gamerscave.acrabackend.utils.Error;
import com.gamerscave.acrabackend.utils.SQLSaver;

import static com.gamerscave.acrabackend.content.Content.ITEMS;

/**
 * A fragment representing a single Error detail screen.
 * This fragment is either contained in a {@link ErrorListActivity}
 * in two-pane mode (on tablets) or a {@link ErrorDetailActivity}
 * on handsets.
 */
public class ErrorDetailFragment extends Fragment {
    /**
     * The fragment argument representing the item ID that this fragment
     * represents.
     */
    public static final String ARG_ITEM_ID = "item_id";

    private Activity activity;
    /**
     * The dummy content this fragment is presenting.
     */
    private Content.Item mItem;

    private HomeSCR homescr;
    /**
     * Mandatory empty constructor for the fragment manager to instantiate the
     * fragment (e.g. upon screen orientation changes).
     */
    public ErrorDetailFragment() {
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (getArguments().containsKey(ARG_ITEM_ID)) {
            // Load the dummy content specified by the fragment
            // arguments. In a real-world scenario, use a Loader
            // to load content from a content provider.
            if(getArguments().getString(ARG_ITEM_ID).equals("HomeScreen")){
                homescr = HomeSCR.newInstance(ITEMS);
            }else {
                mItem = Content.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID));

                Activity activity = this.getActivity();
                CollapsingToolbarLayout appBarLayout = (CollapsingToolbarLayout) activity.findViewById(R.id.toolbar_layout);
                if (appBarLayout != null) {
                    appBarLayout.setTitle(mItem.error.getTitle());
                }
            }
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.error_detail, container, false);

        // Show the dummy content as text in a TextView.
        if (mItem != null) {
            ((TextView) rootView.findViewById(R.id.error_detail)).setText(mItem.error.getContent());
            Button b = (Button) rootView.findViewById(R.id.delete);
            b.setVisibility(View.VISIBLE);
            b.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                    SQLSaver sql = new SQLSaver(getActivity());
                    sql.delete(mItem.error.hash);
                    sql.onDestroy();
                    if(activity instanceof ErrorDetailActivity){
                        ((ErrorDetailActivity)(getActivity())).dismiss();
                    }else if(activity instanceof ErrorListActivity){
                        ((ErrorListActivity)(getActivity())).dismissFragment();
                    }

                }
            });
        }else{
            if(homescr != null){
                ((TextView) rootView.findViewById(R.id.error_detail)).setText(homescr.HOMESCREEN_CONTENT);
                Button b = (Button) rootView.findViewById(R.id.delete);
                b.setVisibility(View.GONE);
            }
        }

        return rootView;
    }

    public void injectActivity(Activity a){
        this.activity = a;
    }
}


text:
namespace urde {
static logvisor::Module Log("urde::CParticleSwooshDataFactory");

using CPF = CParticleDataFactory;

CSwooshDescription* CParticleSwooshDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool) {
  return CreateGeneratorDescription(in, resPool);
}

CSwooshDescription* CParticleSwooshDataFactory::CreateGeneratorDescription(CInputStream& in, CSimplePool* resPool) {
  FourCC clsId = CPF::GetClassID(in);
  if (clsId == FOURCC('SWSH')) {
    CSwooshDescription* desc = new CSwooshDescription;
    if (CreateWPSM(desc, in, resPool))
      return desc;
    else
      delete desc;
  }
  return nullptr;
}

bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStream& in, CSimplePool* resPool) {
  CRandom16 rand;
  FourCC clsId = CPF::GetClassID(in);
  while (clsId != SBIG('_END')) {
    CGlobalRandom gr(rand);
    switch (clsId.toUint32()) {
    case SBIG('PSLT'):
      desc->x0_PSLT = CPF::GetIntElement(in);
      break;
    case SBIG('TIME'):
      desc->x4_TIME = CPF::GetRealElement(in);
      break;
    case SBIG('LRAD'):
      desc->x8_LRAD = CPF::GetRealElement(in);
      break;
    case SBIG('RRAD'):
      desc->xc_RRAD = CPF::GetRealElement(in);
      break;
    case SBIG('LENG'):
      desc->x10_LENG = CPF::GetIntElement(in);
      break;
    case SBIG('COLR'):
      desc->x14_COLR = CPF::GetColorElement(in);
      break;
    case SBIG('SIDE'):
      desc->x18_SIDE = CPF::GetIntElement(in);
      break;
    case SBIG('IROT'):
      desc->x1c_IROT = CPF::GetRealElement(in);
      break;
    case SBIG('ROTM'):
      desc->x20_ROTM = CPF::GetRealElement(in);
      break;
    case SBIG('POFS'):
      desc->x24_POFS = CPF::GetVectorElement(in);
      break;
    case SBIG('IVEL'):
      desc->x28_IVEL = CPF::GetVectorElement(in);
      break;
    case SBIG('NPOS'):
      desc->x2c_NPOS = CPF::GetVectorElement(in);
      break;
    case SBIG('VELM'):
      desc->x30_VELM = CPF::GetModVectorElement(in);
      break;
    case SBIG('VLM2'):
      desc->x34_VLM2 = CPF::GetModVectorElement(in);
      break;
    case SBIG('SPLN'):
      desc->x38_SPLN = CPF::GetIntElement(in);
      break;
    case SBIG('TEXR'):
      desc->x3c_TEXR = CPF::GetTextureElement(in, resPool);
      break;
    case SBIG('TSPN'):
      desc->x40_TSPN = CPF::GetIntElement(in);
      break;
    case SBIG('LLRD'):
      desc->x44_24_LLRD = CPF::GetBool(in);
      break;
    case SBIG('CROS'):
      desc->x44_25_CROS = CPF::GetBool(in);
      break;
    case SBIG('VLS1'):
      desc->x44_26_VLS1 = CPF::GetBool(in);
      break;
    case SBIG('VLS2'):
      desc->x44_27_VLS2 = CPF::GetBool(in);
      break;
    case SBIG('SROT'):
      desc->x44_28_SROT = CPF::GetBool(in);
      break;
    case SBIG('WIRE'):
      desc->x44_29_WIRE = CPF::GetBool(in);
      break;
    case SBIG('TEXW'):
      desc->x44_30_TEXW = CPF::GetBool(in);
      break;
    case SBIG('AALP'):
      desc->x44_31_AALP = CPF::GetBool(in);
      break;
    case SBIG('ZBUF'):
      desc->x45_24_ZBUF = CPF::GetBool(in);
      break;
    case SBIG('ORNT'):
      desc->x45_25_ORNT = CPF::GetBool(in);
      break;
    case SBIG('CRND'):
      desc->x45_26_CRND = CPF::GetBool(in);
      break;
    default: {
      Log.report(logvisor::Fatal, fmt("Unknown SWSH class {} @{}"), clsId, in.position());
      return false;
    }
    }
    clsId = CPF::GetClassID(in);
  }

  return true;
}

CFactoryFnReturn FParticleSwooshDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
                                            CObjectReference*) {
  CSimplePool* sp = vparms.GetOwnedObj<CSimplePool*>();
  return TToken<CSwooshDescription>::GetIObjObjectFor(
      std::unique_ptr<CSwooshDescription>(CParticleSwooshDataFactory::GetGeneratorDesc(in, sp)));
}
} // namespace urde


text:
package org.camunda.bpm.engine.rest;

import org.camunda.bpm.engine.rest.dto.message.CorrelationMessageDto;

import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@Produces(MediaType.APPLICATION_JSON)
public interface MessageRestService {

  public static final String PATH = "/message";

  @POST
  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  Response deliverMessage(CorrelationMessageDto messageDto);
}


text:
package org.uma.jmetal.qualityindicator.impl;

import org.uma.jmetal.qualityindicator.QualityIndicator;
import org.uma.jmetal.solution.Solution;
import org.uma.jmetal.util.front.Front;
import org.uma.jmetal.util.front.impl.ArrayFront;
import org.uma.jmetal.util.front.util.FrontNormalizer;
import org.uma.jmetal.util.front.util.FrontUtils;
import org.uma.jmetal.util.naming.impl.SimpleDescribedEntity;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.List;
import java.util.StringTokenizer;

/**
 * TODO: Add comments here
 */
@SuppressWarnings("serial")
public class R2<Evaluate extends List<? extends Solution<?>>>
    extends SimpleDescribedEntity
    implements QualityIndicator<Evaluate,Double> {
    private final double[][] lambda;

  private final Front referenceParetoFront;

  /**
   * Creates a new instance of the R2 indicator for a problem with
   * two objectives and 100 lambda vectors
   */
  public R2(Front referenceParetoFront) {
    // by default it creates an R2 indicator for a two dimensions problem and
    // uses only 100 weight vectors for the R2 computation
    this(100, referenceParetoFront);
  }

  /**
   * Creates a new instance of the R2 indicator for a problem with
   * two objectives and 100 lambda vectors
   */
  public R2() {
    // by default it creates an R2 indicator for a two dimensions problem and
    // uses only 100 weight vectors for the R2 computation
    this(100);
  }

  /**
   * Creates a new instance of the R2 indicator for a problem with
   * two objectives and N lambda vectors
   */
  public R2(int nVectors)  {
	  this(nVectors, null);
  }

    /**
     * Constructor
     * Creates a new instance of the R2 indicator for nDimensiosn
     * It loads the weight vectors from the file fileName
     */
    public R2(String file, Front referenceParetoFront) throws java.io.IOException {
        this(readWeightsFrom(file), referenceParetoFront);
    }

  /**
   * Creates a new instance of the R2 indicator for a problem with
   * two objectives and N lambda vectors
   */
  public R2(int nVectors, Front referenceParetoFront)  {
    // by default it creates an R2 indicator for a two dimensions problem and
    // uses only nVectors weight vectors for the R2 computation
    this(generateWeights(nVectors), referenceParetoFront);
  }

  private R2(double[][] lambda, Front referenceParetoFront)  {
    // by default it creates an R2 indicator for a two dimensions problem and
    // uses only nVectors weight vectors for the R2 computation
    super("R2", "R2 quality indicator") ;
    this.lambda = lambda;
    this.referenceParetoFront = referenceParetoFront;
  }

  private static double[][] generateWeights(int nVectors) {
	double[][] lambda = new double[nVectors][2];
    for (int n = 0; n < nVectors; n++) {
      double a = 1.0 * n / (nVectors - 1);
      lambda[n][0] = a;
      lambda[n][1] = 1 - a;
    }
    return lambda;
  }

	private static double[][] readWeightsFrom(String file) throws java.io.IOException {
		FileInputStream fis = new FileInputStream(file);
        InputStreamReader isr = new InputStreamReader(fis);
      try(BufferedReader br = new BufferedReader(isr)){

        String line = br.readLine();
        double[][] lambda;
        if (line==null) {
          lambda = null;
        } else {
          int numberOfObjectives = (new StringTokenizer(line)).countTokens();
          int numberOfVectors   =  (int) br.lines().count();

          lambda = new double[numberOfVectors][numberOfObjectives];

          int index = 0;
          while (line!=null) {
            StringTokenizer st = new StringTokenizer(line);
            for (int i = 0; i < numberOfObjectives; i++)
              lambda[index][i] = Double.valueOf(st.nextToken());
            index++;
            line = br.readLine();
          }

        }
        return lambda;
      }
	}

    /**
   * Constructor
   * Creates a new instance of the R2 indicator for nDimensiosn
   * It loads the weight vectors from the file fileName
   */
  public R2(String file) throws java.io.IOException {
    this(file, null);
  } // R2

  @Override public Double evaluate(Evaluate solutionList) {
    return r2(new ArrayFront(solutionList));
  }

  @Override public String getName() {
    return super.getName();
  }

  public double r2(Front front) {
    if (this.referenceParetoFront != null) {
       // STEP 1. Obtain the maximum and minimum values of the Pareto front
       double[] maximumValues = FrontUtils.getMaximumValues(this.referenceParetoFront);
       double[] minimumValues = FrontUtils.getMinimumValues(this.referenceParetoFront);

       // STEP 2. Get the normalized front
       FrontNormalizer frontNormalizer = new FrontNormalizer(minimumValues, maximumValues);
       front = frontNormalizer.normalize(front);
    }

    int numberOfObjectives = front.getPoint(0).getDimension();

    // STEP 3. compute all the matrix of Tschebyscheff values if it is null
    double[][] matrix = new double[front.getNumberOfPoints()][lambda.length];
    for (int i = 0; i < front.getNumberOfPoints(); i++) {
      for (int j = 0; j < lambda.length; j++) {
        matrix[i][j] = lambda[j][0] * Math.abs(front.getPoint(i).getValue(0));
        for (int n = 1; n < numberOfObjectives; n++) {
          matrix[i][j] = Math.max(matrix[i][j],
          lambda[j][n] * Math.abs(front.getPoint(i).getValue(n)));
        }
      }
    }

    double sum = 0.0;
    for (int i = 0; i < lambda.length; i++) {
      double tmp = matrix[0][i];
      for (int j = 1; j < front.getNumberOfPoints(); j++) {
        tmp = Math.min(tmp, matrix[j][i]);
      }
      sum += tmp;
    }
    return sum / (double) lambda.length;
  }
}


text:
#include "bgp/routing-instance/routepath_replicator.h"

#include <boost/foreach.hpp>

#include <utility>

#include "base/set_util.h"
#include "base/task_annotations.h"
#include "base/task_trigger.h"
#include "bgp/bgp_config.h"
#include "bgp/bgp_log.h"
#include "bgp/bgp_route.h"
#include "bgp/bgp_server.h"
#include "bgp/origin-vn/origin_vn.h"
#include "bgp/routing-instance/routing_instance.h"
#include "bgp/routing-instance/rtarget_group_mgr.h"
#include "bgp/routing-instance/routing_instance_analytics_types.h"

using std::ostringstream;
using std::make_pair;
using std::pair;
using std::string;
using std::vector;

//
// RoutePathReplication trace macro. Optionally logs the server name as well for
// easier debugging in multi server unit tests
//
#define RPR_TRACE(obj, ...)                                                    \
do {                                                                           \
    if (LoggingDisabled()) break;                                              \
    bgp_log_test::LogServerName(server());                                     \
    Rpr##obj##Log::Send("RoutingInstance",                                     \
            SandeshLevel::SYS_DEBUG, __FILE__, __LINE__, __VA_ARGS__);         \
    Rpr##obj::TraceMsg(trace_buf_, __FILE__, __LINE__, __VA_ARGS__);           \
} while (false)

#define RPR_TRACE_ONLY(obj, ...)                                               \
do {                                                                           \
    if (LoggingDisabled()) break;                                              \
    bgp_log_test::LogServerName(server());                                     \
    Rpr##obj::TraceMsg(trace_buf_, __FILE__, __LINE__, __VA_ARGS__);           \
} while (false)

class TableState::DeleteActor : public LifetimeActor {
public:
    explicit DeleteActor(TableState *ts)
        : LifetimeActor(ts->replicator()->server()->lifetime_manager()),
          ts_(ts) {
    }

    virtual bool MayDelete() const {
        return ts_->MayDelete();
    }

    virtual void Shutdown() {
    }

    virtual void Destroy() {
        ts_->replicator()->DeleteTableState(ts_->table());
    }

private:
    TableState *ts_;
};

TableState::TableState(RoutePathReplicator *replicator, BgpTable *table)
    : replicator_(replicator),
      table_(table),
      listener_id_(DBTableBase::kInvalidId),
      deleter_(new DeleteActor(this)),
      table_delete_ref_(this, table->deleter()) {
    assert(table->deleter() != NULL);
}

TableState::~TableState() {
    if (walk_ref() != NULL) {
        table()->ReleaseWalker(walk_ref());
    }
}

void TableState::ManagedDelete() {
    deleter()->Delete();
}

bool TableState::deleted() const {
    return deleter()->IsDeleted();
}

LifetimeActor *TableState::deleter() {
    return deleter_.get();
}

const LifetimeActor *TableState::deleter() const {
    return deleter_.get();
}

bool TableState::MayDelete() const {
    if (list_.empty() && !route_count() &&
        ((walk_ref() == NULL) || !walk_ref()->walk_is_active()))
        return true;
    return false;
}

void TableState::RetryDelete() {
    if (!deleter()->IsDeleted())
        return;
    deleter()->RetryDelete();
}

void TableState::AddGroup(RtGroup *group) {
    list_.insert(group);
}

void TableState::RemoveGroup(RtGroup *group) {
    list_.erase(group);
}

const RtGroup *TableState::FindGroup(RtGroup *group) const {
    GroupList::const_iterator it = list_.find(group);
    return (it != list_.end() ? *it : NULL);
}

uint32_t TableState::route_count() const {
    return table_->GetDBStateCount(listener_id());
}

RtReplicated::RtReplicated(RoutePathReplicator *replicator)
    : replicator_(replicator) {
}

void RtReplicated::AddRouteInfo(BgpTable *table, BgpRoute *rt,
    ReplicatedRtPathList::const_iterator it) {
    pair<ReplicatedRtPathList::iterator, bool> result;
    result = replicate_list_.insert(*it);
    assert(result.second);
}

void RtReplicated::DeleteRouteInfo(BgpTable *table, BgpRoute *rt,
    ReplicatedRtPathList::const_iterator it) {
    replicator_->DeleteSecondaryPath(table, rt, *it);
    replicate_list_.erase(it);
}

//
// Return the list of secondary table names for the given primary path.
// We go through all SecondaryRouteInfos and skip the ones that don't
// match the primary path.
//
vector<string> RtReplicated::GetTableNameList(const BgpPath *path) const {
    vector<string> table_list;
    BOOST_FOREACH(const SecondaryRouteInfo &rinfo, replicate_list_) {
        if (rinfo.peer_ != path->GetPeer())
            continue;
        if (rinfo.path_id_ != path->GetPathId())
            continue;
        if (rinfo.src_ != path->GetSource())
            continue;
        table_list.push_back(rinfo.table_->name());
    }
    return table_list;
}

RoutePathReplicator::RoutePathReplicator(BgpServer *server,
    Address::Family family)
    : server_(server),
      family_(family),
      vpn_table_(NULL),
      trace_buf_(SandeshTraceBufferCreate("RoutePathReplicator", 500)) {
}

RoutePathReplicator::~RoutePathReplicator() {
    assert(table_state_list_.empty());
}

void RoutePathReplicator::Initialize() {
    assert(!vpn_table_);
    RoutingInstanceMgr *mgr = server_->routing_instance_mgr();
    assert(mgr);
    RoutingInstance *master = mgr->GetDefaultRoutingInstance();
    assert(master);
    vpn_table_ = master->GetTable(family_);
    assert(vpn_table_);
    assert(AddTableState(vpn_table_));
}

TableState *RoutePathReplicator::AddTableState(BgpTable *table,
    RtGroup *group) {
    assert(table->IsVpnTable() || group);

    TableStateList::iterator loc = table_state_list_.find(table);
    if (loc == table_state_list_.end()) {
        TableState *ts = new TableState(this, table);
        DBTableBase::ListenerId id = table->Register(
            boost::bind(&RoutePathReplicator::RouteListener, this, ts, _1, _2),
            "RoutePathReplicator");
        ts->set_listener_id(id);
        if (group)
            ts->AddGroup(group);
        table_state_list_.insert(make_pair(table, ts));
        RPR_TRACE(RegTable, table->name());
        return ts;
    } else {
        assert(group);
        TableState *ts = loc->second;
        ts->AddGroup(group);
        return ts;
    }
}

void RoutePathReplicator::RemoveTableState(BgpTable *table, RtGroup *group) {
    TableState *ts = FindTableState(table);
    assert(ts);
    ts->RemoveGroup(group);
}

void RoutePathReplicator::DeleteTableState(BgpTable *table) {
    TableState *ts = FindTableState(table);
    assert(ts);
    RPR_TRACE(UnregTable, table->name());
    table->Unregister(ts->listener_id());
    table_state_list_.erase(table);
    delete ts;
}

TableState *RoutePathReplicator::FindTableState(BgpTable *table) {
    TableStateList::iterator loc = table_state_list_.find(table);
    return (loc != table_state_list_.end() ? loc->second : NULL);
}

const TableState *RoutePathReplicator::FindTableState(
    const BgpTable *table) const {
    TableStateList::const_iterator loc =
        table_state_list_.find(const_cast<BgpTable *>(table));
    return (loc != table_state_list_.end() ? loc->second : NULL);
}

void
RoutePathReplicator::RequestWalk(BgpTable *table) {
    CHECK_CONCURRENCY("bgp::Config", "bgp::ConfigHelper");
    TableState *ts = FindTableState(table);
    assert(ts);
    if (!ts->walk_ref()) {
        DBTable::DBTableWalkRef walk_ref = table->AllocWalker(
          boost::bind(&RoutePathReplicator::RouteListener, this, ts, _1, _2),
          boost::bind(&RoutePathReplicator::BulkReplicationDone, this, _2));
        table->WalkTable(walk_ref);
        ts->set_walk_ref(walk_ref);
    } else {
        table->WalkAgain(ts->walk_ref());
    }
}

void
RoutePathReplicator::BulkReplicationDone(DBTableBase *dbtable) {
    CHECK_CONCURRENCY("db::Walker");
    BgpTable *table = static_cast<BgpTable *>(dbtable);
    RPR_TRACE(WalkDone, table->name());
    TableState *ts = FindTableState(table);
    ts->RetryDelete();
}

void RoutePathReplicator::JoinVpnTable(RtGroup *group) {
    CHECK_CONCURRENCY("bgp::Config", "bgp::ConfigHelper");
    TableState *vpn_ts = FindTableState(vpn_table_);
    if (!vpn_ts || vpn_ts->FindGroup(group))
        return;
    RPR_TRACE(TableJoin, vpn_table_->name(), group->rt().ToString(), true);
    group->AddImportTable(family(), vpn_table_);
    RPR_TRACE(TableJoin, vpn_table_->name(), group->rt().ToString(), false);
    group->AddExportTable(family(), vpn_table_);
    AddTableState(vpn_table_, group);
}

void RoutePathReplicator::LeaveVpnTable(RtGroup *group) {
    CHECK_CONCURRENCY("bgp::Config", "bgp::ConfigHelper");
    TableState *vpn_ts = FindTableState(vpn_table_);
    if (!vpn_ts)
        return;
    RPR_TRACE(TableLeave, vpn_table_->name(), group->rt().ToString(), true);
    group->RemoveImportTable(family(), vpn_table_);
    RPR_TRACE(TableLeave, vpn_table_->name(), group->rt().ToString(), false);
    group->RemoveExportTable(family(), vpn_table_);
    RemoveTableState(vpn_table_, group);
}

//
// Add a given BgpTable to RtGroup of given RouteTarget.
// It will create a new RtGroup if none exists.
// In case of export RouteTarget, create TableState if it doesn't exist.
//
void RoutePathReplicator::Join(BgpTable *table, const RouteTarget &rt,
                               bool import) {
    CHECK_CONCURRENCY("bgp::Config", "bgp::ConfigHelper");

    tbb::mutex::scoped_lock lock(mutex_);
    RPR_TRACE(TableJoin, table->name(), rt.ToString(), import);

    bool first = false;
    RtGroup *group = server()->rtarget_group_mgr()->LocateRtGroup(rt);
    if (import) {
        first = group->AddImportTable(family(), table);
        if (group->HasDepRoutes())
            server()->rtarget_group_mgr()->NotifyRtGroup(rt);
        if (family_ == Address::INETVPN)
            server_->NotifyAllStaticRoutes();
        BOOST_FOREACH(BgpTable *sec_table, group->GetExportTables(family())) {
            if (sec_table->IsVpnTable() || sec_table->empty())
                continue;
            RequestWalk(sec_table);
        }
    } else {
        first = group->AddExportTable(family(), table);
        AddTableState(table, group);
        if (!table->empty()) {
            RequestWalk(table);
        }
    }

    // Join the vpn table when group is created.
    if (first)
        JoinVpnTable(group);
}

//
// Remove a BgpTable from RtGroup of given RouteTarget.
// If the last group is going away, the RtGroup will be removed
// In case of export RouteTarget, trigger remove of TableState appropriate.
//
void RoutePathReplicator::Leave(BgpTable *table, const RouteTarget &rt,
                                bool import) {
    CHECK_CONCURRENCY("bgp::Config", "bgp::ConfigHelper");

    tbb::mutex::scoped_lock lock(mutex_);
    RtGroup *group = server()->rtarget_group_mgr()->GetRtGroup(rt);
    assert(group);
    RPR_TRACE(TableLeave, table->name(), rt.ToString(), import);

    if (import) {
        group->RemoveImportTable(family(), table);
        if (group->HasDepRoutes())
            server()->rtarget_group_mgr()->NotifyRtGroup(rt);
        if (family_ == Address::INETVPN)
            server_->NotifyAllStaticRoutes();
        BOOST_FOREACH(BgpTable *sec_table, group->GetExportTables(family())) {
            if (sec_table->IsVpnTable() || sec_table->empty())
                continue;
            RequestWalk(sec_table);
        }
    } else {
        group->RemoveExportTable(family(), table);
        RemoveTableState(table, group);
        if (!table->empty()) {
            RequestWalk(table);
        }
    }

    // Leave the vpn table when the last VRF has left the group.
    if (!group->HasVrfTables(family())) {
        LeaveVpnTable(group);
        server()->rtarget_group_mgr()->RemoveRtGroup(rt);
    }
}

void RoutePathReplicator::DBStateSync(BgpTable *table, TableState *ts,
    BgpRoute *rt, RtReplicated *dbstate,
    const RtReplicated::ReplicatedRtPathList *future) {
    set_synchronize(dbstate->GetMutableList(), future,
        boost::bind(&RtReplicated::AddRouteInfo, dbstate, table, rt, _1),
        boost::bind(&RtReplicated::DeleteRouteInfo, dbstate, table, rt, _1));

    if (dbstate->GetList().empty()) {
        rt->ClearState(table, ts->listener_id());
        delete dbstate;
        if (table->GetDBStateCount(ts->listener_id()) == 0)
            ts->RetryDelete();
    }
}

//
// Update the ExtCommunity with the RouteTargets from the export list
// and the OriginVn. The OriginVn is derived from the RouteTargets in
// vpn routes.
//
static ExtCommunityPtr UpdateExtCommunity(BgpServer *server,
        const RoutingInstance *rtinstance, const ExtCommunity *ext_community,
        const ExtCommunity::ExtCommunityList &export_list) {
    // Add RouteTargets exported by the instance for a non-master instance.
    ExtCommunityPtr extcomm_ptr;
    if (!rtinstance->IsMasterRoutingInstance()) {
        extcomm_ptr =
            server->extcomm_db()->AppendAndLocate(ext_community, export_list);
        return extcomm_ptr;
    }

    // Bail if we have a vpn route without extended communities.
    if (!ext_community)
        return ExtCommunityPtr(NULL);

    // Nothing to do if we already have the OriginVn community with our AS
    // or with a vn index from the global range.
    BOOST_FOREACH(const ExtCommunity::ExtCommunityValue &comm,
                  ext_community->communities()) {
        if (!ExtCommunity::is_origin_vn(comm))
            continue;
        OriginVn origin_vn(comm);
        if (!origin_vn.IsGlobal() &&
            origin_vn.as_number() != server->autonomous_system()) {
            continue;
        }
        return ExtCommunityPtr(ext_community);
    }

    // Add the OriginVn if we have a valid vn index.
    int vn_index =
        server->routing_instance_mgr()->GetVnIndexByExtCommunity(ext_community);
    if (vn_index) {
        OriginVn origin_vn(server->autonomous_system(), vn_index);
        extcomm_ptr = server->extcomm_db()->ReplaceOriginVnAndLocate(
            ext_community, origin_vn.GetExtCommunity());
        return extcomm_ptr;
    } else {
        extcomm_ptr = server->extcomm_db()->RemoveOriginVnAndLocate(
            ext_community);
        return extcomm_ptr;
    }

    return ExtCommunityPtr(ext_community);
}

//
// Concurrency: Called in the context of the DB partition task.
//
// This function handles
//   1. Table Notification for path replication
//   2. Table walk for import/export of new targets
//
// Replicate a path (clone the BgpPath) to secondary BgpTables based on the
// export targets of the primary BgpTable.
// If primary table is a VRF table attach it's export targets to replicated
// path in the VPN table.
//
bool RoutePathReplicator::RouteListener(TableState *ts,
    DBTablePartBase *root, DBEntryBase *entry) {
    CHECK_CONCURRENCY("db::DBTable");

    BgpTable *table = static_cast<BgpTable *>(root->parent());
    BgpRoute *rt = static_cast<BgpRoute *>(entry);
    const RoutingInstance *rtinstance = table->routing_instance();

    DBTableBase::ListenerId id = ts->listener_id();
    assert(id != DBTableBase::kInvalidId);

    // Get the DBState.
    RtReplicated *dbstate =
        static_cast<RtReplicated *>(rt->GetState(table, id));
    RtReplicated::ReplicatedRtPathList replicated_path_list;

    //
    // Cleanup if the route is not usable.
    // If route aggregation is enabled, contributing route/more specific route
    // for a aggregate route will NOT be replicated to destination table
    //
    if (!rt->IsUsable() || (table->IsRouteAggregationSupported() &&
                            !rtinstance->deleted() &&
                            table->IsContributingRoute(rt))) {
        if (!dbstate) {
            return true;
        }
        DBStateSync(table, ts, rt, dbstate, &replicated_path_list);
        return true;
    }

    // Create and set new DBState on the route.  This will get cleaned up via
    // via the call to DBStateSync if we don't need to replicate the route to
    // any tables.
    if (dbstate == NULL) {
        dbstate = new RtReplicated(this);
        rt->SetState(table, id, dbstate);
    }

    // Get the export route target list from the routing instance.
    ExtCommunity::ExtCommunityList export_list;
    if (!rtinstance->IsMasterRoutingInstance()) {
        BOOST_FOREACH(RouteTarget rtarget, rtinstance->GetExportList()) {
            export_list.push_back(rtarget.GetExtCommunity());
        }
    }

    // Replicate all feasible and non-replicated paths.
    for (Route::PathList::iterator it = rt->GetPathList().begin();
        it != rt->GetPathList().end(); ++it) {
        BgpPath *path = static_cast<BgpPath *>(it.operator->());

        // Skip if the source peer is down.
        if (!path->IsStale() && !path->IsLlgrStale() && path->GetPeer() &&
                !path->GetPeer()->IsReady())
            continue;

        // No need to replicate the replicated path.
        if (path->IsReplicated())
            continue;

        // Do not replicate non-ecmp paths.
        if (rt->BestPath()->PathCompare(*path, true))
            break;

        const BgpAttr *attr = path->GetAttr();
        const ExtCommunity *ext_community = attr->ext_community();

        ExtCommunityPtr extcomm_ptr =
          UpdateExtCommunity(server(), rtinstance, ext_community, export_list);
        ext_community = extcomm_ptr.get();
        if (!ext_community)
            continue;

        // Go through all extended communities.
        //
        // Get the vn_index from the OriginVn extended community.
        // For each RouteTarget extended community, get the list of tables
        // to which we need to replicate the path.
        int vn_index = 0;
        RtGroup::RtGroupMemberList secondary_tables;
        BOOST_FOREACH(const ExtCommunity::ExtCommunityValue &comm,
                      ext_community->communities()) {
            if (ExtCommunity::is_origin_vn(comm)) {
                OriginVn origin_vn(comm);
                vn_index = origin_vn.vn_index();
            } else if (ExtCommunity::is_route_target(comm)) {
                RtGroup *group =
                    server()->rtarget_group_mgr()->GetRtGroup(comm);
                if (!group)
                    continue;
                RtGroup::RtGroupMemberList import_list =
                    group->GetImportTables(family());
                if (import_list.empty())
                    continue;
                secondary_tables.insert(import_list.begin(), import_list.end());
            }
        }

        // Skip if we don't need to replicate the path to any tables.
        if (secondary_tables.empty())
            continue;

        // Add OriginVn when replicating self-originated routes from a VRF.
        if (!vn_index && !rtinstance->IsMasterRoutingInstance() &&
            path->IsVrfOriginated() && rtinstance->virtual_network_index()) {
            vn_index = rtinstance->virtual_network_index();
            OriginVn origin_vn(server_->autonomous_system(), vn_index);
            extcomm_ptr = server_->extcomm_db()->ReplaceOriginVnAndLocate(
                extcomm_ptr.get(), origin_vn.GetExtCommunity());
        }

        // Replicate path to all destination tables.
        BOOST_FOREACH(BgpTable *dest, secondary_tables) {
            // Skip if destination is same as source table.
            if (dest == table)
                continue;

            const RoutingInstance *dest_rtinstance = dest->routing_instance();
            ExtCommunityPtr new_extcomm_ptr = extcomm_ptr;

            // If the origin vn is unresolved, see if route has a RouteTarget
            // that's in the set of export RouteTargets for the dest instance.
            // If so, we set the origin vn for the replicated route to be the
            // vn for the dest instance.
            if (!vn_index && dest_rtinstance->virtual_network_index() &&
                dest_rtinstance->HasExportTarget(ext_community)) {
                int dest_vn_index = dest_rtinstance->virtual_network_index();
                OriginVn origin_vn(server_->autonomous_system(), dest_vn_index);
                new_extcomm_ptr =
                        server_->extcomm_db()->ReplaceOriginVnAndLocate(
                                extcomm_ptr.get(), origin_vn.GetExtCommunity());
            }

            // Replicate the route to the destination table.  The destination
            // table may decide to not replicate based on it's own policy e.g.
            // multicast routes are never leaked across routing-instances.
            BgpRoute *replicated_rt = dest->RouteReplicate(
                server_, table, rt, path, new_extcomm_ptr);
            if (!replicated_rt)
                continue;

            // Add information about the secondary path to the replicated path
            // list.
            RtReplicated::SecondaryRouteInfo rtinfo(dest, path->GetPeer(),
                path->GetPathId(), path->GetSource(), replicated_rt);
            pair<RtReplicated::ReplicatedRtPathList::iterator, bool> result;
            result = replicated_path_list.insert(rtinfo);
            assert(result.second);
            RPR_TRACE_ONLY(Replicate, table->name(), rt->ToString(),
                           path->ToString(),
                           BgpPath::PathIdString(path->GetPathId()),
                           dest->name(), replicated_rt->ToString());
        }
    }

    // Update the DBState to reflect the new list of secondary paths. The
    // DBState will get cleared if the list is empty.
    DBStateSync(table, ts, rt, dbstate, &replicated_path_list);
    return true;
}

const RtReplicated *RoutePathReplicator::GetReplicationState(
        BgpTable *table, BgpRoute *rt) const {
    const TableState *ts = FindTableState(table);
    if (!ts)
        return NULL;
    RtReplicated *dbstate =
        static_cast<RtReplicated *>(rt->GetState(table, ts->listener_id()));
    return dbstate;
}

//
// Return the list of secondary table names for the given primary path.
//
vector<string> RoutePathReplicator::GetReplicatedTableNameList(
    const BgpTable *table, const BgpRoute *rt, const BgpPath *path) const {
    const TableState *ts = FindTableState(table);
    if (!ts)
        return vector<string>();
    const RtReplicated *dbstate = static_cast<const RtReplicated *>(
        rt->GetState(table, ts->listener_id()));
    if (!dbstate)
        return vector<string>();
    return dbstate->GetTableNameList(path);
}

void RoutePathReplicator::DeleteSecondaryPath(BgpTable *table, BgpRoute *rt,
    const RtReplicated::SecondaryRouteInfo &rtinfo) {
    BgpRoute *rt_secondary = rtinfo.rt_;
    BgpTable *secondary_table = rtinfo.table_;
    const IPeer *peer = rtinfo.peer_;
    uint32_t path_id = rtinfo.path_id_;
    BgpPath::PathSource src = rtinfo.src_;

    assert(rt_secondary->RemoveSecondaryPath(rt, src, peer, path_id));
    DBTablePartBase *partition =
        secondary_table->GetTablePartition(rt_secondary);
    if (rt_secondary->count() == 0) {
        RPR_TRACE_ONLY(Flush, secondary_table->name(), rt_secondary->ToString(),
                       peer ? peer->ToString() : "Nil",
                       BgpPath::PathIdString(path_id), table->name(),
                       rt->ToString(), "Delete");
        partition->Delete(rt_secondary);
    } else {
        partition->Notify(rt_secondary);
        RPR_TRACE_ONLY(Flush, secondary_table->name(), rt_secondary->ToString(),
                       peer ? peer->ToString() : "Nil",
                       BgpPath::PathIdString(path_id), table->name(),
                       rt->ToString(), "Path update");
    }
}

string RtReplicated::SecondaryRouteInfo::ToString() const {
    ostringstream out;
    out << table_->name() << "(" << table_ << ")" << ":" <<
        peer_->ToString() << "(" << peer_ << ")" << ":" <<
        rt_->ToString() << "(" << rt_ << ")";
    return out.str();
}


text:
#ifndef CH_INCLUDE_GUARD_98DE2924_91FE_4315_BBFD_5BA0F8C2DCF0
#define CH_INCLUDE_GUARD_98DE2924_91FE_4315_BBFD_5BA0F8C2DCF0

#include <msgpack.h>
#include <string>
#include <memory>

namespace chimp {
namespace ml {
namespace model {

class AbstractModelResult {
    public:
        virtual ~AbstractModelResult();
        virtual msgpack_sbuffer *ToMessagePack() = 0;
};

class AbstractModelInput {
    public:
        virtual ~AbstractModelInput();
        virtual int FromMessagePack(const msgpack_object *msg) = 0;
};

class AbstractModel {
    public:
        virtual ~AbstractModel();
        const std::string &GetName() const { return name_; };
        void SetName(std::string name) { name_ = name; };
        virtual int Build(const AbstractModelInput *input) = 0;
        virtual std::shared_ptr<AbstractModelResult> Predict(const AbstractModelInput *input) const = 0;
    protected:
        std::string name_;
};

}; // namespace model
}; // namespace ml
}; // namespace chimp

#endif /* end of include guard */


text:
package org.keycloak.models.sessions.infinispan.entities.wildfly;

import org.keycloak.models.cache.infinispan.events.ClientTemplateEvent;

public class ClientTemplateEventWFExternalizer extends InfinispanExternalizerAdapter<ClientTemplateEvent> {

    public ClientTemplateEventWFExternalizer() {
        super(ClientTemplateEvent.class, new ClientTemplateEvent.ExternalizerImpl());
    }
}


text:
package types

import (
	"testing"
	"time"

	"go.skia.org/infra/go/deepequal/assertdeep"
)

func TestCopyTaskComment(t *testing.T) {
	v := MakeTaskComment(1, 1, 1, 1, time.Now())
	deleted := true
	v.Deleted = &deleted
	assertdeep.Copy(t, v, v.Copy())
}

func TestCopyTaskSpecComment(t *testing.T) {
	v := MakeTaskSpecComment(1, 1, 1, time.Now())
	v.Flaky = true
	v.IgnoreFailure = true
	deleted := true
	v.Deleted = &deleted
	assertdeep.Copy(t, v, v.Copy())
}

func TestCopyCommitComment(t *testing.T) {
	v := MakeCommitComment(1, 1, 1, time.Now())
	v.IgnoreFailure = true
	deleted := true
	v.Deleted = &deleted
	assertdeep.Copy(t, v, v.Copy())
}

func TestCopyRepoComments(t *testing.T) {
	v := &RepoComments{
		Repo: "r1",
		TaskComments: map[string]map[string][]*TaskComment{
			"c1": {
				"n1": {MakeTaskComment(1, 1, 1, 1, time.Now())},
			},
		},
		TaskSpecComments: map[string][]*TaskSpecComment{
			"n1": {MakeTaskSpecComment(1, 1, 1, time.Now())},
		},
		CommitComments: map[string][]*CommitComment{
			"c1": {MakeCommitComment(1, 1, 1, time.Now())},
		},
	}
	assertdeep.Copy(t, v, v.Copy())
}


text:
package plugin // import "github.com/docker/infrakit/pkg/plugin"

import (
	"encoding/json"
	"testing"

	"github.com/docker/infrakit/pkg/types"
	"github.com/stretchr/testify/require"
)

func TestGetLookupAndType(t *testing.T) {

	ref := Name("instance-file")
	lookup, instanceType := ref.GetLookupAndType()
	require.Equal(t, "instance-file", lookup)
	require.Equal(t, "", instanceType)

	ref = Name("instance-file/json")
	lookup, instanceType = ref.GetLookupAndType()
	require.Equal(t, "instance-file", lookup)
	require.Equal(t, "json", instanceType)

	ref = Name("instance-file/text/html")
	lookup, instanceType = ref.GetLookupAndType()
	require.Equal(t, "instance-file", lookup)
	require.Equal(t, "text/html", instanceType)
}

type testSpec2 struct {
	Plugin Name `json:"plugin"`
}

type testSpec struct {
	Plugin Name      `json:"plugin"`
	Nested testSpec2 `json:"nested"`
}

func TestMarshalUnmarshal(t *testing.T) {

	spec := testSpec{}

	err := json.Unmarshal([]byte(`{  "plugin" : "instance-file/json" }`), &spec)
	require.NoError(t, err)
	require.Equal(t, "instance-file/json", spec.Plugin.String())

	err = json.Unmarshal([]byte(`{  "plugin" : "instance-file" }`), &spec)
	require.NoError(t, err)
	require.Equal(t, "instance-file", spec.Plugin.String())

	err = json.Unmarshal([]byte(`{  "plugin" : 100 }`), &spec)
	require.Error(t, err)
	require.Equal(t, "bad-format-for-name:100", err.Error())

	err = json.Unmarshal([]byte(`{  "plugin" : "instance-file", "nested" : { "plugin": "instance-file/nested"} }`), &spec)
	require.NoError(t, err)
	require.Equal(t, "instance-file", spec.Plugin.String())
	require.Equal(t, "instance-file/nested", spec.Nested.Plugin.String())

	// marshal

	spec.Plugin = Name("instance-file/text")
	buff, err := json.Marshal(spec)
	require.NoError(t, err)
	require.Equal(t, `{"plugin":"instance-file/text","nested":{"plugin":"instance-file/nested"}}`, string(buff))

	// marshal using Any

	complex := map[string]interface{}{
		"Plugin": Name("top"),
		"Properties": types.AnyValueMust(testSpec{
			Plugin: Name("test-plugin1"),
			Nested: testSpec2{
				Plugin: Name("nested1"),
			},
		}),
	}

	any := types.AnyValueMust(complex)

	parsed := map[string]interface{}{}
	err = json.Unmarshal(any.Bytes(), &parsed)
	require.NoError(t, err)

	require.Equal(t, "top", parsed["Plugin"])
	require.Equal(t, "nested1", parsed["Properties"].(map[string]interface{})["nested"].(map[string]interface{})["plugin"])
}


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 wvlet.airframe.rx

/**
  * Observable event types. http://reactivex.io/documentation/observable.html
  */
sealed trait RxEvent

case class OnNext(v: Any)        extends RxEvent
case class OnError(e: Throwable) extends RxEvent
case object OnCompletion         extends RxEvent


text:
package io.quarkus.arc.test.unused;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.logging.Formatter;
import java.util.logging.LogRecord;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.UnsatisfiedResolutionException;
import javax.enterprise.inject.spi.CDI;

import org.jboss.logmanager.formatters.PatternFormatter;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.arc.impl.ArcContainerImpl;
import io.quarkus.test.QuarkusUnitTest;

public class ArcLookupProblemDetectedTest {

    @RegisterExtension
    static final QuarkusUnitTest config = new QuarkusUnitTest()
            .withApplicationRoot(root -> root
                    .addClasses(Alpha.class))
            .setLogRecordPredicate(log -> ArcContainerImpl.class.getPackage().getName().equals(log.getLoggerName()))
            .assertLogRecords(records -> {
                LogRecord warning = records.stream()
                        .filter(l -> l.getMessage().contains("programmatic lookup problem detected")).findAny().orElse(null);
                assertNotNull(warning);
                Formatter fmt = new PatternFormatter("%m");
                String message = fmt.format(warning);
                assertTrue(message.contains(
                        "Stack frame: io.quarkus.arc.test.unused.ArcLookupProblemDetectedTest"),
                        message);
                assertTrue(message.contains(
                        "Required type: class io.quarkus.arc.test.unused.ArcLookupProblemDetectedTest$Alpha"),
                        message);
            });

    @Test
    public void testWarning() {
        // Note that the warning is only displayed once, subsequent calls use a cached result
        assertThrows(UnsatisfiedResolutionException.class, () -> CDI.current().select(Alpha.class).get());
    }

    // unused bean, will be removed
    @ApplicationScoped
    static class Alpha {

        public String ping() {
            return "ok";
        }

    }

}


text:
package workbench.gui.dbobjects;

import java.util.HashSet;
import java.util.Set;
import workbench.gui.components.WbSplitPane;
import workbench.interfaces.Resettable;

/**
 * @author Thomas Kellerer
 */
public class ResettableSplitPane
	extends WbSplitPane
	implements Resettable
{
	private Set<Resettable> clients = new HashSet<>();

	public ResettableSplitPane(int type)
	{
		super(type);
	}

	public void addClient(Resettable r)
	{
		clients.add(r);
	}

	public void reset()
	{
		for (Resettable r : clients)
		{
			r.reset();
		}
	}

}


text:
<?php

namespace Portal\Controller;

/**
 * Importación de librerías
 */
use Zend\Mvc\Controller\AbstractActionController;

/**
 * Define el objeto que permite la interacción
 * entre el modelo y la vista asociadas.
 *
 * Contiene funciones específicas para el funcionamiento
 * adecuado de la clase controladora.
 */
class AseguradoraController extends AbstractActionController
{
    /**
     * Almacena la clase para referencia
     * de base de datos y sobrecarga el tableGateway
     *
     * @return object|bool $aseguradoraDao
     */
    protected $aseguradoraDao;

    /**
     * Almacena la clase para referencia
     * de base de datos y sobrecarga el tableGateway
     *
     * @return object|bool $clienteDao
     */
    protected $clienteDao;

    /**
     * Action: Muestra el total de registros del objeto
     *
     * @return array
     */
    public function perfilAction()
    {
        $aseguradora = (int) $_SESSION['Zend_Auth']['storage']->aseguradora_ase_id;
        // Registra la ruta de navegacion del usuario en el layout
        /* $this->layout()->setVariables(array(
            'ruta' => array(
                'modulo' => 'recursos',
                'padre' => 'cargos'
            )
        )); */

        /* echo '<pre>';
        print_r($this->getAseguradoraClienteDao()->traerClientesActivosAseguradora($aseguradora));
        echo '</pre>';

        die(); */

        return array(
            'aseguradora' => $this->getAseguradoraDao()->traer($aseguradora),
            'clientes' => $this->getAseguradoraClienteDao()->traerClientesActivosAseguradora($aseguradora)
        );
    }

    /**
     * Obtiene el objeto registrado en el service manager
     * de la clase module (Application)
     *
     * @return object|bool
     */
    private function getAseguradoraDao()
    {
        if (! $this->aseguradoraDao) {
            $sm = $this->getServiceLocator();
            $this->aseguradoraDao = $sm->get('Application\Model\Dao\AseguradoraDao');
        }
        return $this->aseguradoraDao;
    }

    /**
     * Obtiene el objeto registrado en el service manager
     * de la clase module (Application)
     *
     * @return object|bool
     */
    private function getClienteDao()
    {
        if (! $this->clienteDao) {
            $sm = $this->getServiceLocator();
            $this->clienteDao = $sm->get('Application\Model\Dao\ClienteDao');
        }
        return $this->clienteDao;
    }

    /**
     * Obtiene el objeto registrado en el service manager
     * de la clase module (Application)
     *
     * @return object|bool
     */
    private function getAseguradoraClienteDao()
    {
        if (! $this->aseguradoraClienteDao) {
            $sm = $this->getServiceLocator();
            $this->aseguradoraClienteDao = $sm->get('Application\Model\Dao\AseguradoraClienteDao');
        }
        return $this->aseguradoraClienteDao;
    }

}


text:
//
//  BIDJsonToDictionary.h
//  Dessert_v1
//
//  Created by fengxi on 14-12-6.
//  Copyright (c) 2014年 KeithMorning. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface BIDJsonToDictionary : NSObject
/*!
 * @brief 把格式化的JSON格式的字符串转换成字典
 * @param jsonString JSON格式的字符串
 * @return 返回字典
 */
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;

@end


text:
"""
    bubble_sort.py

    Implementation of bubble sort on a list and returns a sorted list.

    Bubble Sort Overview:
    ---------------------
    A naive sorting that compares and swaps adjacent elements

    Time Complexity: O(n**2)

    Space Complexity: O(1) Auxiliary

    Stable: Yes

    Psuedo code: http://en.wikipedia.org/wiki/Bubble_sort

"""

def sort(seq):
    L = len(seq)
    for _ in range(L):
        for n in range(1, L):
            if seq[n] < seq[n - 1]:
                seq[n - 1], seq[n] = seq[n], seq[n - 1]
        yield seq


text:
import 'core-js/es/object/assign';
import 'customPolyfill';
import { Utils } from 'utils';

// Assign stuff to global context
window.Utils = Utils;

// Require few other libraries
require('bootstrap');

// -- BASE --
// import init from './base/js/default.js';
// init($);

// Export all
export {
    Utils,
};


text:
package com.ser.exception;

/**
 * Created by Brad
 * on 5/18/2016.
 */
public class GenericException extends Exception{
    public static int GENERAL_ERROR = 0;
    public static int CLASS_NOT_FOUND = 1;
    private static int NUM_OF_ERROR_TYPES = 2;

    private int type = 0;

    public GenericException(){
        super();
    }

    public GenericException(String message) {
        super(message);
    }

    public GenericException(String message, Throwable cause) {
        super(message, cause);
    }

    public GenericException(Throwable cause) {
        super(cause);
    }

    protected GenericException(String message, Throwable cause,
                        boolean enableSuppression,
                        boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public GenericException(String message, int type) {
        super(message);
        initializeType(type);
    }

    public GenericException(String message, Throwable cause, int type) {
        super(message, cause);
        initializeType(type);
    }

    public GenericException(Throwable cause, int type) {
        super(cause);
        initializeType(type);
    }

    protected GenericException(String message, Throwable cause,
                               boolean enableSuppression,
                               boolean writableStackTrace, int type) {
        super(message, cause, enableSuppression, writableStackTrace);
        initializeType(type);
    }

    private void initializeType(int type){
        if(type >= 0 && type < NUM_OF_ERROR_TYPES) {
            this.type = type;
        } else{
            this.type = 0;
        }
    }

    public int getType(){
        return type;
    }
}


text:
Upcoming Fixtures

    <app-loader [loading]="loading" class="text-center"></app-loader>

                Date
                Home Team
                vs.
                Away Team

                {{singleFixture.date | date: 'medium'}}
                {{singleFixture.homeTeamName}}
                -
                {{singleFixture.awayTeamName}}


text:
using UnityEngine;

namespace Heartcatch
{
    public static class Utility
    {
        public const string AssetBundlesOutputPath = "AssetBundles";
        public const string AssetBundleSimulationMode = "__assetBundleSimulation";
        public const string GameConfigResource = "GameConfig";
        public const string RunnerResource = "Runner";

        public static string GetPlatformName()
        {
            return GetPlatformForAssetBundles(Application.platform);
        }

        private static string GetPlatformForAssetBundles(RuntimePlatform platform)
        {
            switch (platform)
            {
                case RuntimePlatform.Android:
                    return "Android";
                case RuntimePlatform.IPhonePlayer:
                    return "iOS";
                case RuntimePlatform.tvOS:
                    return "tvOS";
                case RuntimePlatform.WebGLPlayer:
                    return "WebGL";
                case RuntimePlatform.WindowsPlayer:
                case RuntimePlatform.WindowsEditor:
                    return "Windows";
                case RuntimePlatform.OSXEditor:
                case RuntimePlatform.OSXPlayer:
                    return "OSX";
                case RuntimePlatform.LinuxPlayer:
                case RuntimePlatform.LinuxEditor:
                    return "Linux";

                // Add more build targets for your own.
                // If you add more targets, don't forget to add the same platforms to GetPlatformForAssetBundles(RuntimePlatform) function.
                default:
                    return null;
            }
        }
    }
}


text:
The specific design details of LPR3 based on Clinical Document Architecture (CDA) is documented at [ART-DECOR](http://lpr-art-decor.westeurope.cloudapp.azure.com:8080/art-decor/decor-project--lpr-)

## HTTP status codes
The XDR endpoints are build on SOAP 1.2 and as such any LPR XDR client should interpret HTTP status code as defined [SOAP Version 1.2 Part 2: Adjuncts (Second Edition)](https://www.w3.org/TR/soap12-part2/) section 7.5.1.2

> The SOAP HTTP binding follows the rules of any HTTP application which means that an implementation of the SOAP HTTP binding must understand the class of any status code, as indicated by the first digit, and treat any unrecognized response as being equivalent to the x00 status code of that class, with the exception that an unrecognized response must not be cached.

The following HTTP status codes in addition to table 17 of [SOAP Version 1.2 Part 2: Adjuncts (Second Edition)](https://www.w3.org/TR/soap12-part2/) SHOULD be recognized by a LPR XDR client.

### 100 Continue
The 100 (Continue) status code indicates that the initial part of a request has been received and has not yet been rejected by the server.  The server intends to send a final response after the request has been fully received and acted upon.

### 403 Forbidden
The 403 (Forbidden) status code indicates that the server understood the request but refuses to authorize it.

### 404 Not Found
The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

### 406 Not Acceptable
The 406 (Not Acceptable) status code indicates that the target resource does not have a current representation that would be acceptable to the user agent.

### 413 Payload Too Large
The 413 (Payload Too Large) status code indicates that the server is refusing to process a request because the request payload is larger than the server is willing or able to process.

### 501 Not Implemented
The 501 (Not Implemented) status code indicates that the server does not support the functionality required to fulfill the request.

### 503 Service Unavailable
The 503 (Service Unavailable) status code indicates that the server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.

## IHE XDR WSDL with national SSI additions
The following section shows the IHE XDR WSDL with the danish national SSI additions.

The raw WSDL file can be found [here](wsdl/ihe-xdr.wsdl).

```xml
<?xml version='1.0' encoding='UTF-8'?>

<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
             xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
             xmlns:medcom="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd"
             xmlns:ihe="urn:ihe:iti:xds-b:2007"
             xmlns:hsuid="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
             name="DocumentRepository"
             targetNamespace="urn:ihe:iti:xds-b:2007">

    <documentation>IHE XDR Service with national SSI additions
    </documentation>
    <types>

        <!-- Danish national extensions start -->

        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
                    xmlns:medcom="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd"
                    xmlns:ihe="urn:ihe:iti:xds-b:2007" xmlns:hsuid="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd"
                    xmlns="http://schemas.xmlsoap.org/wsdl/"
                    targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <xsd:include
                schemaLocation="xsd/dgws/wsse.xsd"/>

        </xsd:schema>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
                    xmlns:medcom="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd"
                    xmlns:ihe="urn:ihe:iti:xds-b:2007" xmlns:hsuid="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd"
                    xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:oasis:names:tc:SAML:2.0:assertion">
            <xsd:include
                schemaLocation="xsd/dgws/saml.xsd"/>

        </xsd:schema>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
                    xmlns:medcom="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd"
                    xmlns:ihe="urn:ihe:iti:xds-b:2007" xmlns:hsuid="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd"
                    xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd">
            <xsd:include
                schemaLocation="xsd/dgws/medcom.xsd"/>

        </xsd:schema>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
                    xmlns:medcom="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd"
                    xmlns:ihe="urn:ihe:iti:xds-b:2007" xmlns:hsuid="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd"
                    xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd">
            <xsd:include
                schemaLocation="xsd/hsuid/hsuid-1_1.xsd"/>

            <!-- Danish national extensions stop -->

        </xsd:schema>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
                    xmlns:medcom="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd"
                    xmlns:ihe="urn:ihe:iti:xds-b:2007" xmlns:hsuid="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd"
                    xmlns="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified"
                    targetNamespace="urn:ihe:iti:xds-b:2007">
            <xsd:include
                schemaLocation="xsd/IHE/XDS.b_DocumentRepository.xsd"/>

        </xsd:schema>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
                    xmlns:medcom="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd"
                    xmlns:ihe="urn:ihe:iti:xds-b:2007" xmlns:hsuid="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd"
                    xmlns="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified"
                    targetNamespace="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0">
            <xsd:include
                schemaLocation="xsd/ebRS/rs.xsd"/>

        </xsd:schema>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
                    xmlns:medcom="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd"
                    xmlns:ihe="urn:ihe:iti:xds-b:2007" xmlns:hsuid="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd"
                    xmlns="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified"
                    targetNamespace="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">
            <xsd:include
                schemaLocation="xsd/ebRS/query.xsd"/>

        </xsd:schema>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
                    xmlns:medcom="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd"
                    xmlns:ihe="urn:ihe:iti:xds-b:2007"
                    xmlns:hsuid="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd" xmlns="http://schemas.xmlsoap.org/wsdl/"
                    elementFormDefault="qualified" targetNamespace="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0">
            <xsd:include
                schemaLocation="xsd/ebRS/lcm.xsd"/>

        </xsd:schema>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
                    xmlns:medcom="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd"
                    xmlns:ihe="urn:ihe:iti:xds-b:2007"
                    xmlns:hsuid="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd" xmlns="http://schemas.xmlsoap.org/wsdl/"
                    elementFormDefault="qualified" targetNamespace="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
            <xsd:include
                schemaLocation="xsd/ebRS/rim.xsd"/>

        </xsd:schema>

    </types>
    <message name="SecurityHeader">
        <part element="wsse:Security" name="security_header">
        </part>
    </message>
    <message name="MedcomHeader">
        <part element="medcom:Header" name="medcom_header">
        </part>
    </message>
    <message name="ProvideAndRegisterDocumentSet-b_Message">
        <documentation>Provide and Register Document Set</documentation>
        <part element="ihe:ProvideAndRegisterDocumentSetRequest" name="body"></part>
    </message>
    <message name="ProvideAndRegisterDocumentSet-bResponse_Message">
        <documentation>Provide And Register Document Set Response
        </documentation>
        <part element="rs:RegistryResponse" name="body"></part>
    </message>
    <message name="HsuidHeader">
        <part element="hsuid:HsuidHeader" name="hsuid_header">
        </part>
    </message>
    <portType name="DocumentRepository_PortType">
        <operation name="DocumentRepository_ProvideAndRegisterDocumentSet-b">
            <input message="ihe:ProvideAndRegisterDocumentSet-b_Message"
                   wsaw:Action="urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b"></input>
            <output message="ihe:ProvideAndRegisterDocumentSet-bResponse_Message"
                    wsaw:Action="urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-bResponse"></output>
        </operation>
    </portType>
    <binding name="DocumentRepository_Binding" type="ihe:DocumentRepository_PortType">
        <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="DocumentRepository_ProvideAndRegisterDocumentSet-b">
            <soap12:operation soapAction="urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b"></soap12:operation>
            <input>
                <soap12:header message="ihe:SecurityHeader" part="security_header"
                               use="literal"></soap12:header>
                <soap12:header message="ihe:MedcomHeader" part="medcom_header"
                               use="literal"></soap12:header>
                <soap12:header message="ihe:HsuidHeader" part="hsuid_header"
                               use="literal"></soap12:header>
                <soap12:body use="literal"></soap12:body>
            </input>
            <output>
                <soap12:header message="ihe:MedcomHeader" part="medcom_header"
                               use="literal"></soap12:header>
                <soap12:body use="literal"></soap12:body>
            </output>
        </operation>
    </binding>
    <service name="DocumentRepository_Service">
        <port name="DocumentRepository_Port_Soap12" binding="ihe:DocumentRepository_Binding">
            <soap:address location="https://lprws.sds.dsdn.dk/cda-ws/DocumentRepository_Service/PatientHealthcareReportingService"/>
        </port>
    </service>
</definitions>
```