text:
#ifndef HALIDE_CODEGEN_H
#define HALIDE_CODEGEN_H

/** \file
 *
 * Defines the base-class for all architecture-specific code
 * generators that use llvm.
 */

namespace llvm {
class Value;
class Module;
class Function;
template<bool> class IRBuilderDefaultInserter;
class ConstantFolder;
template<bool, typename, typename> class IRBuilder;
class LLVMContext;
class Type;
class StructType;
class Instruction;
class CallInst;
class ExecutionEngine;
class AllocaInst;
class Constant;
class Triple;
class MDNode;
}

#include <map>
#include <stack>
#include <string>
#include <vector>

#include "IRVisitor.h"
#include "Argument.h"
#include "IR.h"
#include "Scope.h"
#include "JITCompiledModule.h"
#include "ModulusRemainder.h"
#include "Target.h"

namespace Halide {
namespace Internal {

/** A code generator abstract base class. Actual code generators
 * (e.g. CodeGen_X86) inherit from this. This class is responsible
 * for taking a Halide Stmt and producing llvm bitcode, machine
 * code in an object file, or machine code accessible through a
 * function pointer.
 */
class CodeGen : public IRVisitor {
public:
    mutable RefCount ref_count;

    CodeGen(Target t);
    virtual ~CodeGen();

    /** Take a halide statement and compiles it to an llvm module held
     * internally. Call this before calling compile_to_bitcode or
     * compile_to_native. */
    virtual void compile(Stmt stmt, std::string name,
                         const std::vector<Argument> &args,
                         const std::vector<Buffer> &images_to_embed);

    /** Emit a compiled halide statement as llvm bitcode. Call this
     * after calling compile. */
    virtual void compile_to_bitcode(const std::string &filename);

    /** Emit a compiled halide statement as either an object file, or
     * as raw assembly, depending on the value of the second
     * argument. Call this after calling compile. */
    virtual void compile_to_native(const std::string &filename, bool assembly = false);

    /** Compile to machine code stored in memory, and return some
     * functions pointers into that machine code. */
    JITCompiledModule compile_to_function_pointers();

    /** What should be passed as -mcpu, -mattrs, and related for
     * compilation. The architecture-specific code generator should
     * define these. */
    // @{
    virtual std::string mcpu() const = 0;
    virtual std::string mattrs() const = 0;
    virtual bool use_soft_float_abi() const = 0;
    // @}

    // What's the natural vector bit-width to use for loads, stores, etc.
    // @{
    virtual int native_vector_bits() const = 0;
    // @}

    /** Do any required target-specific things to the execution engine
     * and the module prior to jitting. Called by JITCompiledModule
     * just before it jits. Does nothing by default. */
    virtual void jit_init(llvm::ExecutionEngine *, llvm::Module *) {}

    /** Do any required target-specific things to the execution engine
     * and the module after jitting. Called by JITCompiledModule just
     * after it jits. Does nothing by default. The third argument
     * gives the target a chance to inject calls to target-specific
     * module cleanup routines. */
    virtual void jit_finalize(llvm::ExecutionEngine *, llvm::Module *,
                              std::vector<JITCompiledModule::CleanupRoutine> *);

    /** Initialize internal llvm state for the enabled targets. */
    static void initialize_llvm();

    /** Which built-in functions require a user-context first argument? */
    static bool function_takes_user_context(const std::string &name);

protected:

    /** State needed by llvm for code generation, including the
     * current module, function, context, builder, and most recently
     * generated llvm value. */
    //@{
    static bool llvm_initialized;
    static bool llvm_X86_enabled;
    static bool llvm_ARM_enabled;
    static bool llvm_AArch64_enabled;
    static bool llvm_NVPTX_enabled;
    static bool llvm_Mips_enabled;

    llvm::Module *module;
    bool owns_module;
    llvm::Function *function;
    llvm::LLVMContext *context;
    llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> > *builder;
    llvm::Value *value;
    llvm::MDNode *very_likely_branch;
    //@}

    /** The target we're generating code for */
    Halide::Target target;

    /** Initialize the CodeGen internal state to compile a fresh
     * module. This allows reuse of one CodeGen object to compiled
     * multiple related modules (e.g. multiple device kernels). */
    void init_module();

    /** Run all of llvm's optimization passes on the module. */
    void optimize_module();

    /** Add an entry to the symbol table, hiding previous entries with
     * the same name. Call this when new values come into scope. */
    void sym_push(const std::string &name, llvm::Value *value);

    /** Remove an entry for the symbol table, revealing any previous
     * entries with the same name. Call this when values go out of
     * scope. */
    void sym_pop(const std::string &name);

    /** Fetch an entry from the symbol table. If the symbol is not
     * found, it either errors out (if the second arg is true), or
     * returns NULL. */
    llvm::Value* sym_get(const std::string &name,
                         bool must_succeed = true) const;

    /** Test if an item exists in the symbol table. */
    bool sym_exists(const std::string &name) const;

    /** Some useful llvm types */
    // @{
    llvm::Type *void_t, *i1, *i8, *i16, *i32, *i64, *f16, *f32, *f64;
    llvm::StructType *buffer_t_type;
    // @}

    /** The name of the function being generated. */
    std::string function_name;

    /** Emit code that evaluates an expression, and return the llvm
     * representation of the result of the expression. */
    llvm::Value *codegen(Expr);

    /** Emit code that runs a statement. */
    void codegen(Stmt);

    /** Codegen a vector Expr by codegenning each lane and combining. */
    void scalarize(Expr);

    /** Take an llvm Value representing a pointer to a buffer_t,
     * and populate the symbol table with its constituent parts.
     */
    void unpack_buffer(std::string name, llvm::Value *buffer);

    /** Add a definition of buffer_t to the module if it isn't already there. */
    void define_buffer_t();

