text:
import Feature from '../src/ol/Feature.js';
import Map from '../src/ol/Map.js';
import Point from '../src/ol/geom/Point.js';
import View from '../src/ol/View.js';
import {Circle as CircleStyle, Stroke, Style} from '../src/ol/style.js';
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
import {easeOut} from '../src/ol/easing.js';
import {fromLonLat} from '../src/ol/proj.js';
import {getVectorContext} from '../src/ol/render.js';
import {unByKey} from '../src/ol/Observable.js';

const tileLayer = new TileLayer({
  source: new OSM({
    wrapX: false,
  }),
});

const map = new Map({
  layers: [tileLayer],
  target: 'map',
  view: new View({
    center: [0, 0],
    zoom: 1,
    multiWorld: true,
  }),
});

const source = new VectorSource({
  wrapX: false,
});
const vector = new VectorLayer({
  source: source,
});
map.addLayer(vector);

function addRandomFeature() {
  const x = Math.random() * 360 - 180;
  const y = Math.random() * 180 - 90;
  const geom = new Point(fromLonLat([x, y]));
  const feature = new Feature(geom);
  source.addFeature(feature);
}

const duration = 3000;
function flash(feature) {
  const start = new Date().getTime();
  const listenerKey = tileLayer.on('postrender', animate);

  function animate(event) {
    const vectorContext = getVectorContext(event);
    const frameState = event.frameState;
    const flashGeom = feature.getGeometry().clone();
    const elapsed = frameState.time - start;
    const elapsedRatio = elapsed / duration;
    // radius will be 5 at start and 30 at end.
    const radius = easeOut(elapsedRatio) * 25 + 5;
    const opacity = easeOut(1 - elapsedRatio);

    const style = new Style({
      image: new CircleStyle({
        radius: radius,
        stroke: new Stroke({
          color: 'rgba(255, 0, 0, ' + opacity + ')',
          width: 0.25 + opacity,
        }),
      }),
    });

    vectorContext.setStyle(style);
    vectorContext.drawGeometry(flashGeom);
    if (elapsed > duration) {
      unByKey(listenerKey);
      return;
    }
    // tell OpenLayers to continue postrender animation
    map.render();
  }
}

source.on('addfeature', function (e) {
  flash(e.feature);
});

window.setInterval(addRandomFeature, 1000);

redpajama_set_name: RedPajamaGithub


text: this is for exo platform developement


text:
#pragma once
#include <aws/s3control/S3Control_EXPORTS.h>
#include <aws/s3control/model/PublicAccessBlockConfiguration.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Xml
{
  class XmlDocument;
} // namespace Xml
} // namespace Utils
namespace S3Control
{
namespace Model
{
  class AWS_S3CONTROL_API GetPublicAccessBlockResult
  {
  public:
    GetPublicAccessBlockResult();
    GetPublicAccessBlockResult(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
    GetPublicAccessBlockResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);

    /**
     *
The PublicAccessBlock configuration currently in effect for this
     * Amazon Web Services account.

     */
    inline const PublicAccessBlockConfiguration& GetPublicAccessBlockConfiguration() const{ return m_publicAccessBlockConfiguration; }

    /**
     *
The PublicAccessBlock configuration currently in effect for this
     * Amazon Web Services account.

     */
    inline void SetPublicAccessBlockConfiguration(const PublicAccessBlockConfiguration& value) { m_publicAccessBlockConfiguration = value; }

    /**
     *
The PublicAccessBlock configuration currently in effect for this
     * Amazon Web Services account.

     */
    inline void SetPublicAccessBlockConfiguration(PublicAccessBlockConfiguration&& value) { m_publicAccessBlockConfiguration = std::move(value); }

    /**
     *
The PublicAccessBlock configuration currently in effect for this
     * Amazon Web Services account.

     */
    inline GetPublicAccessBlockResult& WithPublicAccessBlockConfiguration(const PublicAccessBlockConfiguration& value) { SetPublicAccessBlockConfiguration(value); return *this;}

    /**
     *
The PublicAccessBlock configuration currently in effect for this
     * Amazon Web Services account.

     */
    inline GetPublicAccessBlockResult& WithPublicAccessBlockConfiguration(PublicAccessBlockConfiguration&& value) { SetPublicAccessBlockConfiguration(std::move(value)); return *this;}

  private:

    PublicAccessBlockConfiguration m_publicAccessBlockConfiguration;
  };

} // namespace Model
} // namespace S3Control
} // namespace Aws


text:
#ifndef CUBEZ_AUDIO__H
#define CUBEZ_AUDIO__H

#include <cubez/common.h>

/*

Example:

qbAudioBuffer jump_wav = qb_audio_loadwav("resources/jump.wav");
qbAudioPlaying jump = qb_audio_upload(jump_wav);
qb_audio_play(jump);
...

// Stops the wav and frees the audio.
qb_audio_free(jump);

*/

typedef struct qbAudioAttr_ {
  uint32_t sample_frequency;
  uint32_t buffered_samples;
} qbAudioAttr_, *qbAudioAttr;

typedef struct qbAudioBuffer_ *qbAudioBuffer;
typedef struct qbAudioPlaying_ *qbAudioPlaying;

typedef enum qbAudoLoop {
  QB_AUDIO_LOOP_DISABLE = 0,
  QB_AUDIO_LOOP_ENABLE = 1
} qbAudoLoop;

QB_API qbAudioBuffer qb_audio_loadwav(const char* file);
QB_API qbAudioPlaying qb_audio_upload(qbAudioBuffer loaded);

QB_API void qb_audio_free(qbAudioBuffer loaded);
QB_API int qb_audio_size(qbAudioBuffer loaded);

QB_API int qb_audio_isplaying(qbAudioPlaying playing);
QB_API void qb_audio_play(qbAudioPlaying playing);
QB_API void qb_audio_stop(qbAudioPlaying playing);
QB_API void qb_audio_loop(qbAudioPlaying playing, qbAudoLoop enable_loop);
QB_API void qb_audio_pause(qbAudioPlaying playing);
QB_API void qb_audio_pan(qbAudioPlaying playing, float pan);
QB_API void qb_audio_volume(qbAudioPlaying playing, float left, float right);

QB_API void qb_audio_stopall();

#endif  // CUBEZ_AUDIO__H


text:
<?xml version="1.0" encoding="UTF-8"?>

	<wicket:extend>

	</wicket:extend>


text:
using FluentAssertions;
using Ritter.Domain.Tests.Mocks;
using Xunit;

namespace Ritter.Domain.Tests.Entity
{
    public class Entity_IsTransient
    {
        [Fact]
        public void ReturnFalseGivenNewEntity()
        {
            //Given
            IEntity entity = new EntityTest(3);

            //When
            bool isTransient = entity.IsTransient();

            //Then
            isTransient.Should().BeFalse();
            entity.Id.Should().Be(3);
        }

        [Fact]
        public void ReturnTrueGivenNewEntity()
        {
            //Given
            IEntity entity = new EntityTest();

            //When
            bool isTransient = entity.IsTransient();

            //Then
            isTransient.Should().BeTrue();
            entity.Id.Should().Be(0);
        }
    }
}


text:
static VALUE cgraph_kit;
void Init_graph_kit();


text:
package org.mbari.vars.ui.demos.mediaplayers.ships;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.mbari.vars.ui.Initializer;
import org.mbari.vars.ui.UIToolBox;
import org.mbari.vars.ui.mediaplayers.ships.ShipControlPane;

/**
 * @author Brian Schlining
 * @since 2018-01-02T17:11:00
 */
public class ShipControlPaneDemo extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        UIToolBox toolBox = Initializer.getToolBox();
        ShipControlPane pane = new ShipControlPane(toolBox.getI18nBundle());
        Scene scene = new Scene(pane);
        scene.getStylesheets().addAll(toolBox.getStylesheets());
        primaryStage.setScene(scene);

        primaryStage.show();
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using imperative.summoner;
using imperative.expressions;
using metahub.jackolantern.schema;
using metahub.logic.nodes;

namespace metahub.jackolantern.carvers
{
    public class Equals : Carver
    {
        public Equals(JackOLantern jack)
            : base(jack)
        {

        }

        public static string[] container_functions = new[]
            {
                "map"
            };

        public override void carve(Function_Node pumpkin)
        {
            //var endpoints = get_endpoints3(pumpkin);
            if (aggregate(pumpkin).OfType<Function_Node>().Any(n => !n.is_operation && !container_functions.Contains(n.name)))
                return;

            var endpoints = get_endpoints3(pumpkin).ToArray();
            var pivots = endpoints.Where(e => e.node.outputs[0].type != Node_Type.property).ToArray();
            foreach (var endpoint in endpoints)
            {
                foreach (var other in pivots)
                {
                    if (endpoint == other)
                        continue;

                    var portal = endpoint.portal;
                    var setter = jack.get_setter(portal);
                    var context = new Summoner_Context(setter);
                    var swamp = new Swamp(jack, pumpkin, context);
                    var context_node =
                        pumpkin.aggregate(Dir.In)
                               .OfType<Property_Node>()
                               .First(n => n.property.fullname == portal.fullname);
                    var expressions = swamp.get_expression_pair2(context_node, other.node);

                    setter.accordian.add("post", new Comment("Carving equals: " + endpoint.portal.name));
                    var conditions = get_conditions(expressions[0]);
                    //if (portal.type == Kind.reference || portal.type == Kind.list)
                    //expressions = expressions.Reverse().ToArray();

                    if (expressions[0] != null && expressions[0].type == Expression_Type.operation)
                        throw new Exception("Cannot call function on operation.");

                    context.set_pattern("condition", conditions);
                    context.set_pattern("first", expressions[0]);
                    context.set_pattern("second", expressions[1]);
                    setter.accordian.add("post", jack.overlord.summon_snippet(jack.templates["equals"], context));
                }
            }
        }
    }
}


text:
package io.gravitee.rest.api.service.cockpit.services;

public enum CockpitReplyStatus {
    SUCCEEDED,
    ERROR,
}


text:
package org.scalameta.data

import scala.language.experimental.macros
import scala.annotation.StaticAnnotation
import scala.reflect.macros.whitebox.Context
import scala.collection.mutable.ListBuffer
import org.scalameta.internal.MacroHelpers

// Virtually the same as the `case' modifier:
// can be used on both classes and objects with very similar effect.
//
// The main different is customizability - we can stuff any extensions we want into @data.
// Currently it's just two things:
//    1) Support for lazy parameters (implemented via a @byNeed marker annotation),
//       as in e.g.: `@leaf class Nonrecursive(tpe: Type @byNeed) extends Typing`.
//       NOTE: @byNeed isn't defined anywhere - it's just a syntactic marker.
//    2) Support for on-demand member generation via named parameters to @data,
//       as in e.g. `@data(toString = false) class ...`.
//
// Performance of pattern matching may be subpar until SI-9029 is fixed,
// as well as some minor semantic details may differ.
class data extends StaticAnnotation {
  def macroTransform(annottees: Any*): Any = macro DataMacros.data
}

class none extends StaticAnnotation {
  def macroTransform(annottees: Any*): Any = macro DataMacros.none
}

class DataMacros(val c: Context) extends MacroHelpers {
  import c.universe._
  import Flag._