    /** Codegen an assertion. If false, it bails out and calls the
     * error handler. Either set message to non-NULL *or* pass a
     * vector of Expr arguments to print.  */
    // @{
    void create_assertion(llvm::Value *condition, Expr message);
    void create_assertion(llvm::Value *condition, const char *message) {
        create_assertion(condition, StringImm::make(message));
    }
    // @}

    /** Put a string constant in the module as a global variable and return a pointer to it. */
    llvm::Constant *create_string_constant(const std::string &str);

    /** Put a binary blob in the module as a global variable and return a pointer to it. */
    llvm::Constant *create_constant_binary_blob(const std::vector<char> &data, const std::string &name);

    /** Widen an llvm scalar into an llvm vector with the given number of lanes. */
    llvm::Value *create_broadcast(llvm::Value *, int width);

    /** Given an llvm value representing a pointer to a buffer_t, extract various subfields.
     * The *_ptr variants return a pointer to the struct element, while the basic variants
     * load the actual value. */
    // @{
    llvm::Value *buffer_host(llvm::Value *);
    llvm::Value *buffer_dev(llvm::Value *);
    llvm::Value *buffer_host_dirty(llvm::Value *);
    llvm::Value *buffer_dev_dirty(llvm::Value *);
    llvm::Value *buffer_min(llvm::Value *, int);
    llvm::Value *buffer_extent(llvm::Value *, int);
    llvm::Value *buffer_stride(llvm::Value *, int);
    llvm::Value *buffer_elem_size(llvm::Value *);
    llvm::Value *buffer_host_ptr(llvm::Value *);
    llvm::Value *buffer_dev_ptr(llvm::Value *);
    llvm::Value *buffer_host_dirty_ptr(llvm::Value *);
    llvm::Value *buffer_dev_dirty_ptr(llvm::Value *);
    llvm::Value *buffer_min_ptr(llvm::Value *, int);
    llvm::Value *buffer_extent_ptr(llvm::Value *, int);
    llvm::Value *buffer_stride_ptr(llvm::Value *, int);
    llvm::Value *buffer_elem_size_ptr(llvm::Value *);
    // @}

    /** Generate a pointer into a named buffer at a given index, of a
     * given type. The index counts according to the scalar type of
     * the type passed in. */
    // @{
    llvm::Value *codegen_buffer_pointer(std::string buffer, Type type, llvm::Value *index);
    llvm::Value *codegen_buffer_pointer(std::string buffer, Type type, Expr index);
    // @}

    /** Mark a load or store with type-based-alias-analysis metadata
     * so that llvm knows it can reorder loads and stores across
     * different buffers */
    void add_tbaa_metadata(llvm::Instruction *inst, std::string buffer, Expr index);

    using IRVisitor::visit;

    /** Generate code for various IR nodes. These can be overridden by
     * architecture-specific code to perform peephole
     * optimizations. The result of each is stored in \ref value */
    // @{
    virtual void visit(const IntImm *);
    virtual void visit(const FloatImm *);
    virtual void visit(const StringImm *);
    virtual void visit(const Cast *);
    virtual void visit(const Variable *);
    virtual void visit(const Add *);
    virtual void visit(const Sub *);
    virtual void visit(const Mul *);
    virtual void visit(const Div *);
    virtual void visit(const Mod *);
    virtual void visit(const Min *);
    virtual void visit(const Max *);
    virtual void visit(const EQ *);
    virtual void visit(const NE *);
    virtual void visit(const LT *);
    virtual void visit(const LE *);
    virtual void visit(const GT *);
    virtual void visit(const GE *);
    virtual void visit(const And *);
    virtual void visit(const Or *);
    virtual void visit(const Not *);
    virtual void visit(const Select *);
    virtual void visit(const Load *);
    virtual void visit(const Ramp *);
    virtual void visit(const Broadcast *);
    virtual void visit(const Call *);
    virtual void visit(const Let *);
    virtual void visit(const LetStmt *);
    virtual void visit(const AssertStmt *);
    virtual void visit(const Pipeline *);
    virtual void visit(const For *);
    virtual void visit(const Store *);
    virtual void visit(const Block *);
    virtual void visit(const IfThenElse *);
    virtual void visit(const Evaluate *);
    // @}

    /** Generate code for an allocate node. It has no default
     * implementation - it must be handled in an architecture-specific
     * way. */
    virtual void visit(const Allocate *) = 0;

    /** Generate code for a free node. It has no default
     * implementation and must be handled in an architecture-specific
     * way. */
    virtual void visit(const Free *) = 0;

    /** These IR nodes should have been removed during
     * lowering. CodeGen will error out if they are present */
    // @{
    virtual void visit(const Provide *);
    virtual void visit(const Realize *);
    // @}

    /** If we have to bail out of a pipeline midway, this should
     * inject the appropriate target-specific cleanup code. */
    virtual void prepare_for_early_exit() {}

    /** Get the llvm type equivalent to the given halide type in the
     * current context. */
    llvm::Type *llvm_type_of(Type);

    /** Perform an alloca at the function entrypoint. Will be cleaned
     * on function exit. */
    llvm::Value *create_alloca_at_entry(llvm::Type *type, int n, const std::string &name = "");

    /** Which buffers came in from the outside world (and so we can't
     * guarantee their alignment) */
    std::set<std::string> might_be_misaligned;

    /** The user_context argument. May be a constant null if the
     * function is being compiled without a user context. */
    llvm::Value *get_user_context() const;

    /** Implementation of the intrinsic call to
     * interleave_vectors. This implementation allows for interleaving
     * an arbitrary number of vectors.*/
    llvm::Value *interleave_vectors(Type, const std::vector<Expr> &);