  def data(annottees: Tree*): Tree = annottees.transformAnnottees(new ImplTransformer {
    override def transformClass(cdef: ClassDef, mdef: ModuleDef): List[ImplDef] = {
      val q"$mods class $name[..$tparams] $ctorMods(...$paramss) extends { ..$earlydefns } with ..$parents { $self => ..$stats }" = cdef
      val q"$mmods object $mname extends { ..$mearlydefns } with ..$mparents { $mself => ..$mstats }" = mdef
      val parents1 = ListBuffer[Tree]() ++ parents
      val stats1 = ListBuffer[Tree]() ++ stats
      val anns1 = ListBuffer[Tree]() ++ mods.annotations
      def mods1 = mods.mapAnnotations(_ => anns1.toList)
      val manns1 = ListBuffer[Tree]() ++ mmods.annotations
      def mmods1 = mmods.mapAnnotations(_ => manns1.toList)
      val mstats1 = ListBuffer[Tree]() ++ mstats

      implicit class XtensionDataModifiers(mods: Modifiers) {
        def mkByneed = Modifiers(mods.flags, mods.privateWithin, mods.annotations :+ q"new $AdtMetadataModule.byNeedField")
      }
      def needs(name: Name, companion: Boolean, duplicate: Boolean) = {
        val q"new $_(...$argss).macroTransform(..$_)" = c.macroApplication
        val banIndicator = argss.flatten.find {
          case AssignOrNamedArg(Ident(TermName(param)), Literal(Constant(false))) => param == name.toString
          case _ => false
        }
        val ban = banIndicator.map(_ => true).getOrElse(false)
        val presenceIndicator = {
          val where = if (companion) mstats else stats
          where.collectFirst { case mdef: MemberDef if mdef.name == name => mdef }
        }
        val present = presenceIndicator.map(_ => true).getOrElse(false)
        !ban && (duplicate || !present)
      }

      object VanillaParam {
        def unapply(tree: ValDef): Option[(Modifiers, TermName, Tree, Tree)] = tree match {
          case ByNeedParam(_, _, _, _) => None
          case VarargParam(_, _, _, _) => None
          case _ => Some((tree.mods, tree.name, tree.tpt, tree.rhs))
        }
      }
      object VarargParam {
        def unapply(tree: ValDef): Option[(Modifiers, TermName, Tree, Tree)] = tree.tpt match {
          case Vararg(_) => Some((tree.mods, tree.name, tree.tpt, tree.rhs))
          case _ => None
        }
      }
      object ByNeedParam {
        def unapply(tree: ValDef): Option[(Modifiers, TermName, Tree, Tree)] = tree.tpt match {
          case Annotated(Apply(Select(New(Ident(TypeName("byNeed"))), termNames.CONSTRUCTOR), List()), tpt) =>
            if (Vararg.unapply(tree.tpt).nonEmpty) c.abort(cdef.pos, "vararg parameters cannot be by-need")
            else Some((tree.mods, tree.name, tpt, tree.rhs))
          case _ =>
            None
        }
      }
      def unByNeed(tree: ValDef): ValDef = tree match {
        case ByNeedParam(mods, name, tpt, default) => ValDef(mods, name, tpt, default)
        case _ => tree.duplicate
      }
      def byNameTpt(tpt: Tree): Tree = {
        val DefDef(_, _, _, List(List(ValDef(_, _, byNameTpt, _))), _, _) = q"def dummy(dummy: => $tpt) = ???"
        byNameTpt
      }
      object Vararg {
        def unapply(tpt: Tree): Option[Tree] = tpt match {
          case Annotated(_, arg) =>
            unapply(arg)
          case AppliedTypeTree(Select(Select(Ident(root), scala), repeated), List(arg))
          if root == termNames.ROOTPKG && scala == TermName("scala") && repeated == definitions.RepeatedParamClass.name.decodedName =>
            Some(arg)
          case _ =>
            None
        }
      }
      val isVararg = paramss.flatten.lastOption.flatMap(p => Vararg.unapply(p.tpt)).nonEmpty
      val itparams = tparams.map{ case q"$mods type $name[..$tparams] >: $low <: $high" => q"${mods.unVariant} type $name[..$tparams] >: $low <: $high" }
      val tparamrefs = tparams.map(tparam => Ident(tparam.name))

      // step 1: validate the shape of the class
      if (mods.hasFlag(SEALED)) c.abort(cdef.pos, "sealed is redundant for @data classes")
      if (mods.hasFlag(FINAL)) c.abort(cdef.pos, "final is redundant for @data classes")
      if (mods.hasFlag(CASE)) c.abort(cdef.pos, "case is redundant for @data classes")
      if (mods.hasFlag(ABSTRACT)) c.abort(cdef.pos, "@data classes cannot be abstract")
      if (paramss.length == 0) c.abort(cdef.pos, "@data classes must define a non-empty parameter list")

      // step 2: create parameters, generate getters and validation checks
      val paramss1 = paramss.map(_.map{
        case VanillaParam(mods, name, tpt, default) =>
          stats1 += q"$DataTyperMacrosModule.nullCheck(this.$name)"
          stats1 += q"$DataTyperMacrosModule.emptyCheck(this.$name)"
          q"${mods.unPrivate} val $name: $tpt = $default"
        case VarargParam(mods, name, tpt, default) =>
          stats1 += q"$DataTyperMacrosModule.nullCheck(this.$name)"
          stats1 += q"$DataTyperMacrosModule.emptyCheck(this.$name)"
          q"${mods.unPrivate} val $name: $tpt = $default"
        case ByNeedParam(mods, name, tpt, default) =>
          val flagName = TermName(name + "Flag")
          val statusName = TermName("is" + name.toString.capitalize + "Loaded")
          val valueName = TermName(name + "Value")
          val storageName = TermName(name + "Storage")
          val getterName = name
          val paramName = TermName("_" + name)
          val paramTpt = tq"_root_.scala.Function0[$tpt]"
          stats1 += q"@$AdtMetadataModule.byNeedField private[this] var $flagName: _root_.scala.Boolean = false"
          stats1 += q"def $statusName: _root_.scala.Boolean = this.$flagName"
          stats1 += q"@$AdtMetadataModule.byNeedField private[this] var $storageName: $tpt = _"
          stats1 += q"""
            def $getterName = {
              if (!this.$flagName) {
                val $valueName = this.$paramName()
                $DataTyperMacrosModule.nullCheck($valueName)
                $DataTyperMacrosModule.emptyCheck($valueName)
                this.$paramName = null
                this.$storageName = $valueName
                this.$flagName = true
              }
              this.$storageName
            }
          """
          q"${mods.mkPrivate.mkByneed.mkMutable} val $paramName: $paramTpt = $default"
      })

      // step 3: implement Object
      if (needs(TermName("toString"), companion = false, duplicate = false)) {
        stats1 += q"override def toString: _root_.scala.Predef.String = _root_.scala.runtime.ScalaRunTime._toString(this)"
      }
      if (needs(TermName("hashCode"), companion = false, duplicate = false)) {
        stats1 += q"override def hashCode: _root_.scala.Int = _root_.scala.runtime.ScalaRunTime._hashCode(this)"
      }
      if (needs(TermName("equals"), companion = false, duplicate = false)) {
        stats1 += q"override def canEqual(other: _root_.scala.Any): _root_.scala.Boolean = other.isInstanceOf[$name[..$tparamrefs]]"
        stats1 += q"""
          override def equals(other: _root_.scala.Any): _root_.scala.Boolean = (
            this.canEqual(other) && (other match {
              case other: Product if this.productArity == other.productArity =>
                this.productIterator sameElements other.productIterator
              case _ =>
                false
            })
          )
        """
      }

      // step 4: implement Product
      parents1 += tq"_root_.scala.Product"
      if (needs(TermName("product"), companion = false, duplicate = false)) {
        val productParamss = paramss.map(_.map(_.duplicate))
        stats1 += q"override def productPrefix: _root_.scala.Predef.String = ${name.toString}"
        stats1 += q"override def productArity: _root_.scala.Int = ${paramss.head.length}"
        val pelClauses = ListBuffer[Tree]()
        pelClauses ++= 0.to(productParamss.head.length - 1).map(i => cq"$i => this.${productParamss.head(i).name}")
        pelClauses += cq"_ => throw new _root_.scala.IndexOutOfBoundsException(n.toString)"
        stats1 += q"override def productElement(n: _root_.scala.Int): Any = n match { case ..$pelClauses }"
        stats1 += q"override def productIterator: _root_.scala.Iterator[_root_.scala.Any] = _root_.scala.runtime.ScalaRunTime.typedProductIterator(this)"
      }

      // step 5: implement Serializable
      parents1 += tq"_root_.scala.Serializable"

      // step 6: generate copy
      if (needs(TermName("copy"), companion = false, duplicate = false) && !isVararg) {
        val copyParamss = paramss.map(_.map({
          case VanillaParam(mods, name, tpt, default) => q"$mods val $name: $tpt = this.$name"
          case VarargParam(mods, name, tpt, default) => q"$mods val $name: $tpt = this.$name"
          // NOTE: This doesn't compile, producing nonsensical errors
          // about incompatibility between the default value and the type of the parameter
          // e.g. "expected: => T, actual: T"
          // Therefore, I'm making the parameter of copy eager, even though I'd like it to be lazy.
          // case ByNeedParam(mods, name, tpt, default) => q"$mods val $name: ${byNameTpt(tpt)} = this.$name"
          case ByNeedParam(mods, name, tpt, default) => q"$mods val $name: $tpt = this.$name"
        }))
        val copyArgss = paramss.map(_.map({
          case VanillaParam(mods, name, tpt, default) => q"$name"
          case VarargParam(mods, name, tpt, default) => q"$name: _*"
          case ByNeedParam(mods, name, tpt, default) => q"(() => $name)"
        }))
        stats1 += q"def copy[..$itparams](...$copyParamss): $name[..$tparamrefs] = new $name[..$tparamrefs](...$copyArgss)"
      }

      // step 7: generate Companion.apply
      if (needs(TermName("apply"), companion = true, duplicate = false)) {
        val applyParamss = paramss.map(_.map({
          case VanillaParam(mods, name, tpt, default) => q"$mods val $name: $tpt = $default"
          case VarargParam(mods, name, tpt, default) => q"$mods val $name: $tpt = $default"
          case ByNeedParam(mods, name, tpt, default) => q"$mods val $name: ${byNameTpt(tpt)} = $default"
        }))
        val applyArgss = paramss.map(_.map({
          case VanillaParam(mods, name, tpt, default) => q"$name"
          case VarargParam(mods, name, tpt, default) => q"$name: _*"
          case ByNeedParam(mods, name, tpt, default) => q"(() => $name)"
        }))
        mstats1 += q"def apply[..$itparams](...$applyParamss): $name[..$tparamrefs] = new $name[..$tparamrefs](...$applyArgss)"
      }

      // step 8: generate Companion.unapply
      val unapplyName = if (isVararg) TermName("unapplySeq") else TermName("unapply")
      if (needs(TermName("unapply"), companion = true, duplicate = false) &&
          needs(TermName("unapplySeq"), companion = true, duplicate = false)) {
        val unapplyParamss = paramss.map(_.map(unByNeed))
        val unapplyParams = unapplyParamss.head
        if (unapplyParams.length > 22) {
          // do nothing
        } else if (unapplyParams.length != 0) {
          val successTargs = unapplyParams.map({
            case VanillaParam(mods, name, tpt, default) => tpt
            case VarargParam(mods, name, Vararg(tpt), default) => tq"_root_.scala.Seq[$tpt]"
            case ByNeedParam(mods, name, tpt, default) => tpt
          })
          val successTpe = tq"(..$successTargs)"
          val successArgs = q"(..${unapplyParams.map(p => q"x.${p.name}")})"
          mstats1 += q"""
            def $unapplyName[..$itparams](x: $name[..$tparamrefs]): Option[$successTpe] = {
              if (x == null) _root_.scala.None
              else _root_.scala.Some($successArgs)
            }
          """
        } else {
          mstats1 += q"def $unapplyName(x: $name): Boolean = true"
        }
      }

      val cdef1 = q"${mods1.mkFinal} class $name[..$tparams] $ctorMods(...$paramss1) extends { ..$earlydefns } with ..$parents1 { $self => ..$stats1 }"
      val mdef1 = q"$mmods1 object $mname extends { ..$mearlydefns } with ..$mparents { $mself => ..$mstats1 }"
      List(cdef1, mdef1)
    }

    override def transformModule(mdef: ModuleDef): ModuleDef = {
      val q"$mmods object $mname extends { ..$mearlydefns } with ..$mparents { $mself => ..$mstats }" = mdef

      // step 1: validate the shape of the module
      if (mmods.hasFlag(FINAL)) c.abort(mdef.pos, "final is redundant for @data objects")
      if (mmods.hasFlag(CASE)) c.abort(mdef.pos, "case is redundant for @data objects")

      q"${mmods.mkCase} object $mname extends { ..$mearlydefns } with ..$mparents { $mself => ..$mstats }"
    }
  })

  def none(annottees: Tree*): Tree = annottees.transformAnnottees(new ImplTransformer {
    override def transformModule(mdef: ModuleDef): ModuleDef = {
      val q"new $_(...$argss).macroTransform(..$_)" = c.macroApplication
      val q"$mmods object $mname extends { ..$mearlydefns } with ..$mparents { $mself => ..$mstats }" = mdef
      val manns1 = ListBuffer[Tree]() ++ mmods.annotations
      def mmods1 = mmods.mapAnnotations(_ => manns1.toList)
      val mstats1 = ListBuffer[Tree]() ++ mstats

      manns1 += q"new $DataAnnotation"
      mstats1 += q"override def isEmpty: $BooleanClass = true"

      q"$mmods1 object $mname extends { ..$mearlydefns } with ..$mparents { $mself => ..$mstats1 }"
    }
  })
}


text:
<?php
namespace Cheetahmail\Campaigns\ChronoContact;

class DeleteTemplateResponse
{

    /**
     * @var boolean $DeleteTemplateResult
     */
    protected $DeleteTemplateResult = null;

    /**
     * @param boolean $DeleteTemplateResult
     */
    public function __construct($DeleteTemplateResult)
    {
        $this->DeleteTemplateResult = $DeleteTemplateResult;
    }

    /**
     * @return boolean
     */
    public function getDeleteTemplateResult()
    {
        return $this->DeleteTemplateResult;
    }

    /**
     * @param boolean $DeleteTemplateResult
     * @return \Cheetahmail\Campaigns\ChronoContact\DeleteTemplateResponse
     */
    public function setDeleteTemplateResult($DeleteTemplateResult)
    {
        $this->DeleteTemplateResult = $DeleteTemplateResult;
        return $this;
    }
}


text:
package com.byteslounge.slickrepo.test.hsql

import com.byteslounge.slickrepo.test.{HsqlConfig, InstantVersionedRepositoryTest}

class HsqlInstantVersionedRepositoryTest extends InstantVersionedRepositoryTest(HsqlConfig.config)


text:
<?php
/**
 * @author Krzysztof Gzocha <krzysztof.gzocha@xsolve.pl>
 */
namespace Team3\PayU\SignatureCalculator;

use Psr\Log\LoggerInterface;
use Team3\PayU\Serializer\SerializerFactory;
use Team3\PayU\SignatureCalculator\Encoder\EncoderFactory;
use Team3\PayU\SignatureCalculator\Encoder\EncoderInterface;
use Team3\PayU\SignatureCalculator\ParametersSorter\ParametersSorter;

class OrderSignatureCalculatorFactory implements OrderSignatureCalculatorFactoryInterface
{
    /**
     * @param LoggerInterface $logger
     *
     * @return OrderSignatureCalculatorInterface
     */
    public function build(LoggerInterface $logger)
    {
        return new OrderSignatureCalculator(
            $this->getEncoder($logger),
            $this->getParametersSorter($logger),
            $logger
        );
    }

    private function getSerializer(LoggerInterface $logger)
    {
        $serializerFactory = new SerializerFactory();

        return $serializerFactory->build($logger);
    }

    /**
     * @param LoggerInterface $logger
     *
     * @return EncoderInterface
     */
    private function getEncoder(LoggerInterface $logger)
    {
        $encoderFactory = new EncoderFactory();

        return $encoderFactory->build($logger);
    }

    /**
     * @param LoggerInterface $logger
     *
     * @return ParametersSorter
     */
    private function getParametersSorter(LoggerInterface $logger)
    {
        return new ParametersSorter($this->getSerializer($logger));
    }
}


text:
import React from 'react';

import { Footer } from './index';

module.exports = stories => (
  stories
  .chapter('Footer')
  .addWithInfo(
    'normal',
    'Application\'s footer',
    () => (
      <Footer />
    )
  )
);


text:
class TfraLeftBar : public TFrame
{
__published:	// IDE-managed Components
    TPanel *paLeftBar;
    TPanel *paScene;
    TPanel *paEdit;
    TPanel *paTarget;
	TExtBtn *ebTargetObject;
	TExtBtn *ebTargetLight;
	TExtBtn *ebTargetSoundSrc;
	TExtBtn *ebTargetSoundEnv;
    TPanel *paFrames;
	TFormStorage *fsStorage;
    TExtBtn *ebTargetGlow;
	TExtBtn *ebTargetSpawnPoint;
	TExtBtn *ebTargetWay;
	TExtBtn *ebTargetSector;
	TExtBtn *ebTargetPortal;
	TLabel *APHeadLabel2;
	TExtBtn *sbSceneMin;
	TLabel *lbTools;
	TLabel *lbEditMode;
	TExtBtn *sbEditMin;
	TExtBtn *sbTargetMin;
	TExtBtn *ebTargetGroup;
	TExtBtn *ebSceneFile;
	TExtBtn *ebScene;
	TExtBtn *ebObjectList;
	TExtBtn *ebPreferences;
	TExtBtn *ExtBtn7;
	TExtBtn *ExtBtn8;
	TExtBtn *ExtBtn9;
	TExtBtn *ExtBtn10;
	TMxPopupMenu *pmSceneFile;
	TMenuItem *Clear1;
	TMenuItem *miOpen;
	TMenuItem *Save1;
	TMenuItem *SaveAs1;
	TMxPopupMenu *pmScene;
	TMenuItem *Options1;
	TMenuItem *Validate1;
	TMxPopupMenu *pmToolsEdit;
	TMxPopupMenu *pmToolsSelection;
	TMxPopupMenu *pmToolsVisibility;
	TMxPopupMenu *pmToolsLocking;
	TMenuItem *Cut1;
	TMenuItem *Copy1;
	TMenuItem *miPaste;
	TMenuItem *Undo1;
	TMenuItem *Redo1;
	TMenuItem *Delete1;
	TMenuItem *Invert1;
	TMenuItem *SelectAll1;
	TMenuItem *UnselectAll1;
	TMenuItem *HideAll1;
	TMenuItem *HideSelected1;
	TMenuItem *N1;
	TMenuItem *HideUnselected1;
	TMenuItem *UnhideAll1;
	TMenuItem *LockAll1;
	TMenuItem *LockSelection1;
	TMenuItem *LockUnselected1;
	TMenuItem *N2;
	TMenuItem *UnlockAll1;
	TMenuItem *UnlockSelected1;
	TMenuItem *UnlockUnselected1;
	TExtBtn *ebTargetPS;
	TPanel *paSnapList;
	TLabel *Label1;
	TExtBtn *ExtBtn16;
	TExtBtn *ebUseSnapList;
	TExtBtn *ExtBtn1;
	TMxPopupMenu *pmSnapListCommand;
	TMenuItem *MenuItem3;
	TMenuItem *MenuItem4;
	TListBox *lbSnapList;
	TBevel *Bevel1;
	TMenuItem *miAddSelectedToList;
	TExtBtn *ebTargetShape;
	TMxPopupMenu *pmObjectContext;
	TMenuItem *miVisibility;
	TMenuItem *HideSelected2;
	TMenuItem *HideUnselected2;
	TMenuItem *HideAll2;
	TMenuItem *N5;
	TMenuItem *UnhideAll2;
	TMenuItem *Locking1;
	TMenuItem *LockSelected1;
	TMenuItem *MenuItem1;
	TMenuItem *MenuItem2;
	TMenuItem *N6;
	TMenuItem *MenuItem5;
	TMenuItem *MenuItem6;
	TMenuItem *MenuItem7;
	TMenuItem *Edit1;
	TMenuItem *miCopy;
	TMenuItem *miPaste2;
	TMenuItem *miCut;
	TMenuItem *N4;
	TMenuItem *miProperties;
	TMenuItem *N3;
	TMenuItem *miRecentFiles;
	TMenuItem *Quit1;
	TExtBtn *ebProperties;
	TExtBtn *ebLightAnimationEditor;
	TExtBtn *ebImages;
	TMenuItem *N8;
	TMenuItem *N12;
	TMenuItem *N13;
	TMenuItem *N15;
	TMenuItem *N16;
	TMenuItem *N17;
	TMenuItem *N18;
	TMenuItem *N19;
	TMenuItem *N20;
	TExtBtn *ebTargetDO;
	TMenuItem *N22;
	TMenuItem *miSceneSummary;
	TExtBtn *ebSounds;
	TExtBtn *ExtBtn2;
	TExtBtn *ebTargetAIMap;
	TExtBtn *ebCompile;
	TMxPopupMenu *pmCompile;
	TMenuItem *MenuItem19;
	TMenuItem *MenuItem23;
	TMenuItem *MenuItem24;
	TMenuItem *MenuItem25;
	TMenuItem *MenuItem26;
	TMenuItem *MenuItem27;
	TMenuItem *MenuItem29;
	TMenuItem *MenuItem32;
	TMenuItem *MenuItem33;
	TMenuItem *MenuItem34;
	TMxPopupMenu *pmObjects;
	TMenuItem *MenuItem13;
	TMenuItem *MenuItem16;
	TMenuItem *MenuItem17;
	TMenuItem *ReloadObjects1;
	TMenuItem *CleanLibrary;
	TMxPopupMenu *pmImages;
	TMenuItem *N11;
	TMenuItem *ImageEditor1;
	TMenuItem *MenuItem8;
	TMenuItem *UpdateSceneTextures1;
	TMenuItem *N10;
	TMenuItem *MenuItem9;
	TMenuItem *MenuItem10;
	TMxPopupMenu *pmSounds;
	TMenuItem *MenuItem11;
	TMenuItem *MenuItem12;
	TMenuItem *MenuItem15;
	TMenuItem *MenuItem14;
	TMenuItem *UpdateEnvironmentGeometry1;
	TMenuItem *RemoveSelectedFromList1;
	TMenuItem *SelectObjectFromList1;
	TMenuItem *N9;
	TMenuItem *N14;
	TExtBtn *ebSnapListMode;
	TExtBtn *ebModeInvert;
	TBevel *Bevel2;
	TMenuItem *N21;
	TMenuItem *ebOpenSel;
	TMenuItem *ebSaveSel;
	TMenuItem *N23;
	TMenuItem *SynchronizeSounds1;
	TExtBtn *ebTargetWallmarks;
	TMenuItem *ExportErrorList1;
	TMenuItem *miHightlightTexture;
	TMenuItem *MakeSoundOccluder1;
	TMenuItem *N24;
	TMenuItem *N25;
	TMenuItem *ClearDebugDraw1;
	TExtBtn *ebMultiRename;
    TMenuItem *N7;
    TMenuItem *Editminimap1;
        TMenuItem *SyncTHM1;
        TMenuItem *N26;
        TMenuItem *Makepack1;
    void __fastcall ebClearClick(TObject *Sender);
    void __fastcall ebLoadClick(TObject *Sender);
    void __fastcall ebSaveClick(TObject *Sender);
    void __fastcall ebSaveAsClick(TObject *Sender);
    void __fastcall ebBuildClick(TObject *Sender);
    void __fastcall ebOptionsClick(TObject *Sender);
    void __fastcall ebCutClick(TObject *Sender);
    void __fastcall ebCopyClick(TObject *Sender);
    void __fastcall ebPasteClick(TObject *Sender);
    void __fastcall ebUndoClick(TObject *Sender);
    void __fastcall ebRedoClick(TObject *Sender);
    void __fastcall ebValidateSceneClick(TObject *Sender);
    void __fastcall ebObjectListClick(TObject *Sender);
    void __fastcall ebEditLibClick(TObject *Sender);
    void __fastcall TargetClick(TObject *Sender);
    void __fastcall PanelMimimizeClickClick(TObject *Sender);
    void __fastcall PanelMaximizeClick(TObject *Sender);
    void __fastcall ebEditorPreferencesClick(TObject *Sender);
    void __fastcall ebRefreshEditorClick(TObject *Sender);
	void __fastcall ebInvertClick(TObject *Sender);
	void __fastcall ebSelectAllClick(TObject *Sender);
	void __fastcall ebUnselectAllClick(TObject *Sender);
	void __fastcall ebDeleteClick(TObject *Sender);
	void __fastcall ebHideAllClick(TObject *Sender);
	void __fastcall ebHideSelectedClick(TObject *Sender);
	void __fastcall ebUnhideAllClick(TObject *Sender);
	void __fastcall ebHideUnselectedClick(TObject *Sender);
	void __fastcall ebLockAllClick(TObject *Sender);
	void __fastcall ebLockSelClick(TObject *Sender);
	void __fastcall ebLockUnselClick(TObject *Sender);
	void __fastcall ebUnlockAllClick(TObject *Sender);
	void __fastcall ebUnlockSelClick(TObject *Sender);
	void __fastcall ebUnlockUnselClick(TObject *Sender);
	void __fastcall ebMakeGameClick(TObject *Sender);
	void __fastcall ebSceneFileMouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall ebSceneMouseDown(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);
	void __fastcall ExtBtn7MouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall ExtBtn8MouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall ExtBtn10MouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall ExtBtn9MouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall ebClearSnapClick(TObject *Sender);
	void __fastcall ebSetSnapClick(TObject *Sender);
	void __fastcall ExtBtn1MouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall miAddSelectedToListClick(TObject *Sender);
	void __fastcall ebUseSnapListClick(TObject *Sender);
	void __fastcall RefreshObjects1Click(TObject *Sender);
	void __fastcall CheckNewTexturesClick(TObject *Sender);
	void __fastcall MakeDetailsClick(TObject *Sender);
	void __fastcall miPropertiesClick(TObject *Sender);
	void __fastcall CleanLibraryClick(TObject *Sender);
	void __fastcall Quit1Click(TObject *Sender);
	void __fastcall ebPropertiesClick(TObject *Sender);
	void __fastcall ebLightAnimationEditorClick(TObject *Sender);
	void __fastcall ebImagesMouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall ImageEditor1Click(TObject *Sender);
	void __fastcall MenuItem9Click(TObject *Sender);
	void __fastcall UpdateSceneTextures1Click(TObject *Sender);
	void __fastcall ImportCompilerErrorsClick(TObject *Sender);
	void __fastcall ebIgnoreModeClick(TObject *Sender);
	void __fastcall miClearErrorListClick(TObject *Sender);
	void __fastcall miSceneSummaryClick(TObject *Sender);
	void __fastcall MakeHOM1Click(TObject *Sender);
	void __fastcall UpdateEnvironmentGeometry1Click(TObject *Sender);
	void __fastcall MenuItem14Click(TObject *Sender);
	void __fastcall ebSoundsMouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall ExtBtn2MouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall MakeAIMap1Click(TObject *Sender);
	void __fastcall ebCompileMouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
	void __fastcall SelectObjectFromList1Click(TObject *Sender);
	void __fastcall RemoveSelectedFromList1Click(TObject *Sender);
	void __fastcall ebSnapListModeClick(TObject *Sender);
	void __fastcall ebOpenSelClick(TObject *Sender);
	void __fastcall ebSaveSelClick(TObject *Sender);
	void __fastcall MenuItem12Click(TObject *Sender);
	void __fastcall SynchronizeSounds1Click(TObject *Sender);
	void __fastcall ExportErrorList1Click(TObject *Sender);
	void __fastcall miHightlightTextureClick(TObject *Sender);
	void __fastcall MakeSoundOccluder1Click(TObject *Sender);
	void __fastcall ClearDebugDraw1Click(TObject *Sender);
	void __fastcall ebMultiRenameClick(TObject *Sender);
    void __fastcall Editminimap1Click(TObject *Sender);
        void __fastcall SyncTHM1Click(TObject *Sender);
        void __fastcall Makepack1Click(TObject *Sender);
private:	// User declarations
    void RedrawBar();
	void __fastcall miRecentFilesClick(TObject *Sender);
    xr_vector<TExtBtn*>	m_TargetButtons;
public:		// User declarations
        __fastcall TfraLeftBar(TComponent* Owner);
	void ChangeTarget(ObjClassID tgt);
    void UpdateSnapList();
    void MinimizeAllFrames();
    void MaximizeAllFrames();
    void UpdateBar();
    void OnTimer();
    void RefreshBar();
};
//---------------------------------------------------------------------------
extern PACKAGE TfraLeftBar *fraLeftBar;
//---------------------------------------------------------------------------
#endif