    /** Generate a call to a vector intrinsic or runtime inlined
     * function. The arguments are sliced up into vectors of the width
     * given by 'intrin_vector_width', the intrinsic is called on each
     * piece, then the results (if any) are concatenated back together
     * into the original type 't'. For the version that takes an
     * llvm::Type *, the type may be void, so the vector width of the
     * arguments must be specified explicitly as
     * 'called_vector_width'. */
    // @{
    llvm::Value *call_intrin(Type t, int intrin_vector_width,
                             const std::string &name, std::vector<Expr>);
    llvm::Value *call_intrin(llvm::Type *t, int intrin_vector_width,
                             const std::string &name, std::vector<llvm::Value *>);
    // @}

    /** Take a slice of lanes out of an llvm vector. Pads with undefs
     * if you ask for more lanes than the vector has. */
    llvm::Value *slice_vector(llvm::Value *vec, int start, int extent);

    /** Concatenate a bunch of llvm vectors. Must be of the same type. */
    llvm::Value *concat_vectors(const std::vector<llvm::Value *> &);

    /** Go looking for a vector version of a runtime function. Will
     * return the best match. Matches in the following order:
     *
     * 1) The requested vector width.
     *
     * 2) The width which is the smallest power of two
     * greater than or equal to the vector width.
     *
     * 3) All the factors of 2) greater than one, in decreasing order.
     *
     * 4) The smallest power of two not yet tried.
     *
     * So for a 5-wide vector, it tries: 5, 8, 4, 2, 16.
     *
     * If there's no match, returns (NULL, 0).
     */
    std::pair<llvm::Function *, int> find_vector_runtime_function(const std::string &name, int width);

private:

    /** All the values in scope at the current code location during
     * codegen. Use sym_push and sym_pop to access. */
    Scope<llvm::Value *> symbol_table;

    /** Alignment info for Int(32) variables in scope. */
    Scope<ModulusRemainder> alignment_info;

    /** String constants already emitted to the module. Tracked to
     * prevent emitting the same string many times. */
    std::map<std::string, llvm::Constant *> string_constants;
};

}}

#endif


text:
using System;
using System.Collections;
using System.Threading;
using Microsoft.Scripting.Hosting;
using IronRuby;
using OpenTK;
using OpenTK.Graphics;
using System.Collections.Generic;
using Microsoft.Scripting;
using OpenTK.Graphics.OpenGL;

namespace OpenRGSS
{
    public class Engine
    {
        private static Engine instance;

        private GameWindow window;
        private Thread gameThread;
        private ScriptEngine rubyEngine;

        private IntroScene introScene;

        private const string RGSSRuntimeSource = @"
            require 'OpenRGSS.Runtime.RGSS'
            include OpenRGSS::Runtime::RGSS

            class Input
	            class << self
		            def press?(num)
			            return pressQM(num.getKey())
		            end
		            def trigger?(num)
			            return triggerQM(num.getKey())
		            end
		            def repeat?(num)
			            return repeatQM(num.getKey())
		            end
	            end
            end

            def load_data(filename)
                File.open(filename, 'rb') { |f|
                    return Marshal.load(f)
                }
            end

            def save_data(obj, filename)
                File.open(filename, 'wb') { |f|
                  Marshal.dump(obj, f)
                }
            end

            def print(msg)
                Engine.Log(msg)
            end
        ";
        private const string ScriptLoaderSource = @"
            load_assembly 'IronRuby.Libraries', 'IronRuby.StandardLibrary.Zlib'

            f = File.open('Data/Scripts.rxdata', 'rb')
            obj = Marshal.load(f)
            for script in obj
                Engine.LoadScript(script[1], Zlib::Inflate.inflate(script[2]))
            end
        ";

        public int Width
        {
            get
            {
                return this.window.Width;
            }
        }

        public int Height
        {
            get
            {
                return this.window.Height;
            }
        }

        public Engine()
        {
            this.SetInstance();

            this.window = new GameWindow(640, 480);
            this.window.Title = "OpenRGSS";
            this.window.Load += LoadWindow;

            this.gameThread = new Thread(this.EngineThreadMain);
            this.introScene = new IntroScene();
        }

        public static Engine GetInstance()
        {
            return Engine.instance;
        }

        protected static void SetInstance(Engine engine)
        {
            Engine.instance = engine;
        }

        protected void SetInstance()
        {
            Engine.SetInstance(this);
        }

        public void Run()
        {
            this.window.Run();
        }

        private void LoadWindow(object sender, System.EventArgs e)
        {
            this.introScene.Log("Init Engine...");

            this.window.Context.MakeCurrent(null);
            this.gameThread.Start();
        }

        protected void EngineThreadMain()
        {
            this.window.MakeCurrent();
            this.InitEngine();
            this.InitScriptEngine();
            this.InitScripts();
        }

        protected void InitEngine()
        {
            GL.Ortho(0.0, Engine.GetInstance().Width, Engine.GetInstance().Height, 0.0, 1000, -1000);
            GL.Enable(EnableCap.Texture2D);
            GL.Enable(EnableCap.Blend);
            GL.BlendFunc(BlendingFactorSrc.SrcAlpha,BlendingFactorDest.OneMinusSrcAlpha);
            GL.ShadeModel(ShadingModel.Smooth);
        }

        protected void InitScriptEngine()
        {
            this.introScene.Log("Init Script Engine...");

            ScriptRuntime runtime = Ruby.CreateRuntime();
            this.rubyEngine = runtime.GetEngine("rb");

            this.rubyEngine.Runtime.Globals.SetVariable("Engine", this);
        }

        protected void InitScripts()
        {
            this.introScene.Log("Init Scripts...");
            this.LoadScript("RGSS Runtime", Engine.RGSSRuntimeSource);
            this.LoadScript("Scripts Loader", Engine.ScriptLoaderSource);
        }