text:
var docElem = window.document.documentElement,
	transEndEventNames = {
		'WebkitTransition': 'webkitTransitionEnd',
		'MozTransition': 'transitionend',
		'OTransition': 'oTransitionEnd',
		'msTransition': 'MSTransitionEnd',
		'transition': 'transitionend'
	},
	transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ],
	support = {
		pointerevents : Modernizr.pointerevents,
		csstransitions : Modernizr.csstransitions,
		csstransforms3d : Modernizr.csstransforms3d
	};

function scrollX() {
	return window.pageXOffset || docElem.scrollLeft;
}

function scrollY() {
	return window.pageYOffset || docElem.scrollTop;
}

function getOffset(el) {
	var offset = el.getBoundingClientRect();
	return { top : offset.top + scrollY(), left : offset.left + scrollX() };
}

// from http://responsejs.com/labs/dimensions/
function getViewportW() {
	var client = docElem['clientWidth'],
		inner = window['innerWidth'];

	if( client < inner )
		return inner;
	else
		return client;
}

function getViewportH() {
	var client = docElem['clientHeight'],
		inner = window['innerHeight'];

	if( client < inner )
		return inner;
	else
		return client;
}

function extend( a, b ) {
	for( var key in b ) {
		if( b.hasOwnProperty( key ) ) {
			a[key] = b[key];
		}
	}
	return a;
}


text:
import os
import sqlite3

import numpy as np
import pandas as pd

from app.data import CRUDMixin, db

sensors = Blueprint("sensors", __name__, static_folder='static', template_folder='templates')

DATABASE = 'app.db'

FILES = ['file.csv']

class CSVHelper():
    def csv2sql(conn, files):


text:
package ca.ualberta.cs.cmput301f14t14.questionapp.data;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

/**
 * This class handles data that only exists on the client, and is
 * never transferred to the web service.
 *
 * The back-end for this data store is Android SharedPreferences.
 */
public class ClientData {

	private static final String PREF_SET = "cs.ualberta.cs.cmput301f14t14.questionapp.prefs";
	private static final String VAL_USERNAME = "username";
	private static final String VAL_FAVORITES_LIST = "favqlist";
	private static final String VAL_READ_LATER_LIST = "readlaterlist";
	private static final String VAL_UPVOTED_LIST = "upvotelist";

	private SharedPreferences prefs;

	public ClientData(Context context) {
		this.prefs = context.getSharedPreferences(PREF_SET, Context.MODE_PRIVATE);
	}

	/**
	 * Get username record
	 * @return
	 */
	public String getUsername() {
		return this.prefs.getString(VAL_USERNAME, null);
	}

	/**
	 * Set username record
	 * @param username
	 */
	public void setUsername(String username) {
		username = username.trim();
		if (username.length() == 0) {
			throw new IllegalArgumentException("New username may not be blank.");
		}
		Editor e = prefs.edit();
		e.putString(VAL_USERNAME, username);
		e.apply();
	}

	/**
	 * Get a list UUIDs for favorite items
	 * @return List of UUIDs
	 */
	public List<UUID> getFavorites() {
		return getItems(VAL_FAVORITES_LIST);
	}

	/**
	 * Set the list of UUIDs for favorite items
	 * @param list List of UUIDs
	 */
	public void saveFavorites(List<UUID> list){
		saveItems(list, VAL_FAVORITES_LIST);
	}

	/**
	 * Set the list of UUIDs for items to read later
	 * @return List of UUIDs
	 */
	public List<UUID> getReadLaterItems() {
		return getItems(VAL_READ_LATER_LIST);
	}

	/**
	 * Add a UUID to the read later list
	 * @param u UUID
	 */
	public void markReadLater(UUID u) {
		List<UUID> appendlist = getItems(VAL_READ_LATER_LIST);
		appendlist.add(u);
		saveItems(appendlist, VAL_READ_LATER_LIST);
	}

	/**
	 * Remove a UUID from the read later list
	 * @param u UUID
	 */
	public void unmarkReadLater(UUID u){
		List<UUID> list = getItems(VAL_READ_LATER_LIST);
		list.remove(u);
		saveItems(list,VAL_READ_LATER_LIST);
	}

	/**
	 * Check if an item's UUID is in the read later list.
	 *
	 * A user will still have to call the DataManager to get
	 * the desired item.
	 * @param id UUID of item
	 * @return True if the item is in the list, false otherwise.
	 */
	public boolean isReadLater(UUID id) {
		List<UUID> rllist = getItems(VAL_READ_LATER_LIST);
		if (rllist.contains(id)) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * Add an item's UUID to the list of items that have been upvoted
	 * @param id UUID
	 */
	public void markItemUpvoted(UUID id) {
		List<UUID> upvoteList = getItems(VAL_UPVOTED_LIST);
		upvoteList.add(id);
		saveItems(upvoteList, VAL_UPVOTED_LIST);
	}

	/**
	 * Check that a UUID is in the list of items that have been upvoted
	 * @param id UUID
	 * @return True if an item has been upvoted, false otherwise
	 */
	public boolean isItemUpvoted(UUID id) {
		List<UUID> list = getItems(VAL_UPVOTED_LIST);
		return (list.contains(id)) ? true : false;
	}

	/**
	 * Get a list of UUIDs from a named list
	 * @param name Name of list
	 * @return List of UUIDs
	 */
	private List<UUID> getItems(String name) {
		// Get set of data from SharedPreferences
		Set<String> set = prefs.getStringSet(name, null);

		// Set may be null on first run of app
		if (set == null) {
			return new ArrayList<UUID>();
		}

		// Need to build up a new set of UUIDs before converting to List
		Set<UUID> intermediateSet = new HashSet<UUID>();
		for (String s: set) {
			if (s == null) continue;
			intermediateSet.add(UUID.fromString(s));
		}

		// Construct the final list
		ArrayList<UUID> returnlist = new ArrayList<UUID>();
		returnlist.addAll(intermediateSet);
		return returnlist;
	}

	/**
	 * Save a list of UUIDs to a named list
	 * @param list List of UUIDs
	 * @param name Name of list
	 */
	private void saveItems(List<UUID> list, String name) {
		Editor e = prefs.edit();
		Set<String> set = new HashSet<String>();

		for (UUID i: list) {
			set.add(i.toString());
		}
		e.putStringSet(name, set);
		e.commit();
	}

	/**
	 * Clear all data in this store
	 */
	public void clear() {
		Editor e = prefs.edit();
		e.clear();
		e.apply();
	}

}


text:
package gov.hhs.fha.nhinc.admingui.display;

import gov.hhs.fha.nhinc.admingui.services.FhirResourceService;
import gov.hhs.fha.nhinc.connectmgr.ConnectionManagerCache;
import gov.hhs.fha.nhinc.connectmgr.ConnectionManagerException;
import gov.hhs.fha.nhinc.nhinclib.NhincConstants;
import gov.hhs.fha.nhinc.nhinclib.NullChecker;
import org.apache.log4j.Logger;

/**
 *
 * @author jassmit
 */
public class FhirDisplayController implements DisplayController {

    private static final Logger LOG = Logger.getLogger(FhirDisplayController.class);

    @Override
    public void checkDisplay() {
        String[] resourceNames = new String[]{FhirResourceService.BINARY_RESOURCE_NAME, FhirResourceService.DOCREF_RESOURCE_NAME,
            FhirResourceService.PATIENT_RESOURCE_NAME};

        for (String resourceName : resourceNames) {
            boolean hasResource;
            try {
                hasResource = checkForResource(resourceName);
            } catch (ConnectionManagerException e) {
                LOG.warn(e.getLocalizedMessage(), e);
                hasResource = false;
            }

            if (hasResource) {
                DisplayHolder.getInstance().setFhirEnabled(hasResource);
                return;
            }
        }
        DisplayHolder.getInstance().setFhirEnabled(false);
    }

    private boolean checkForResource(String resourceName) throws ConnectionManagerException {
        return NullChecker.isNotNullish(ConnectionManagerCache.getInstance().getAdapterEndpointURL(resourceName, NhincConstants.ADAPTER_API_LEVEL.LEVEL_a0));
    }

}


text:
package constants

import "github.com/tinycedar/vanilla/runtime/thread"

type fconst_x struct {
	opCode   uint8
	constVal float32
}

func (l *fconst_x) Execute(f *thread.Frame) {
	f.OperandStack().PushFloat(l.constVal)
}


text:
<?php
/**
 * Twig extension for miscellaneous functions or filters
 *
 * @author Allejo Chris G. Velarde
 */
namespace HealthCareAbroad\HelperBundle\Twig;

use HealthCareAbroad\HelperBundle\Entity\ContactDetail;

use HealthCareAbroad\HelperBundle\Entity\SocialMediaSites;

use HealthCareAbroad\HelperBundle\Entity\ContactDetailTypes;

use HealthCareAbroad\InstitutionBundle\Entity\InstitutionMedicalCenter;

use HealthCareAbroad\InstitutionBundle\Entity\Institution;

class MiscellaneousTwigExtension extends \Twig_Extension
{
    private $classKeys;
    private $classLabels;

    private static $institutionDefaultAddressKeys = array('address1', 'state', 'city', 'country', 'zipCode');

    public function setClassKeys($keys)
    {
        $this->classKeys = $keys;
    }

    public function setClassLabels($labels)
    {
        $this->classLabels = $labels;
    }

    public function getFunctions()
    {
        return array(
            'contact_details_to_json' => new \Twig_Function_Method($this, 'contactDetailsToJSON'),
            'getClass' => new \Twig_Function_Method($this, 'getClass'),
            'getClassLabel' => new \Twig_Function_Method($this, 'getClassLabel'),
            'get_class_label_by_fully_qualified_name' => new \Twig_Function_Method($this, 'getClassLabelByFullyQualifiedName'),
            'getClassLabels' => new \Twig_Function_Method($this, 'getClassLabels'),
            'base64_encode' => new \Twig_Function_Method($this, 'base64_encode'),
            'unserialize' => new \Twig_Function_Method($this, 'unserialize'),
            'institution_address_to_array' => new \Twig_Function_Method($this, 'institutionAddressToArray'),
            'institution_address_to_string' => new \Twig_Function_Method($this, 'formatInstitutionAddressToString'),
            'social_media_sites_to_array' => new \Twig_Function_Method($this, 'socialMedialSitesToArray'),
            'json_decode' => new  \Twig_Function_Method($this, 'json_decode'),
            'json_encode' => new  \Twig_Function_Method($this, 'json_encode'),
            'unset_array_key' => new \Twig_Function_Method($this, 'unset_array_key'),
            'json_to_array' => new \Twig_Function_Method($this, 'json_to_array'),
            'get_social_media_site_placeholder' => new \Twig_Function_Method($this, 'getSocialMediaSitePlaceHolder'),
            'get_social_media_site_label' => new \Twig_Function_Method($this, 'getSocialMediaSiteLabel'),
            'contact_detail_type_has_extension' => new \Twig_Function_Method($this, 'contactDetailTypeHasExtension'),
            'array_flip' => new \Twig_Function_Method($this, 'arrayFlip'),
            'array_replace' => new \Twig_Function_Method($this, 'arrayReplace'),
        );
    }

    public function contactDetailsToJSON(array $contactDetails = array())
    {
        $byType = array();
        foreach ($contactDetails as $contactDetailData) {

            if ($contactDetailData instanceof ContactDetail) {
                $contactDetailInstance = $contactDetailData;
            }
            elseif (\is_array($contactDetailData)) {
                // hydrated as array
                $contactDetailInstance = new ContactDetail();
                $contactDetailInstance->setCountryCode($contactDetailData['countryCode']);
                $contactDetailInstance->setAreaCode($contactDetailData['areaCode']);
                $contactDetailInstance->setNumber($contactDetailData['number']);
                $contactDetailInstance->setType($contactDetailData['type']);
            }
            else {
                // unknown type that we can't handle
                continue;
            }

            $byType[$contactDetailInstance->getType()] = array(
                'type' => ContactDetailTypes::getTypeLabel($contactDetailInstance->getType()),
                'number' => $contactDetailInstance->__toString()
            );
        }

        if (!\count($byType)) {
            return null;
        }

        return \json_encode($byType);
    }

    public function contactDetailTypeHasExtension($contactDetailType)
    {
        // as of now we only know of mobile number that has no ext
        return ContactDetailTypes::MOBILE == $contactDetailType ? false: true;
    }

    public function base64_encode($s) {
        return \base64_encode($s);
    }

    public function getClass($object, $nameOnly = false)
    {
        $class = \get_class($object);

        if($nameOnly) {
            $class = explode('\\', $class);
            $class = array_pop($class);
        }

        return $class;
    }

    public function getClassLabels($classKeys=array())
    {
        $labels = array();
        foreach ($classKeys as $classKey) {
            $labels[$classKey] = $this->getClassLabel($classKey);
        }

        return $labels;
    }

    /**
     * Get label for class.
     *
     * @param mixed $classKey
     * @param boolean $plural
     */
    public function getClassLabel($classKey)
    {
        if (\is_object($classKey)) {
            $r = \array_flip($this->classKeys);
            $class = $this->getClass($classKey);
            if (!\array_key_exists($class, $r)) {
                throw new \Exception("Unable to find class key for class {$class}");
            }

            $classKey = $r[$class];
        }

        if (!\array_key_exists($classKey, $this->classLabels)) {
            throw new \Exception("Unable to find label for class {$classKey}");
        }

        return $this->classLabels[$classKey];
    }

    public function getClassLabelByFullyQualifiedName($class)
    {
        $r = \array_flip($this->classKeys);
        $classLabel = null;
        if (\array_key_exists($class, $r)){
            $classKey = $r[$class];
            if (!\array_key_exists($classKey, $this->classLabels)) {
                throw new \Exception("Unable to find label for class {$classKey}");
            }
            $classLabel = $this->classLabels[$classKey];
        }

        return $classLabel;
    }

    public function getName()
    {
        return 'miscellaneous';
    }

    public function json_encode($jsonArray)
    {
        return  \json_encode($jsonArray);
    }

    public function json_decode($jsonData)
    {
        return json_decode($jsonData, true);
    }

    /**
     * Alias to json_decode with option to not include empty values
     *
     * @param string $jsonString
     * @param boolean $includeEmptyValues
     */
    public function json_to_array($jsonString, $includeEmptyValues=true)
    {
        $returnVal = \json_decode($jsonString, true);

        if (!\is_null($returnVal)) {
            if (!$includeEmptyValues) {
                foreach ($returnVal as $k => $v) {
                    if (\is_null($v) || '' == \trim($v)) {
                        unset($returnVal[$k]);
                    }
                }
            }
        }
        else {
            // invalid JSON string
            $returnVal = array();
        }

        return $returnVal;
    }

    /**
     * Convert institution address to array
     *     - address1
     *     - city
     *     - state
     *     - country
     *     - zip code
     *
     * @param Mixed <Institution, array> $institution
     */
    public function institutionAddressToArray($institution, array $includedKeys=array(), $options=array())
    {
        // default options to tweak returned format
        $defaultOptions = array(
            // wrap values in span containing microdata markup @see http://schema.org/PostalAddress
            'wrapWithMicrodata' => false,
        );
        $options = \array_merge($defaultOptions, $options);

        $elements = array();
        $includedKeys = \array_flip(!empty($includedKeys) ? $includedKeys : self::$institutionDefaultAddressKeys);

        if ($institution instanceof Institution){
            $addressData = array(
                'address1' => $institution->getAddress1(),
                'city' => $institution->getCity() ? $institution->getCity()->getName() : null,
                'state' => $institution->getState() ? $institution->getState()->getName() : null,
                'country' => $institution->getCountry() ? $institution->getCountry()->getName() : null,
                'zipCode' => \trim($institution->getZipCode())
            );
        }
        elseif (\is_array($institution)) {
            // hydrated with HYDRATE_ARRAY
            $addressData = array(
                'address1' => $institution['address1'],
                'city' => isset($institution['city']) ? $institution['city']['name'] : null,
                'state' => isset($institution['state']) ? $institution['state']['name'] : null,
                'country' => isset($institution['country']) ? $institution['country']['name'] : null,
                'zipCode' => isset($institution['zipCode']) ? \trim($institution['zipCode']) : null,
            );
        }

        $street_address = \json_decode($addressData['address1'], true);
        if (isset($includedKeys['address1']) && !\is_null($street_address)) {
            $this->_removeEmptyValueInArray($street_address);
            if (\count($street_address)) {
                $elements['address1'] = preg_replace('/\,+$/','', \trim(\implode(', ', $street_address)));
                // wrap in microdata
                $elements['address1'] = $options['wrapWithMicrodata']
                    ? ''.$elements['address1'].''
                    : $elements['address1'];
            }
        }

        if (isset($includedKeys['city']) && $addressData['city']) {
            $elements['city'] = $options['wrapWithMicrodata']
                ? ''.$addressData['city'].''
                : $addressData['city'];
        }

        if (isset($includedKeys['state']) && $addressData['state']) {
            $elements['state'] = $options['wrapWithMicrodata']
                ? ''.$addressData['state'].''
                : $addressData['state'];
        }

        if (isset($includedKeys['country']) && $addressData['country']) {
            $elements['country'] = $options['wrapWithMicrodata']
                ? ''.$addressData['country'].''
                : $addressData['country'];
        }

        if (isset($includedKeys['zipCode']) && (0 != $addressData['zipCode'] || '' != $addressData['zipCode'] )) {
            $elements['zipCode'] = $options['wrapWithMicrodata']
                ? ''.$addressData['zipCode'].''
                : $addressData['zipCode'];
        }

        return $elements;
    }

    /**
     * Convert institution address to string
     *     - address1
     *     - city
     *     - state
     *     - country
     *     - zip code
     *
     * @param Mixed <Institution, array> $institution
     */
    public function formatInstitutionAddressToString($institution, array $includedKeys=array(), $glue = ', ', $options=array())
    {
        $arrAddress = $this->institutionAddressToArray($institution, $includedKeys, $options);

        $zipCode = '';
        if(isset($arrAddress['zipCode'])) {
            $zipCode = ' ' . $arrAddress['zipCode'];
            unset($arrAddress['zipCode']);
        }

        return ucwords(implode($glue, $arrAddress)) . $zipCode;
    }

    public function unset_array_key($key, $arr)
    {
        if (\array_key_exists($key, $arr)) {
            unset($arr[$key]);
        }

        return $arr;
    }