        public void LoadScript(string name, string src)
        {
            ScriptSource source = this.rubyEngine.CreateScriptSourceFromString(src, name, SourceCodeKind.File);

            try
            {
                this.introScene.Log("Load Script (" + name + ")...");
                source.Execute();
            }
            catch (Exception e)
            {
                foreach (DictionaryEntry data in e.Data)
                {
                    if (data.Value is IronRuby.Runtime.RubyExceptionData)
                    {
                        IronRuby.Runtime.RubyExceptionData exData = (IronRuby.Runtime.RubyExceptionData)data.Value;

                        System.Console.WriteLine(exData.Message.ToString());
                        foreach (var ex in exData.Backtrace)
                        {
                            System.Console.WriteLine(ex.ToString());
                        }
                    }
                }

                System.Console.WriteLine("=======================");
                System.Console.Write(e.ToString());
            }
        }

        private long tick = 0;
        private long count = 0;
        private long aCount = 0;

        public void SwapBuffers()
        {
            count++;
            if (System.DateTime.Now.Ticks > tick)
            {
                tick = System.DateTime.Now.Ticks + 10000000;
                aCount = count;
                count = 0;

                this.window.Title = "OpenRGSS - FPS : " + aCount;
            }

            this.window.SwapBuffers();
        }

        public GameWindow GetWindow()
        {
            return this.window;
        }

        public void Log(string msg)
        {
            OpenRGSS.Log.Debug(msg);
        }