    public function institutionWebsitesToArray(Institution $institution)
    {
        return $this->jsonWebsitesToArray($institution->getSocialMediaSites());
    }

    public function institutionMedicalCenterWebsitesToArray(InstitutionMedicalCenter $institutionMedicalCenter)
    {
        return $this->jsonWebsitesToArray($institutionMedicalCenter->getSocialMediaSites());
    }

    public function socialMedialSitesToArray($jsonString)
    {
         $arrData = json_decode($jsonString, true);

         if(!\is_array($arrData) || empty($arrData)) {
             $arrData = SocialMediaSites::getDefaultValues();
         }

         return $arrData;
    }

    public function getSocialMediaSitePlaceHolder($type)
    {
        return SocialMediaSites::getPlaceHolderByType($type);
    }

    public function getSocialMediaSiteLabel($type)
    {
        return SocialMediaSites::getLabelByType($type);
    }

    public function arrayFlip(array $arrayData)
    {
        return array_flip($arrayData);
    }

    public function arrayReplace(array $array1, array $array2)
    {
        return array_replace($array1, $array2);
    }

    private function _removeEmptyValueInArray(&$array = array())
    {
        foreach ($array as $k => $v) {
            if (\is_null($v) || '' == \trim($v)) {
                unset($array[$k]);
            }
        }
    }
}


text:
import 'pixi.js';

import Texture = PIXI.Texture;
import DisplayObject = PIXI.DisplayObject;
import Container = PIXI.Container;
import Graphics = PIXI.Graphics;
import {SelectionStripe} from "./SelectionStripe";
import {RenderableElement} from "../../utilities/RenderableElement";
import {SelectionPointer} from "./SelectionPointer";
import {Player} from "../../utilities/Player";
import {Coin} from "./Coin";
import {UpdateableElement} from "../../utilities/UpdateableElement";
import {CoinsTracker} from "../../utilities/CoinsTracker";

export class GameBoard implements RenderableElement, UpdateableElement{
    public static readonly ROWxCOLUMN:[number, number] = [6, 7];
    public static readonly COIN_MARGIN = 20;
    public static readonly BOARD_PADDING = 20;
    public static readonly BOARD_WIDTH = 580;
    public static readonly BOARD_HEIGHT = 500;
    public static readonly BOARD_MARGIN_TOP = 50;

    private readonly boardSprite: PIXI.Sprite;
    private readonly coinsTracker: CoinsTracker;
    private readonly selectionStripes: SelectionStripe[] = [];
    private readonly selectionPointers: SelectionPointer[] = [];
    private readonly onGameOver: (player?: Player) => void;
    private readonly onActivePlayerChange: (player: Player) => void;

    private allCoins: Coin[] = [];
    private activePlayer: Player;

    constructor(activePlayer: Player, onGameOver: (player?: Player) => void, onActivePlayerChange: (player: Player) => void){
        this.activePlayer = activePlayer;
        this.onGameOver = onGameOver;
        this.onActivePlayerChange = onActivePlayerChange;
        this.coinsTracker = new CoinsTracker(GameBoard.ROWxCOLUMN);

        for(var columnIndex = 0; columnIndex < GameBoard.ROWxCOLUMN[1]; columnIndex++){
            let selectionStripe = new SelectionStripe(columnIndex);
            selectionStripe.subscribeTo_onMouseOver((stripeIndex:number) => this.onSelectionStripeMouseOver(stripeIndex));
            selectionStripe.subscribeTo_onMouseOut((stripeIndex:number) => this.onSelectionStripeMouseOut(stripeIndex));
            selectionStripe.subscribeTo_onMouseClick((stripeIndex:number) => this.onSelectionStripeMouseClick(stripeIndex));
            this.selectionStripes.push(selectionStripe);
            let immutableColumnIndex = columnIndex;
            this.selectionPointers.push(new SelectionPointer(columnIndex, () => this.coinsTracker.isEmptySlotAvailable(immutableColumnIndex) && !this.coinsTracker.isGameOver()));
        }

        this.boardSprite = this.buildBoardSprite();
    }
    private buildBoardSprite(): PIXI.Sprite {
        let texture = PIXI.loader.resources["./images/board.png"].texture;
        let sprite = new PIXI.Sprite(texture);
        sprite.width = GameBoard.BOARD_WIDTH;
        sprite.height = GameBoard.BOARD_HEIGHT;
        sprite.position.y = GameBoard.BOARD_MARGIN_TOP;
        return sprite;
    }

    private dropCoin(columnIndex: number): void {
        let rowAndColumnIndex = this.coinsTracker.addCoin(this.activePlayer, columnIndex);
        let coin = new Coin(
                this.activePlayer,
                rowAndColumnIndex,
                GameBoard.getCenter(rowAndColumnIndex[0], rowAndColumnIndex[1]));
        this.allCoins.push(coin);
    }

    private onSelectionStripeMouseOver(stripeIndex: number): void {
        this.selectionStripes
            .filter((stripe: SelectionStripe) => stripe.index !== stripeIndex)
            .forEach((stripe: SelectionStripe) => stripe.setFocus(false));
        this.selectionPointers
            .find((pointer: SelectionPointer) => pointer.stripeIndex === stripeIndex)
            .show(this.activePlayer);
    }

    private onSelectionStripeMouseOut(stripeIndex: number): void {
        this.selectionPointers
            .find((pointer: SelectionPointer) => pointer.stripeIndex === stripeIndex)
            .hide();
    }

    private onSelectionStripeMouseClick(stripeIndex: number): void {
        if(this.coinsTracker.isEmptySlotAvailable(stripeIndex) && !this.coinsTracker.isGameOver()) {
            this.dropCoin(stripeIndex);

            if(this.coinsTracker.isWin()){
                this.coinsTracker.getWinningCoinPositions()
                    .forEach((coinIndexPosition: [number, number]) =>
                        this.allCoins
                            .find((coin: Coin) => coin.rowAndColumnIndex[0] === coinIndexPosition[0] && coin.rowAndColumnIndex[1] === coinIndexPosition[1])
                            .markAsWinningCoin());
                this.onGameOver(this.coinsTracker.getWinner());
            } else if(this.coinsTracker.isTie()){
                this.onGameOver(null);
            } else {
                this.switchActivePlayer();
            }
        }
    }

    private switchActivePlayer(): void {
        this.activePlayer =
            this.activePlayer === Player.Blue
            ? Player.Red
            : Player.Blue;
        this.onActivePlayerChange(this.activePlayer);
    }

    public startNewGame(player: Player): void {
        this.coinsTracker.reset();
        this.allCoins = [];
        this.activePlayer = player;
    }

    public update(): void {
        this.allCoins.forEach(coin => coin.update());
    }

    public getStage(): PIXI.Container {
        let stage = new PIXI.Container();

        this.allCoins.forEach(coin => stage.addChild(coin.getStage()));
        stage.addChild(this.boardSprite);
        this.selectionStripes.forEach(stripe => stage.addChild(stripe.getStage()));
        this.selectionPointers.forEach(pointer => stage.addChild(pointer.getStage()));

        return stage;
    }

    public static getCenter(column: number, row: number): PIXI.Point{
        let x = this.getColumnCenter(column);
        let y = this.getRowCenter(row);
        return new PIXI.Point(x, y);
    }
    public static getColumnCenter(column: number): number{
        return GameBoard.BOARD_PADDING
            + Coin.DIAMETER/2
            + column * (GameBoard.COIN_MARGIN + Coin.DIAMETER);
    }
    public static getRowCenter(row: number): number{
        return GameBoard.BOARD_MARGIN_TOP
            + GameBoard.BOARD_PADDING
            + Coin.DIAMETER/2
            + (GameBoard.ROWxCOLUMN[0] - 1 - row)*(Coin.DIAMETER + GameBoard.COIN_MARGIN);
    }
}


text:
<?php

declare(strict_types=1);

namespace Teknoo\States\PHPStan\Reflection;

use PhpParser\Node\Expr\Variable;
use PhpParser\Node\IntersectionType;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\NullableType;
use PhpParser\Node\Param;
use PhpParser\Node\UnionType;
use PHPStan\BetterReflection\BetterReflection;
use PHPStan\BetterReflection\Util\Exception\NoNodePosition;
use PHPStan\Reflection\Php\BuiltinMethodReflection;
use PHPStan\TrinaryLogic;
use PHPStan\BetterReflection\Reflection\Adapter\ReflectionClass;
use PHPStan\BetterReflection\Reflection\Adapter\ReflectionFunction;
use PHPStan\BetterReflection\Reflection\ReflectionFunction as BetterReflectionFunction;
use PHPStan\BetterReflection\Reflection\Adapter\ReflectionIntersectionType;
use PHPStan\BetterReflection\Reflection\Adapter\ReflectionMethod;
use PHPStan\BetterReflection\Reflection\Adapter\ReflectionNamedType;
use PHPStan\BetterReflection\Reflection\Adapter\ReflectionParameter;
use PHPStan\BetterReflection\Reflection\Adapter\ReflectionUnionType;
use PHPStan\BetterReflection\Reflection\ReflectionParameter as BetterReflectionParameter;
use ReflectionIntersectionType as NativeReflectionIntersectionType;
use ReflectionMethod as NativeReflectionMethod;
use ReflectionFunction as NativeReflectionFunction;
use ReflectionNamedType as NativeReflectionNamedType;
use ReflectionUnionType as NativeReflectionUnionType;

use function array_map;

/**
 * To provide a PHPStan reflection for state's methode in a stated class.
 *
 * State's method are cloure binded dynamically to the parent scope, So the APIs Reflection provides a
 * `ReflectionFunction` instead of `ReflectionMethod` and lost method's status about visibility (private/public),
 * static etc.. *
 *
 * This class provide a valid PHPStan reflection for these method from the PHPStan API Reflection on the closure
 * and the closure factory. A fallback to native API Reflection is provided when PHPSTan's Reflection is not available
 * for states classes (disable by AST Visitor of States to avoid anothers false positives)
 *
 * @see http://php.net/manual/en/class.arrayaccess.php
 *
 * @copyright   Copyright (c) EIRL Richard Déloge (richarddeloge@gmail.com)
 * @copyright   Copyright (c) SASU Teknoo Software (https://teknoo.software)
 *
 * @link        http://teknoo.software/states Project website
 *
 * @license     http://teknoo.software/license/mit         MIT License
 * @author      Richard Déloge <richarddeloge@gmail.com>
 */
class StateMethod implements BuiltinMethodReflection
{
    public function __construct(
        private readonly ReflectionMethod|NativeReflectionMethod $factoryReflection,
        private readonly ReflectionFunction|NativeReflectionFunction $closureReflection,
        private readonly ReflectionClass $reflectionClass,
    ) {
    }

    public function getName(): string
    {
        return $this->factoryReflection->getName();
    }

    public function getReflection(): ?ReflectionMethod
    {
        if ($this->factoryReflection instanceof ReflectionMethod) {
            return $this->factoryReflection;
        }

        return null;
    }

    public function getFileName(): ?string
    {
        if (empty($fileName = $this->factoryReflection->getFileName())) {
            return null;
        }

        return $fileName;
    }

    public function getDeclaringClass(): ReflectionClass
    {
        return $this->reflectionClass;
    }

    public function getStartLine(): ?int
    {
        if (empty($startLine = $this->closureReflection->getStartLine())) {
            return null;
        }

        return $startLine;
    }

    public function getEndLine(): ?int
    {
        if (empty($endLine = $this->closureReflection->getEndLine())) {
            return null;
        }

        return $endLine;
    }

    public function getDocComment(): ?string
    {
        $doc = $this->factoryReflection->getDocComment();

        if (false === $doc) {
            return null;
        }

        return $doc;
    }

    public function isStatic(): bool
    {
        return $this->factoryReflection->isStatic();
    }

    public function isPrivate(): bool
    {
        return $this->factoryReflection->isPrivate();
    }

    public function isPublic(): bool
    {
        return $this->factoryReflection->isPublic();
    }

    public function getPrototype(): BuiltinMethodReflection
    {
        return $this;
    }

    public function isDeprecated(): TrinaryLogic
    {
        return TrinaryLogic::createFromBoolean($this->factoryReflection->isDeprecated());
    }

    public function isFinal(): bool
    {
        return $this->factoryReflection->isFinal();
    }

    public function isInternal(): bool
    {
        return $this->factoryReflection->isInternal();
    }

    public function isAbstract(): bool
    {
        return $this->factoryReflection->isAbstract();
    }

    public function isVariadic(): bool
    {
        return $this->closureReflection->isVariadic();
    }

    public function getReturnType(): ReflectionIntersectionType|ReflectionNamedType|ReflectionUnionType|null
    {
        if (!$this->closureReflection instanceof ReflectionFunction) {
            return null;
        }

        return $this->closureReflection->getReturnType();
    }

    public function getTentativeReturnType(): ReflectionIntersectionType|ReflectionNamedType|ReflectionUnionType|null
    {
        return null;
    }

    /**
     * @return ReflectionParameter[]
     */
    public function getParameters(): array
    {
        if (!$this->closureReflection instanceof ReflectionFunction) {
            //Simulate a BetterReflectionFunction behavior when the extension was not able
            //to create it (ast node must be removed by ASTVisitor to avoid false postive)
            $final = [];
            foreach ($this->closureReflection->getParameters() as $parameter) {
                $default = null;
                if ($parameter->isOptional() && null !== ($defaultValue = $parameter->getDefaultValue())) {
                    $default = new Variable($defaultValue);
                }

                $finalType = null;
                if (null !== ($type = $parameter->getType())) {
                    if ($type instanceof NativeReflectionIntersectionType) {
                        $finalType = new IntersectionType(
                            array_map(
                                fn ($namedType) => new Name($namedType->getName()),
                                $type->getTypes()
                            )
                        );
                    } elseif ($type instanceof NativeReflectionUnionType) {
                        $allowNull = $type->allowsNull();
                        $types = array_map(
                            function ($namedType) use (&$allowNull) {
                                $allowNull = $allowNull || $namedType->allowsNull();
                                return new Name($namedType->getName());
                            },
                            $type->getTypes()
                        );
                        if (true === $allowNull) {
                            $types[] = new Identifier('null');
                        }
                        $finalType = new UnionType($types);
                    } elseif ($type instanceof NativeReflectionNamedType) {
                        $finalType = new Name($type->getName());
                        if ($type->allowsNull()) {
                            $finalType = new NullableType($finalType);
                        }
                    }
                }

                $final[] = new ReflectionParameter(
                    BetterReflectionParameter::createFromNode(
                        reflector: (new BetterReflection())->reflector(),
                        node: new Param(
                            var: new Variable((string) $parameter->getName()),
                            default: $default,
                            type: $finalType,
                            byRef: $parameter->isPassedByReference(),
                            variadic: $parameter->isVariadic(),
                            attributes: $parameter->getAttributes(),
                            flags: 0,
                        ),
                        function: new class ($this->factoryReflection) extends BetterReflectionFunction {
                            public function __construct(
                                private readonly NativeReflectionMethod $method,
                            ) {
                            }

                            //@codeCoverageIgnoreStart
                            public function inNamespace(): bool
                            {
                                return false;
                            }

                            public function getFileName(): ?string
                            {
                                return null;
                            }

                            public function getShortName(): string
                            {
                                return $this->method->getShortName();
                            }
                            //@codeCoverageIgnoreEnd

                            public function getLocatedSource(): never
                            {
                                //Throw an exception to hack BetterReflectionParaneeter constructor
                                //To not extract lines
                                throw new NoNodePosition();
                            }
                        },
                        parameterIndex: $parameter->getPosition(),
                        isOptional: $parameter->isOptional(),
                    )
                );
            }

            return $final;
        }

        return $this->closureReflection->getParameters();
    }

    public function returnsByReference(): TrinaryLogic
    {
        if ($this->closureReflection->returnsReference()) {
            return TrinaryLogic::createYes();
        }

        return TrinaryLogic::createNo();
    }
}


text:
"""
Benchmarks for ``@vectorize`` ufuncs.
"""

import numpy as np

from numba import vectorize

@vectorize(["float32(float32, float32)",
            "float64(float64, float64)",
            "complex64(complex64, complex64)",
            "complex128(complex128, complex128)"])
def mul(x, y):
    return x * y

@vectorize(["float32(float32, float32)",
            "float64(float64, float64)"])
def rel_diff(x, y):
    # XXX for float32 performance, we should write `np.float32(2)`, but
    # that's not the natural way to write this code...
    return 2 * (x - y) / (x + y)

class Vectorize:

    n = 10000
    dtypes = ('float32', 'float64', 'complex64', 'complex128')

    def setup(self):
        self.samples = {}
        self.out = {}
        for dtype in self.dtypes:
            self.samples[dtype] = np.linspace(0.1, 1, self.n, dtype=dtype)
            self.out[dtype] = np.zeros(self.n, dtype=dtype)

    def _binary_func(func, dtype):
        def f(self):
            func(self.samples[dtype], self.samples[dtype], self.out[dtype])
        return f

    for dtype in dtypes:
        locals()['time_mul_%s' % dtype] = _binary_func(mul, dtype)

    time_rel_diff_float32 = _binary_func(rel_diff, 'float32')
    time_rel_diff_float64 = _binary_func(rel_diff, 'float64')

    del _binary_func


text:
package org.herbst.ndao.usertype;

import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.usertype.UserType;

import java.io.Serializable;
import java.sql.*;

/**
 * Created by kris on 20.04.15.
 */
public class LongArrayUserType implements UserType {

    /**
     * Восстанавливает значение поля при чтении из базы.
     */
    @Override
    public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException {
        Array array = rs.getArray(names[0]);
        Object[] javaArray = (Object[]) array.getArray();

        final long[] primitiveArray = new long[javaArray.length];
        for (int i = 0; i < javaArray.length; i++) {
            primitiveArray[i] = ((Long)javaArray[i]).longValue();
        }
        return primitiveArray;
    }

    /**
     * Кодирует значение поля для записи в базу.
     */
    @Override
    public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException {
        Connection connection = st.getConnection();
        long[] castObject = (long[]) value;

        final Long[] longs = new Long[castObject.length];
        for (int i = 0; i < castObject.length; i++) {
            longs[i] = Long.valueOf(castObject[i]);
        }

        Array array = connection.createArrayOf("bigint", longs);
        st.setArray(index, array);
    }

    /**
     * Конвертирует объект в вид, пригодный для хранения в кэше второго уровня.
     */
    @Override
    public Object assemble(final Serializable cached, final Object owner) throws HibernateException {
        return cached;
    }

    /**
     * Осуществляет полное копирование объекта.
     */
    @Override
    public Object deepCopy(final Object o) throws HibernateException {
        return o == null ? null : ((long[]) o).clone();
    }

    /**
     * Восстанавливает объект из вида, пригодного для хранения в кэше второго уровня.
     */
    @Override
    public Serializable disassemble(final Object o) throws HibernateException {
        return (Serializable) o;
    }

    @Override
    public boolean equals(final Object x, final Object y) throws HibernateException {
        if (x == null) return (y == null);

        long[] lX = (long[])x;
        long[] lY = (long[])y;
        if (lX.length!=lY.length) return false;
        for (int i=0; i<lX.length; i++) {
            if (lX[i] != lY[i]) return false;
        }
        return true;
    }

    @Override
    public int hashCode(final Object o) throws HibernateException {
        if (o == null) return 0;

        int result=0;
        long[] longs = (long[])o;
        for (int i=0; i<longs.length; i++) {
            result = 31 * result + (int) (longs[i] ^ (longs[i] >>> 32));
        }
        return result;
    }

    /**
     * Возвращает true, если объект может меняться.
     */
    @Override
    public boolean isMutable() {
        return false;
    }

    /**
     * Копирует изменения из нового значения в старое.
     */
    @Override
    public Object replace(final Object original, final Object target, final Object owner) throws HibernateException {
        return original;
    }

    @Override
    public Class<long[]> returnedClass() {
        return long[].class;
    }

    @Override
    public int[] sqlTypes() {
        return new int[] { Types.ARRAY };
    }
}


text:
package net.egemsoft.metric.cassandra.colums;

import com.datastax.driver.core.ResultSetFuture;

import java.util.ArrayList;

/**
 * Created by cenk on 15/03/15.
 */
public interface ColumnExtractor {

  ArrayList getColumnValues(ResultSetFuture resultSetFuture);
}


text:
package com.floreysoft.jmte;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.Stack;

/**
 * A map implementation that serves as the internal model.
 * <p>
 * Special feature of this implementation are that you can open and close scopes
 * of local variables.
 * </p>
 *
 */
public class ScopedMap implements Map<String, Object> {
	private final Map<String, Object> rawModel;
	private final Stack<Map<String, Object>> scopes = new Stack<Map<String, Object>>();

	public void clear() {
		throw new UnsupportedOperationException();
	}

	public boolean containsKey(Object key) {
		return get(key) != null;
	}

	public boolean containsValue(Object value) {
		throw new UnsupportedOperationException();
	}

	public Set<Entry<String, Object>> entrySet() {
		throw new UnsupportedOperationException();
	}

	public Object get(Object key) {
		for (int i = scopes.size() - 1; i >= 0; i--) {
			Map<String, Object> map = scopes.get(i);
			Object value = map.get(key);
			if (value != null) {
				return value;
			}
		}
		return rawModel.get(key);
	}

	public boolean isEmpty() {
		throw new UnsupportedOperationException();
	}

	public Set<String> keySet() {
		throw new UnsupportedOperationException();
	}

	public Object put(String key, Object value) {
		return getCurrentScope().put(key, value);
	}

	public void putAll(Map<? extends String, ? extends Object> m) {
		throw new UnsupportedOperationException();
	}

	public Object remove(Object key) {
		throw new UnsupportedOperationException();
	}

	public int size() {
		throw new UnsupportedOperationException();
	}

	public Collection<Object> values() {
		throw new UnsupportedOperationException();
	}

	/**
	 * Creates a new scoped map.
	 *
	 * @param rawModel
	 *            the raw model backing this scoped map
	 */
	public ScopedMap(Map<String, Object> rawModel) {
		if (rawModel == null) {
			throw new IllegalArgumentException("Model must not be null");
		}
		this.rawModel = rawModel;
	}

	/**
	 * Gets the raw model backing this scoped map
	 *
	 * @return the raw model backing this scoped map
	 */
	public Map<String, Object> getRawModel() {
		return rawModel;
	}

	/**
	 * Checks if a given variable is local.
	 */
	public boolean isLocal(String variable) {
		return containsKey(variable) && !rawModel.containsKey(variable);
	}

	/**
	 * Creates a new local scope and sets it as the current one.
	 */
	public void enterScope() {
		scopes.push(createScope());
	}

	/**
	 * Discards the current local scope.
	 */
	public void exitScope() {
		if (scopes.size() == 0) {
			throw new IllegalStateException("There is no state to exit");
		}
		scopes.pop();
	}

	protected Map<String, Object> getCurrentScope() {
		if (scopes.size() > 0) {
			return scopes.peek();
		} else {
			return rawModel;
		}

	}

	protected Map<String, Object> createScope() {
		return new HashMap<String, Object>();
	}