        public int GetFrameRate()
        {
            return 60;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.tryicy;

import org.archive.crawler.framework.Engine;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Desc
 * @author: zhangjunwei
 * @Date: 2015年11月3日
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath*:spring-test.xml")
public class SpringCollectorTester extends AbstractJUnit4SpringContextTests{

	private static final Logger logger = LoggerFactory.getLogger(SpringCollectorTester.class);

	@Autowired
	private ApplicationContext appContext;

	@Autowired
	private Engine crawlerEngine;

	@Test
	public void testApplicationContextIsNotNull(){
		Assert.assertNotNull(appContext);
		logger.info("appContext is not null : {}", appContext);
		Assert.assertNotNull(crawlerEngine);
		logger.info("crawlerEngine is not null : {}", crawlerEngine);
	}

}


text:
package org.onosproject.net.behaviour;

import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import org.onlab.packet.DscpClass;
import org.onlab.packet.IPPrecedence;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;

import java.util.Objects;

/**
 * Represents an action to be taken by a marker/policer.
 */
@Beta
public final class BandwidthProfileAction {

    /**
     * Denotes the type of action to be taken.
     */
    public enum Action {
        /**
         * Traffic is allowed to pass unmodified.
         */
        PASS,

        /**
         * Traffic is allowed to pass after being appropriately remarked.
         */
        REMARK,

        /**
         * Traffic is dropped.
         */
        DISCARD
    }

    private final Action action;
    private final DscpClass dscpClass;
    private final IPPrecedence ipPrecedence;
    private final Short dropPrecedence;

    private BandwidthProfileAction(Action action,
                                   DscpClass dscpClass,
                                   IPPrecedence ipPrecedence,
                                   Short dropPrecedence) {
        this.action = action;
        this.dscpClass = dscpClass;
        this.ipPrecedence = ipPrecedence;
        this.dropPrecedence = dropPrecedence;
    }

    /**
     * Obtains the type of this bandwidth profile action object.
     *
     * @return the bandwidth profile action type
     */
    public Action getAction() {
        return this.action;
    }

    /**
     * Obtains the DSCP class corresponding to the REMARK action.
     * If this is not a REMARK action or if another field is remarked
     * null is returned.
     *
     * @return the DSCP class for the action; may be null
     */
    public DscpClass getDscpClass() {
        return this.dscpClass;
    }

    /**
     * Obtains the IP precedence corresponding to the REMARK action.
     * If this is not a REMARK action or if another field is remarked
     * null is returned.
     *
     * @return the IP precedence for the action; may be null
     */
    public IPPrecedence getIpPrecedence() {
        return this.ipPrecedence;
    }

    /**
     * Obtains the drop precedence corresponding to the REMARK action.
     * If this is not a REMARK action or if another field is remarked
     * null is returned.
     *
     * @return the drop precedence for the action; may be null
     */
    public Short getDropPrecedence() {
        return this.dropPrecedence;
    }

    /**
     * Returns a new builder.
     *
     * @return new builder
     */
    public static Builder builder() {
        return new Builder();
    }

    /**
     * Builder of BandwidthProfileAction entities.
     */
    public static final class Builder {

        private Action action;
        private DscpClass dscpClass;
        private IPPrecedence ipPrecedence;
        private Short dropPrecedence;

        /**
         * Sets the type of this builder.
         *
         * @param action the builder type to set
         * @return this builder instance
         */
        public Builder action(Action action) {
            this.action = action;
            return this;
        }

        /**
         * Sets the DSCP class of this builder.
         *
         * @param dscpClass the builder DSCP class to set
         * @return this builder instance
         */
        public Builder dscpClass(DscpClass dscpClass) {
            this.dscpClass = dscpClass;
            return this;
        }

        /**
         * Sets the IP precedence of this builder.
         *
         * @param ipPrecedence the builder IP precedence to set
         * @return this builder instance
         */
        public Builder ipPrecedence(IPPrecedence ipPrecedence) {
            this.ipPrecedence = ipPrecedence;
            return this;
        }

        /**
         * Sets the drop precedence of this builder.
         *
         * @param dropPrecedence the drop IP precedence to set
         * @return this builder instance
         */
        public Builder dropPrecedence(Short dropPrecedence) {
            this.dropPrecedence = dropPrecedence;
            return this;
        }

        /**
         * Builds a new BandwidthProfileAction based on builder's parameters.
         *
         * @return a new BandwidthProfileAction instance
         */
        public BandwidthProfileAction build() {
            checkNotNull(action);
            checkArgument(!action.equals(Action.REMARK) ||
                                  (dscpClass != null ^
                                          ipPrecedence != null ^
                                          dropPrecedence != null),
                          "Exactly one remark type must be defined");
            return new BandwidthProfileAction(action,
                                              dscpClass,
                                              ipPrecedence,
                                              dropPrecedence);
        }
    }

    @Override
    public int hashCode() {
        return Objects.hash(action, dscpClass, ipPrecedence, dropPrecedence);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof BandwidthProfileAction) {
            final BandwidthProfileAction that = (BandwidthProfileAction) obj;
            return this.getClass() == that.getClass() &&
                    Objects.equals(this.action, that.action) &&
                    Objects.equals(this.dscpClass, that.dscpClass) &&
                    Objects.equals(this.ipPrecedence, that.ipPrecedence) &&
                    Objects.equals(this.dropPrecedence, that.dropPrecedence);
        }
        return false;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(getClass())
                .add("action", action == null ? null : action.name())
                .add("dscpClass", dscpClass == null ? null : dscpClass.name())
                .add("ipPrecedence", ipPrecedence)
                .add("dropPrecedence", dropPrecedence)
                .toString();
    }
}


text:
.discrepancy {
  --boxel-revision-light-purple: #84829b;
  --boxel-revision-lightest-purple: var(--boxel-purple-300);
  --boxel-revision-hover-purple: #4f4a5d;
  --disc-container-max-width: 1440px;
  --disc-header-height: 80px;
  --disc-footer-cta-height: 90px;
  --disc-footer-cta-height-lg: 150px;

  height: 100%;
  background-color: var(--boxel-purple-500);
  overflow: auto;
}

.discrepancy__container {
  height: 100%;
  max-width: var(--disc-container-max-width);
  margin: 0 auto;
  padding: 20px;
}

.discrepancy__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.discrepancy__title {
  padding-left: 35px;
  padding-right: 20px;
  color: var(--boxel-light);
  background: url("../../../../public/@cardstack/boxel/images/icons/file-icon.svg") center left 5px/16px 20px no-repeat;
  font: var(--boxel-font);
  font-weight: 600;
  letter-spacing: var(--boxel-lsp-sm);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.discrepancy__breadcrumbs {
  border-bottom: 1px solid #7d7c93;
  margin-bottom: 20px;
}

.discrepancy__main {
  --icon-color: var(--boxel-light);
}

.discrepancy__main--comp-view {
  --icon-color: var(--boxel-dark);

  background-color: var(--boxel-highlight);
  padding: 0 25px 25px;
  border-radius: 10px;
  margin-bottom: 30px;
}

.discrepancy__comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--disc-header-height);
  width: 100%;
  max-width: 775px;
  margin: 0 auto;
  padding: 20px 20px 20px 30px;
  border-radius: 10px;
  background-color: var(--boxel-purple-700);
  color: var(--boxel-light);
  font: var(--boxel-font-sm);
  font-weight: 700;
  letter-spacing: var(--boxel-lsp-lg);
  transition: max-width 0.2s ease-in;
}

.discrepancy__comparison-header-title-group {
  display: inline-flex;
  align-items: center;
}

.discrepancy__nested-level-back-btn {
  padding: 10px 20px;
  border: none;
  background: url("../../../../public/@cardstack/boxel/images/icons/curved-arrow.svg") left center/12px 12px no-repeat;
  font-weight: 600;
  letter-spacing: var(--boxel-lsp-lg);
}

.discrepancy__nested-level-back-btn:hover {
  color: initial;
}

.discrepancy__comparison-header-icons {
  display: inline-flex;
  margin-right: 15px;
}

.discrepancy__profile-icon {
  display: inline-block;
  width: 30px;
  height: 30px;
  background-color: var(--boxel-dark);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  color: var(--boxel-light);
  border: 1px solid var(--boxel-dark);
  border-radius: 7px;
  font: var(--boxel-font-sm);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 30px;
  text-align: center;
}

.discrepancy__comparison-header-icons-caret {
  display: inline-block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
}

.discrepancy__comparison-header--comp-mode {
  max-width: 100%;
  padding-right: 0;
  padding-left: 0;
  background-color: transparent;
  color: var(--boxel-dark);
}

.discrepancy__cards {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0 50px;
  margin-top: 20px;
  box-shadow: var(--boxel-box-shadow);
}

.discrepancy__cards.discrepancy__cards--comp-view {
  gap: 0;
  margin-top: 0;
}

.discrepancy__cards.discrepancy__cards--comp-view .discrepancy-card__header.your-version {
  border-radius: 10px 0 0;
}

.discrepancy__cards.discrepancy__cards--comp-view .discrepancy-card__header.other-version {
  border-radius: 0 10px 0 0;
  border-left: 1px solid var(--boxel-purple-500);
}

.discrepancy-card__header {
  position: relative;
  height: var(--disc-header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 15px;
  background-color: var(--boxel-purple-700);
  color: var(--boxel-light);
  font: var(--boxel-font-sm);
  letter-spacing: var(--boxel-lsp);
  border-radius: 10px 10px 0 0;
}

.discrepancy-card__header.selected-version {
  background-color: var(--boxel-highlight);
  color: var(--boxel-dark);
}

.discrepancy-card__header-label {
  position: absolute;
  top: 8px;
  left: 15px;
  color: #a5a5a5;
  font: var(--boxel-font-xs);
  font-weight: 600;
  letter-spacing: var(--boxel-lsp-xl);
  text-transform: uppercase;
}

.discrepancy-card__header.selected-version .discrepancy-card__header-label {
  color: var(--boxel-purple-700);
}

.discrepancy-card__header-title-group {
  display: inline-flex;
  align-items: center;
  padding-top: 10px;
}

.discrepancy-card__header-icons {
  margin-right: 15px;
}

.discrepancy-card__title {
  font-weight: 700;
}

.discrepancy-card__datetime {
  font: var(--boxel-font-xs);
}

button.discrepancy-card__header-btn {
  width: 100%;
  max-width: 225px;
  height: 40px;
  padding: 10px 40px;
  font-weight: 400;
  background: url("../../../../public/@cardstack/boxel/images/icons/select-empty.svg") left 12px top 10px/16px 16px no-repeat;
  background-color: transparent;
  border-color: var(--boxel-purple-400);
  color: inherit;
  text-align: left;
  white-space: nowrap;
  transition: border-color var(--boxel-transition);
}

button.discrepancy-card__header-btn:hover {
  border-color: var(--boxel-light);
}

button.discrepancy-card__header-btn.checked {
  background-image: url("../../../../public/@cardstack/boxel/images/icons/select-checked.svg");
  border-color: var(--boxel-dark);
  font-weight: 600;
  cursor: initial;
}

button.discrepancy-card__header-btn--toggle.checked {
  border-color: var(--boxel-success-200);
}

button.discrepancy-card__header-btn--toggle.checked:hover {
  border-color: var(--boxel-dark);
  cursor: pointer;
}

.discrepancy-field {
  position: relative;
  height: 100%;
  padding: 30px 25px 30px 0;
  background-color: var(--boxel-light);
  border-bottom: var(--boxel-border);
}

.discrepancy-field--comp-field {
  border-left: 1px solid #696969;
}

.discrepancy-field--base-field.linked-view,
.discrepancy-field--comp-field.keep-current-view,
.discrepancy-field--comp-field.comparison-view {
  background-color: #ededef;
}

.discrepancy-field--base-field.linked-view .field-renderer__opacity-control,
.discrepancy-field--comp-field.keep-current-view .field-renderer__opacity-control,
.discrepancy-field--comp-field.comparison-view .field-renderer__opacity-control {
  opacity: 0.25;
}

.discrepancy-field--base-field.linked-view .field-renderer__meta-field *,
.discrepancy-field--comp-field.keep-current-view .field-renderer__meta-field *,
.discrepancy-field--comp-field.comparison-view .field-renderer__meta-field * {
  opacity: initial;
}

.discrepancy-card__footer {
  height: var(--disc-footer-cta-height-lg);
  background-color: var(--boxel-light);
}

.discrepancy__count-btn-link-copy {
  display: inline-block;
  color: var(--boxel-light);
  background: url("../../../../public/@cardstack/boxel/images/icons/warning.svg") bottom left/25px 20px no-repeat;
  font: var(--boxel-font-sm);
  padding-top: 25px;
  padding-left: 35px;
}

a.discrepancy__count-btn {
  height: 50px;
  width: 100%;
  max-width: 500px;
  font-weight: 600;
  line-height: 3;
}

a.discrepancy__count-btn:hover {
  color: initial;
}

.discrepancy__count-btn-container {
  position: fixed;
  z-index: 2;
  bottom: 0;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  background-color: var(--boxel-purple-700);
  text-align: center;
  transform: translateY(110%);
  transition: all 0.2s ease-in;
}

.discrepancy__count-btn-container--linked.container-right {
  flex-direction: column;
}

.discrepancy__count-btn-container--comparison {
  transition: all 0.2s ease-out;
}

.discrepancy__count-btn-container.visible {
  transform: translateY(0);
  transition: all 0.2s ease-out;
}

@media only screen and (max-width: 1439px) {
  .discrepancy__count-btn-container {
    width: calc((100vw - 90px) / 2);
  }

  .discrepancy__count-btn-container.container-left {
    min-width: 685px;
  }

  .discrepancy__count-btn-container.container-right {
    min-width: 666px;
  }

  .discrepancy__count-btn-container--comparison.container-right {
    min-width: 596px;
  }
}

@media only screen and (min-width: 1440px) {
  .discrepancy__count-btn-container {
    width: 685px;
  }

  .discrepancy__count-btn-container--comparison {
    width: 755px;
  }
}

/* field renderer */
.discrepancy-field-renderer {
  grid-template-columns: auto 1fr;
  max-width: initial;
}

.discrepancy-field-renderer > .field-renderer__title {
  width: 160px;
  transition: width 0.2s ease-in, visibility 0.2s ease-in;
}

.discrepancy-field-renderer > .field-renderer__value {
  width: 450px;
  transition: width 0.2s ease-in;
}

.discrepancy-field-renderer.comp-card-field.comp-view > .field-renderer__title {
  visibility: collapse;
  width: 90px;
  transition: width 0.2s ease-out, visibility 0.2s ease-out;
}

.discrepancy-field-renderer.base-card-field.comp-view * {
  opacity: 1;
}

.discrepancy-field--comp-field .publishing-representation__writers .field-renderer__opacity-control,
.discrepancy-field--comp-field .publishing-representation__publishers .field-renderer__opacity-control,
.discrepancy-field--comp-field .territory__wrapper .field-renderer__opacity-control,
.discrepancy-field--base-field.linked-view .publishing-representation__writers .field-renderer__opacity-control,
.discrepancy-field--base-field.linked-view .publishing-representation__publishers .field-renderer__opacity-control {
  opacity: initial;
}

.discrepancy-field-renderer.base-card-field.comp-view .boxel-highlight {
  box-shadow: 0 10px 15px rgb(0 0 0 / 15%);
}

/* Dummy */
.discrepancy__profile-icon--allegro-music-publishing {
  background-size: auto 23px;
}

.boxel-card__bg-img--allegro-music-publishing {
  border-radius: 100px;
}

.discrepancy__profile-icon--warbler-music {
  background-color: var(--boxel-navy);
}

.discrepancy__profile-icon--realtunes-publishing {
  background-color: #3f356f;
}

.discrepancy__profile-icon--somoa {
  background-color: var(--boxel-lilac);
}


text:
using System;
using Azure.Core;

namespace Azure.ResourceManager.MySql.Models
{
    /// <summary> The MySqlServerPrivateLinkServiceConnectionStateProperty. </summary>
    public partial class MySqlServerPrivateLinkServiceConnectionStateProperty
    {
        /// <summary> Initializes a new instance of MySqlServerPrivateLinkServiceConnectionStateProperty. </summary>
        /// <param name="status"> The private link service connection status. </param>
        /// <param name="description"> The private link service connection description. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="description"/> is null. </exception>
        internal MySqlServerPrivateLinkServiceConnectionStateProperty(MySqlPrivateLinkServiceConnectionStateStatus status, string description)
        {
            Argument.AssertNotNull(description, nameof(description));

            Status = status;
            Description = description;
        }

        /// <summary> Initializes a new instance of MySqlServerPrivateLinkServiceConnectionStateProperty. </summary>
        /// <param name="status"> The private link service connection status. </param>
        /// <param name="description"> The private link service connection description. </param>
        /// <param name="actionsRequired"> The actions required for private link service connection. </param>
        internal MySqlServerPrivateLinkServiceConnectionStateProperty(MySqlPrivateLinkServiceConnectionStateStatus status, string description, MySqlPrivateLinkServiceConnectionStateRequiredAction? actionsRequired)
        {
            Status = status;
            Description = description;
            ActionsRequired = actionsRequired;
        }

        /// <summary> The private link service connection status. </summary>
        public MySqlPrivateLinkServiceConnectionStateStatus Status { get; }
        /// <summary> The private link service connection description. </summary>
        public string Description { get; }
        /// <summary> The actions required for private link service connection. </summary>
        public MySqlPrivateLinkServiceConnectionStateRequiredAction? ActionsRequired { get; }
    }
}


text:
//// [decoratorOnClassMethod12.ts]
module M {
    class S {
        decorator(target: Object, key: string): void { }
    }
    class C extends S {
        @super.decorator
        method() { }
    }
}

//// [decoratorOnClassMethod12.js]
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var M;
(function (M) {
    var S = /** @class */ (function () {
        function S() {
        }
        S.prototype.decorator = function (target, key) { };
        return S;
    }());
    var C = /** @class */ (function (_super) {
        __extends(C, _super);
        function C() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        C.prototype.method = function () { };
        __decorate([
            _super.decorator
        ], C.prototype, "method", null);
        return C;
    }(S));
})(M || (M = {}));


text:
import analytic_new_fields
import payment_term_new_fields
import product_new_fields


text:
var mongoose = require('mongoose');

// define our nerd model
// module.exports allows us to pass this to other files when it is called
module.exports = mongoose.model('User', {
	name : String
});


text:
<?php

namespace Ace\UtilitiesBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AceUtilitiesBundle extends Bundle
{
}


text:
<detector id="9" name="MuonBarrel" type="DD4hep_PolyhedraBarrelCalorimeter2" readout="MuonBarrelHits" vis="MuonBarrelVis" calorimeterType="MUON_BARREL" gap="0.*cm" material="Steel235">
  <comment>Muon Calorimeter Barrel</comment>
  <dimensions numsides="8" rmin="3464.0*mm" z="2983.0 * 2*mm"/>
  <staves />
  <layer repeat="11" >
    <slice material="Aluminum" thickness="0.1*cm" />
    <slice material="Air" thickness="0.35*cm" />
    <slice material="PyrexGlass" thickness="0.2*cm" />
    <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" />
    <slice material="PyrexGlass" thickness="0.2*cm" />
    <slice material="Air" thickness="0.35*cm" />
    <slice material="Aluminum" thickness="0.1*cm" />
    <slice material="Aluminum" thickness="0.1*cm" />
    <slice material="Air" thickness="0.35*cm" />
    <slice material="PyrexGlass" thickness="0.2*cm" />
    <slice material="RPCGasDefault" thickness="0.2*cm" sensitive="yes" />
    <slice material="PyrexGlass" thickness="0.2*cm" />
    <slice material="Air" thickness="0.35*cm" />
    <slice material="Aluminum" thickness="0.1*cm" />
    <slice material="Air" thickness="1.0*cm" />
    <slice material="Iron" thickness="20.0*cm" />
  </layer>
</detector>


text:
using System;
using System.Collections.Generic;
using System.Web.Security;

namespace EED.Domain
{
    public class User : MembershipUser
    {
        public virtual int Id { get; set; }
        public virtual string Name { get; set; }
        public virtual string Surname { get; set; }
        //public virtual string Email { get; set; }
        public virtual string State { get; set; }
        public virtual string Country { get; set; }
        public virtual string PhoneNumber { get; set; }
        public new virtual string UserName { get; set; }
        public virtual string Password { get; set; }
        public new virtual DateTime? LastLoginDate { get; set; }
        public new virtual DateTime? CreationDate { get; set; }
        public new virtual bool IsOnline { get; set; }
        public new virtual bool IsLockedOut { get; set; }

        public IList<ElectionProject> Projects { get; set; }
    }
}


text:
try:
    from collections import OrderedDict

except ImportError:
    OrderedDict = dict

from pyasn1.type import base, univ, tag, char, useful
from pyasn1 import debug, error

__all__ = ['encode']

class AbstractItemEncoder(object):
    def encode(self, value, encodeFun, **options):
        raise error.PyAsn1Error('Not implemented')

class BooleanEncoder(AbstractItemEncoder):
    def encode(self, value, encodeFun, **options):
        return bool(value)

class IntegerEncoder(AbstractItemEncoder):
    def encode(self, value, encodeFun, **options):
        return int(value)

class BitStringEncoder(AbstractItemEncoder):
    def encode(self, value, encodeFun, **options):
        return str(value)

class OctetStringEncoder(AbstractItemEncoder):
    def encode(self, value, encodeFun, **options):
        return value.asOctets()

class TextStringEncoder(AbstractItemEncoder):
    def encode(self, value, encodeFun, **options):
        return value.prettyPrint()

class NullEncoder(AbstractItemEncoder):
    def encode(self, value, encodeFun, **options):
        return None

class ObjectIdentifierEncoder(AbstractItemEncoder):
    def encode(self, value, encodeFun, **options):
        return str(value)

class RealEncoder(AbstractItemEncoder):
    def encode(self, value, encodeFun, **options):
        return float(value)

class SetEncoder(AbstractItemEncoder):
    protoDict = dict

    def encode(self, value, encodeFun, **options):
        value.verifySizeSpec()

        namedTypes = value.componentType
        substrate = self.protoDict()

        for idx, (key, subValue) in enumerate(value.items()):
            if namedTypes and namedTypes[idx].isOptional and not value[idx].isValue:
                continue
            substrate[key] = encodeFun(subValue, **options)
        return substrate

class SequenceEncoder(SetEncoder):
    protoDict = OrderedDict

class SequenceOfEncoder(AbstractItemEncoder):
    def encode(self, value, encodeFun, **options):
        value.verifySizeSpec()
        return [encodeFun(x, **options) for x in value]

class ChoiceEncoder(SequenceEncoder):
    pass

class AnyEncoder(AbstractItemEncoder):
    def encode(self, value, encodeFun, **options):
        return value.asOctets()

tagMap = {
    univ.Boolean.tagSet: BooleanEncoder(),
    univ.Integer.tagSet: IntegerEncoder(),
    univ.BitString.tagSet: BitStringEncoder(),
    univ.OctetString.tagSet: OctetStringEncoder(),
    univ.Null.tagSet: NullEncoder(),
    univ.ObjectIdentifier.tagSet: ObjectIdentifierEncoder(),
    univ.Enumerated.tagSet: IntegerEncoder(),
    univ.Real.tagSet: RealEncoder(),
    # Sequence & Set have same tags as SequenceOf & SetOf
    univ.SequenceOf.tagSet: SequenceOfEncoder(),
    univ.SetOf.tagSet: SequenceOfEncoder(),
    univ.Choice.tagSet: ChoiceEncoder(),
    # character string types
    char.UTF8String.tagSet: TextStringEncoder(),
    char.NumericString.tagSet: TextStringEncoder(),
    char.PrintableString.tagSet: TextStringEncoder(),
    char.TeletexString.tagSet: TextStringEncoder(),
    char.VideotexString.tagSet: TextStringEncoder(),
    char.IA5String.tagSet: TextStringEncoder(),
    char.GraphicString.tagSet: TextStringEncoder(),
    char.VisibleString.tagSet: TextStringEncoder(),
    char.GeneralString.tagSet: TextStringEncoder(),
    char.UniversalString.tagSet: TextStringEncoder(),
    char.BMPString.tagSet: TextStringEncoder(),
    # useful types
    useful.ObjectDescriptor.tagSet: OctetStringEncoder(),
    useful.GeneralizedTime.tagSet: OctetStringEncoder(),
    useful.UTCTime.tagSet: OctetStringEncoder()
}

# Type-to-codec map for ambiguous ASN.1 types
typeMap = {
    univ.Set.typeId: SetEncoder(),
    univ.SetOf.typeId: SequenceOfEncoder(),
    univ.Sequence.typeId: SequenceEncoder(),
    univ.SequenceOf.typeId: SequenceOfEncoder(),
    univ.Choice.typeId: ChoiceEncoder(),
    univ.Any.typeId: AnyEncoder()
}

class Encoder(object):

    # noinspection PyDefaultArgument
    def __init__(self, tagMap, typeMap={}):
        self.__tagMap = tagMap
        self.__typeMap = typeMap

    def __call__(self, value, **options):
        if not isinstance(value, base.Asn1Item):
            raise error.PyAsn1Error('value is not valid (should be an instance of an ASN.1 Item)')

        if debug.logger & debug.flagEncoder:
            logger = debug.logger
        else:
            logger = None

        if logger:
            debug.scope.push(type(value).__name__)
            logger('encoder called for type %s <%s>' % (type(value).__name__, value.prettyPrint()))

        tagSet = value.tagSet

        try:
            concreteEncoder = self.__typeMap[value.typeId]

        except KeyError:
            # use base type for codec lookup to recover untagged types
            baseTagSet = tag.TagSet(value.tagSet.baseTag, value.tagSet.baseTag)

            try:
                concreteEncoder = self.__tagMap[baseTagSet]

            except KeyError:
                raise error.PyAsn1Error('No encoder for %s' % (value,))

        if logger:
            logger('using value codec %s chosen by %s' % (concreteEncoder.__class__.__name__, tagSet))

        pyObject = concreteEncoder.encode(value, self, **options)

        if logger:
            logger('encoder %s produced: %s' % (type(concreteEncoder).__name__, repr(pyObject)))
            debug.scope.pop()

        return pyObject

#: Turns ASN.1 object into a Python built-in type object(s).
#:
#: Takes any ASN.1 object (e.g. :py:class:`~pyasn1.type.base.PyAsn1Item` derivative)
#: walks all its components recursively and produces a Python built-in type or a tree
#: of those.
#:
#: One exception is that instead of :py:class:`dict`, the :py:class:`OrderedDict`
#: can be produced (whenever available) to preserve ordering of the components
#: in ASN.1 SEQUENCE.
#:
#: Parameters
#: ----------
#  asn1Value: any pyasn1 object (e.g. :py:class:`~pyasn1.type.base.PyAsn1Item` derivative)
#:     pyasn1 object to encode (or a tree of them)
#:
#: Returns
#: -------
#: : :py:class:`object`
#:     Python built-in type instance (or a tree of them)
#:
#: Raises
#: ------
#: : :py:class:`pyasn1.error.PyAsn1Error`
#:     On encoding errors
encode = Encoder(tagMap, typeMap)