	@Override
	public String toString() {
		return rawModel.toString() + scopes.toString();
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 330543 $ -->
<refentry xml:id="function.finfo-open" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>finfo_open</refname>
  <refname>finfo::__construct</refname>
  <refpurpose>Create a new fileinfo resource</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <para>&style.procedural;</para>
  <methodsynopsis role="procedural">
   <type>resource</type><methodname>finfo_open</methodname>
   <methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>FILEINFO_NONE</initializer></methodparam>
   <methodparam choice="opt"><type>string</type><parameter>magic_file</parameter><initializer>&null;</initializer></methodparam>
  </methodsynopsis>
  <para>&style.oop; (constructor):</para>
  <constructorsynopsis>
   <modifier>public</modifier> <methodname>finfo::__construct</methodname>
   <methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>FILEINFO_NONE</initializer></methodparam>
   <methodparam choice="opt"><type>string</type><parameter>magic_file</parameter><initializer>&null;</initializer></methodparam>
  </constructorsynopsis>
  <para>
   This function opens a magic database and returns its resource.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>options</parameter></term>
     <listitem>
      <para>
       One or disjunction of more <link linkend="fileinfo.constants">Fileinfo
       constants</link>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>magic_file</parameter></term>
     <listitem>
      <para>
       Name of a magic database file, usually something like
       <filename>/path/to/magic.mime</filename>. If not specified, the
       <literal>MAGIC</literal> environment variable is used. If the
       environment variable isn't set, then PHP's bundled magic database will
       be used.
      </para>
      <para>
       Passing &null; or an empty string will be equivalent to the default
       value.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   (Procedural style only)
   Returns a magic database resource on success&return.falseforfailure;.
  </para>
 </refsect1>

 <refsect1 role="notes">
  &reftitle.notes;
  <warning>
   <para>
    The expected magic database format changed in PHP 5.3.11 and 5.4.1.
    Due to this, the internal magic database was upgraded. This mostly effects
    code where an external magic database is used: reading an older magic file
    will now fail.

    Also, some textual representations of the mime types has changed, for
    instance for PHP would be "PHP script, ASCII text" instead of "PHP script
    text" returned.
   </para>
  </warning>
  <note>
   <para>
    Generally, using the bundled magic database (by leaving
    <parameter>magic_file</parameter> and the <literal>MAGIC</literal>
    environment variables unset) is the best course of action unless you
    specifically need a custom magic database.
   </para>
  </note>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <example>
   <title>&style.oop;</title>
   <programlisting role="php">
<![CDATA[
<?php
$finfo = new finfo(FILEINFO_MIME, "/usr/share/misc/magic"); // return mime type ala mimetype extension

/* get mime-type for a specific file */
$filename = "/usr/local/something.txt";
echo $finfo->file($filename);

?>
]]>
  </programlisting>
  </example>
  <example>
   <title>&style.procedural;</title>
   <programlisting role="php">
<![CDATA[
<?php
$finfo = finfo_open(FILEINFO_MIME, "/usr/share/misc/magic"); // return mime type ala mimetype extension

if (!$finfo) {
    echo "Opening fileinfo database failed";
    exit();
}

/* get mime-type for a specific file */
$filename = "/usr/local/something.txt";
echo finfo_file($finfo, $filename);

/* close connection */
finfo_close($finfo);
?>
]]>
   </programlisting>
  </example>
  &example.outputs;
  <screen>
<![CDATA[
text/plain; charset=us-ascii
]]>
  </screen>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>finfo_close</function></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
import os
import tempfile

import pytest
from pip._vendor.packaging.requirements import Requirement

from pip._internal.exceptions import InstallationError
from pip._internal.req.constructors import (
    install_req_from_line,
    install_req_from_req_string,
)
from pip._internal.req.req_install import InstallRequirement

class TestInstallRequirementBuildDirectory(object):
    # no need to test symlinks on Windows
    @pytest.mark.skipif("sys.platform == 'win32'")
    def test_tmp_build_directory(self):
        # when req is None, we can produce a temporary directory
        # Make sure we're handling it correctly with real path.
        requirement = InstallRequirement(None, None)
        tmp_dir = tempfile.mkdtemp('-build', 'pip-')
        tmp_build_dir = requirement.ensure_build_location(tmp_dir)
        assert (
            os.path.dirname(tmp_build_dir) ==
            os.path.realpath(os.path.dirname(tmp_dir))
        )
        # are we on a system where /tmp is a symlink
        if os.path.realpath(tmp_dir) != os.path.abspath(tmp_dir):
            assert os.path.dirname(tmp_build_dir) != os.path.dirname(tmp_dir)
        else:
            assert os.path.dirname(tmp_build_dir) == os.path.dirname(tmp_dir)
        os.rmdir(tmp_dir)
        assert not os.path.exists(tmp_dir)

    def test_forward_slash_results_in_a_link(self, tmpdir):
        install_dir = tmpdir / "foo" / "bar"

        # Just create a file for letting the logic work
        setup_py_path = install_dir / "setup.py"
        os.makedirs(str(install_dir))
        with open(setup_py_path, 'w') as f:
            f.write('')

        requirement = install_req_from_line(
            str(install_dir).replace(os.sep, os.altsep or os.sep)
        )

        assert requirement.link is not None

class TestInstallRequirementFrom(object):

    def test_install_req_from_string_invalid_requirement(self):
        """
        Requirement strings that cannot be parsed by
        packaging.requirements.Requirement raise an InstallationError.
        """
        with pytest.raises(InstallationError) as excinfo:
            install_req_from_req_string("http:/this/is/invalid")

        assert str(excinfo.value) == (
            "Invalid requirement: 'http:/this/is/invalid'"
        )

    def test_install_req_from_string_without_comes_from(self):
        """
        Test to make sure that install_req_from_string succeeds
        when called with URL (PEP 508) but without comes_from.
        """
        # Test with a PEP 508 url install string:
        wheel_url = ("https://download.pytorch.org/whl/cu90/"
                     "torch-1.0.0-cp36-cp36m-win_amd64.whl")
        install_str = "torch@ " + wheel_url
        install_req = install_req_from_req_string(install_str)

        assert isinstance(install_req, InstallRequirement)
        assert install_req.link.url == wheel_url
        assert install_req.req.url == wheel_url
        assert install_req.comes_from is None
        assert install_req.is_wheel

    def test_install_req_from_string_with_comes_from_without_link(self):
        """
        Test to make sure that install_req_from_string succeeds
        when called with URL (PEP 508) and comes_from
        does not have a link.
        """
        # Test with a PEP 508 url install string:
        wheel_url = ("https://download.pytorch.org/whl/cu90/"
                     "torch-1.0.0-cp36-cp36m-win_amd64.whl")
        install_str = "torch@ " + wheel_url

        # Dummy numpy "comes_from" requirement without link:
        comes_from = InstallRequirement(
            Requirement("numpy>=1.15.0"), comes_from=None
        )

        # Attempt install from install string comes:
        install_req = install_req_from_req_string(
            install_str, comes_from=comes_from
        )

        assert isinstance(install_req, InstallRequirement)
        assert install_req.comes_from.link is None
        assert install_req.link.url == wheel_url
        assert install_req.req.url == wheel_url
        assert install_req.is_wheel


text:
using System;
using System.Collections.Generic;
using System.Management.Automation;
using Microsoft.SharePoint.Client;
using OfficeDevPnP.Core.Entities;
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;

namespace SharePointPnP.PowerShell.Commands.Lists
{
    //TODO: Create Test

    [Cmdlet(VerbsCommon.Clear, "PnPDefaultColumnValues")]
    [CmdletHelp("Clear default column values for a document library",
        DetailedDescription = "Clear default column values for a document library, per folder, or for the root folder if the folder parameter has not been specified.",
        Category = CmdletHelpCategory.Lists)]
    [CmdletExample(
        Code = "PS:> Clear-PnPDefaultColumnValues -List Documents -Field MyField",
        SortOrder = 1,
        Remarks = "Clears the default value for the field MyField on a library")]
    [CmdletExample(
        Code = "PS:> Clear-PnPDefaultColumnValues -List Documents -Field MyField -Folder A",
        SortOrder = 2,
        Remarks = "Clears the default value for the field MyField on the folder A on a library")]
    public class ClearDefaultColumnValues : PnPWebCmdlet
    {
        [Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0, HelpMessage = "The ID, Name or Url of the list.")]
        public ListPipeBind List;

        [Parameter(Mandatory = true, HelpMessage = "The internal name, id or a reference to a field")]
        public FieldPipeBind Field;

        [Parameter(Mandatory = false, HelpMessage = "A library relative folder path, if not specified it will set the default column values on the root folder of the library ('/')")]
        public string Folder = "/";

        protected override void ExecuteCmdlet()
        {
            List list = null;
            if (List != null)
            {
                list = List.GetList(SelectedWeb);
            }
            if (list != null)
            {
                if (list.BaseTemplate == (int)ListTemplateType.DocumentLibrary || list.BaseTemplate == (int)ListTemplateType.WebPageLibrary || list.BaseTemplate == (int)ListTemplateType.PictureLibrary)
                {
                    Field field = null;
                    // Get the field
                    if (Field.Field != null)
                    {
                        field = Field.Field;

                        ClientContext.Load(field);
                        ClientContext.ExecuteQueryRetry();

                        field.EnsureProperties(f => f.TypeAsString, f => f.InternalName);
                    }
                    else if (Field.Id != Guid.Empty)
                    {
                        field = list.Fields.GetById(Field.Id);
                        ClientContext.Load(field, f => f.InternalName, f => f.TypeAsString);
                        ClientContext.ExecuteQueryRetry();
                    }
                    else if (!string.IsNullOrEmpty(Field.Name))
                    {
                        field = list.Fields.GetByInternalNameOrTitle(Field.Name);
                        ClientContext.Load(field, f => f.InternalName, f => f.TypeAsString);
                        ClientContext.ExecuteQueryRetry();
                    }
                    if (field != null)
                    {
                        IDefaultColumnValue defaultColumnValue = field.GetDefaultColumnValueFromField(ClientContext, Folder, new string[0]);
                        list.ClearDefaultColumnValues(new List<IDefaultColumnValue>() { defaultColumnValue });
                    }
                }
                else
                {
                    WriteWarning("List is not a document library");
                }

            }
        }
    }

}


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

<title>org.codehaus.groovy.ast.stmt Class Hierarchy (Groovy 2.4.4)</title>
<meta name="date" content="2015-07-09">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package org.codehaus.groovy.ast.stmt

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

org.codehaus.groovy.ast.ASTNode

org.codehaus.groovy.ast.stmt.Statement

org.codehaus.groovy.ast.stmt.AssertStatement

org.codehaus.groovy.ast.stmt.BlockStatement

org.codehaus.groovy.ast.stmt.BreakStatement

org.codehaus.groovy.ast.stmt.CaseStatement

org.codehaus.groovy.ast.stmt.CatchStatement

org.codehaus.groovy.ast.stmt.ContinueStatement

org.codehaus.groovy.ast.stmt.DoWhileStatement (implements org.codehaus.groovy.ast.stmt.LoopingStatement)

org.codehaus.groovy.ast.stmt.EmptyStatement

org.codehaus.groovy.ast.stmt.ExpressionStatement

org.codehaus.groovy.ast.stmt.ForStatement (implements org.codehaus.groovy.ast.stmt.LoopingStatement)

org.codehaus.groovy.ast.stmt.IfStatement

org.codehaus.groovy.ast.stmt.ReturnStatement

org.codehaus.groovy.ast.stmt.SwitchStatement

org.codehaus.groovy.ast.stmt.SynchronizedStatement

org.codehaus.groovy.ast.stmt.ThrowStatement

org.codehaus.groovy.ast.stmt.TryCatchStatement

org.codehaus.groovy.ast.stmt.WhileStatement (implements org.codehaus.groovy.ast.stmt.LoopingStatement)

Interface Hierarchy

org.codehaus.groovy.ast.stmt.LoopingStatement

Overview

Package

Class

Tree

Deprecated

Index

Help

Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.

Prev

Next

Frames

No Frames

All Classes


text:
puppet-perfsonar
================

Puppet module to configure a perfsonar host

The latest release of this module only supports Perfsonar 3.5.1.