text:
namespace blink {

template<typename T> class GarbageCollected;
template<typename T, typename U, typename V, typename W, typename X> class HeapHashMap;
template<typename T, typename U, typename V> class HeapHashSet;
template<typename T, typename U, typename V> class HeapLinkedHashSet;
template<typename T, size_t inlineCapacity, typename U> class HeapListHashSet;
template<typename T, size_t inlineCapacity> class HeapVector;
template<typename T, size_t inlineCapacity> class HeapDeque;
template<typename T, typename U, typename V> class HeapHashCountedSet;
template<typename T> class HeapTerminatedArray;
template<typename T, typename Traits> class HeapVectorBacking;
template<typename Table> class HeapHashTableBacking;
template<typename ValueArg, size_t inlineCapacity> class HeapListHashSetAllocator;
class InlinedGlobalMarkingVisitor;
template<typename T> class Persistent;

// GC_PLUGIN_IGNORE is used to make the plugin ignore a particular class or
// field when checking for proper usage.  When using GC_PLUGIN_IGNORE
// a bug-number should be provided as an argument where the bug describes
// what needs to happen to remove the GC_PLUGIN_IGNORE again.
#if COMPILER(CLANG)
#define GC_PLUGIN_IGNORE(bug)                           \
    __attribute__((annotate("blink_gc_plugin_ignore")))
#else
#define GC_PLUGIN_IGNORE(bug)
#endif

// Template to determine if a class is a GarbageCollectedMixin by checking if it
// has IsGarbageCollectedMixinMarker
template<typename T>
struct IsGarbageCollectedMixin {
private:
    typedef char YesType;
    struct NoType {
        char padding[8];
    };

    template <typename U> static YesType checkMarker(typename U::IsGarbageCollectedMixinMarker*);
    template <typename U> static NoType checkMarker(...);

public:
    static const bool value = sizeof(checkMarker<T>(nullptr)) == sizeof(YesType);
};

template <typename T>
struct IsGarbageCollectedType {
    using TrueType = char;
    struct FalseType {
        char dummy[2];
    };

    using NonConstType = typename WTF::RemoveConst<T>::Type;
    using GarbageCollectedSubclass = WTF::IsSubclassOfTemplate<NonConstType, GarbageCollected>;
    using GarbageCollectedMixinSubclass = IsGarbageCollectedMixin<NonConstType>;
    using HeapHashSetSubclass = WTF::IsSubclassOfTemplate<NonConstType, HeapHashSet>;
    using HeapLinkedHashSetSubclass = WTF::IsSubclassOfTemplate<NonConstType, HeapLinkedHashSet>;
    using HeapListHashSetSubclass = WTF::IsSubclassOfTemplateTypenameSizeTypename<NonConstType, HeapListHashSet>;
    using HeapHashMapSubclass = WTF::IsSubclassOfTemplate<NonConstType, HeapHashMap>;
    using HeapVectorSubclass = WTF::IsSubclassOfTemplateTypenameSize<NonConstType, HeapVector>;
    using HeapDequeSubclass = WTF::IsSubclassOfTemplateTypenameSize<NonConstType, HeapDeque>;
    using HeapHashCountedSetSubclass = WTF::IsSubclassOfTemplate<NonConstType, HeapHashCountedSet>;
    using HeapTerminatedArraySubclass = WTF::IsSubclassOfTemplate<NonConstType, HeapTerminatedArray>;
    using HeapVectorBackingSubclass = WTF::IsSubclassOfTemplate<NonConstType, HeapVectorBacking>;
    using HeapHashTableBackingSubclass = WTF::IsSubclassOfTemplate<NonConstType, HeapHashTableBacking>;

    template<typename U, size_t inlineCapacity> static TrueType listHashSetNodeIsHeapAllocated(WTF::ListHashSetNode<U, HeapListHashSetAllocator<U, inlineCapacity>>*);
    static FalseType listHashSetNodeIsHeapAllocated(...);
    static const bool isHeapAllocatedListHashSetNode = sizeof(TrueType) == sizeof(listHashSetNodeIsHeapAllocated(reinterpret_cast<NonConstType*>(0)));

    static_assert(sizeof(T), "T must be fully defined");

    static const bool value =
        GarbageCollectedSubclass::value
        || GarbageCollectedMixinSubclass::value
        || HeapHashSetSubclass::value
        || HeapLinkedHashSetSubclass::value
        || HeapListHashSetSubclass::value
        || HeapHashMapSubclass::value
        || HeapVectorSubclass::value
        || HeapDequeSubclass::value
        || HeapHashCountedSetSubclass::value
        || HeapTerminatedArraySubclass::value
        || HeapVectorBackingSubclass::value
        || HeapHashTableBackingSubclass::value
        || isHeapAllocatedListHashSetNode;
};

// The GarbageCollectedMixin interface and helper macro
// USING_GARBAGE_COLLECTED_MIXIN can be used to automatically define
// TraceTrait/ObjectAliveTrait on non-leftmost deriving classes
// which need to be garbage collected.
//
// Consider the following case:
// class B {};
// class A : public GarbageCollected, public B {};
//
// We can't correctly handle "Member<B> p = &a" as we can't compute addr of
// object header statically. This can be solved by using GarbageCollectedMixin:
// class B : public GarbageCollectedMixin {};
// class A : public GarbageCollected, public B {
//   USING_GARBAGE_COLLECTED_MIXIN(A)
// };
//
// With the helper, as long as we are using Member<B>, TypeTrait<B> will
// dispatch adjustAndMark dynamically to find collect addr of the object header.
// Note that this is only enabled for Member<B>. For Member<A> which we can
// compute the object header addr statically, this dynamic dispatch is not used.
class PLATFORM_EXPORT GarbageCollectedMixin {
public:
    typedef int IsGarbageCollectedMixinMarker;
    virtual void adjustAndMark(Visitor*) const = 0;
    virtual void trace(Visitor*) { }
    virtual void adjustAndMark(InlinedGlobalMarkingVisitor) const = 0;
    virtual void trace(InlinedGlobalMarkingVisitor);
    virtual bool isHeapObjectAlive() const = 0;
};

#define DEFINE_GARBAGE_COLLECTED_MIXIN_METHODS(VISITOR, TYPE)           \
    public:                                                             \
    void adjustAndMark(VISITOR visitor) const override                  \
    {                                                                   \
        typedef WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<TYPE>::Type, blink::GarbageCollected> IsSubclassOfGarbageCollected; \
        static_assert(IsSubclassOfGarbageCollected::value, "only garbage collected objects can have garbage collected mixins"); \
        if (TraceEagerlyTrait<TYPE>::value) {                           \
            if (visitor->ensureMarked(static_cast<const TYPE*>(this)))  \
                TraceTrait<TYPE>::trace(visitor, const_cast<TYPE*>(this)); \
            return;                                                     \
        }                                                               \
        visitor->mark(static_cast<const TYPE*>(this), &blink::TraceTrait<TYPE>::trace); \
    }                                                                   \
    private:

// A C++ object's vptr will be initialized to its leftmost base's vtable after
// the constructors of all its subclasses have run, so if a subclass constructor
// tries to access any of the vtbl entries of its leftmost base prematurely,
// it'll find an as-yet incorrect vptr and fail. Which is exactly what a
// garbage collector will try to do if it tries to access the leftmost base
// while one of the subclass constructors of a GC mixin object triggers a GC.
// It is consequently not safe to allow any GCs while these objects are under
// (sub constructor) construction.
//
// To prevent GCs in that restricted window of a mixin object's construction:
//
//  - The initial allocation of the mixin object will enter a no GC scope.
//    This is done by overriding 'operator new' for mixin instances.
//  - When the constructor for the mixin is invoked, after all the
//    derived constructors have run, it will invoke the constructor
//    for a field whose only purpose is to leave the GC scope.
//    GarbageCollectedMixinConstructorMarker's constructor takes care of
//    this and the field is declared by way of USING_GARBAGE_COLLECTED_MIXIN().

#define DEFINE_GARBAGE_COLLECTED_MIXIN_CONSTRUCTOR_MARKER(TYPE)         \
    public:                                                             \
    GC_PLUGIN_IGNORE("crbug.com/456823") NO_SANITIZE_UNRELATED_CAST     \
    void* operator new(size_t size)                                     \
{                                                                       \
        void* object = TYPE::allocateObject(size, IsEagerlyFinalizedType<TYPE>::value); \
        ThreadState* state = ThreadStateFor<ThreadingTrait<TYPE>::Affinity>::state();   \
        state->enterGCForbiddenScopeIfNeeded(&(reinterpret_cast<TYPE*>(object)->m_mixinConstructorMarker)); \
        return object;                                                  \
    }                                                                   \
    GarbageCollectedMixinConstructorMarker m_mixinConstructorMarker;    \
    private:

// Mixins that wrap/nest others requires extra handling:
//
//  class A : public GarbageCollected<A>, public GarbageCollectedMixin {
//  USING_GARBAGE_COLLECTED_MIXIN(A);
//  ...
//  }'
//  public B final : public A, public SomeOtherMixinInterface {
//  USING_GARBAGE_COLLECTED_MIXIN(B);
//  ...
//  };
//
// The "operator new" for B will enter the forbidden GC scope, but
// upon construction, two GarbageCollectedMixinConstructorMarker constructors
// will run -- one for A (first) and another for B (secondly). Only
// the second one should leave the forbidden GC scope. This is realized by
// recording the address of B's GarbageCollectedMixinConstructorMarker
// when the "operator new" for B runs, and leaving the forbidden GC scope
// when the constructor of the recorded GarbageCollectedMixinConstructorMarker
// runs.
#define USING_GARBAGE_COLLECTED_MIXIN(TYPE)                             \
    DEFINE_GARBAGE_COLLECTED_MIXIN_METHODS(blink::Visitor*, TYPE)       \
    DEFINE_GARBAGE_COLLECTED_MIXIN_METHODS(blink::InlinedGlobalMarkingVisitor, TYPE) \
    DEFINE_GARBAGE_COLLECTED_MIXIN_CONSTRUCTOR_MARKER(TYPE)             \
public:                                                                 \
    bool isHeapObjectAlive() const override                             \
    {                                                                   \
        return Heap::isHeapObjectAlive(this);                           \
    }                                                                   \
private:

#if ENABLE(OILPAN)
#define WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TYPE) USING_GARBAGE_COLLECTED_MIXIN(TYPE)
#else
#define WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TYPE)
#endif

// An empty class with a constructor that's arranged invoked when all derived constructors
// of a mixin instance have completed and it is safe to allow GCs again. See
// AllocateObjectTrait<> comment for more.
//
// USING_GARBAGE_COLLECTED_MIXIN() declares a GarbageCollectedMixinConstructorMarker<> private
// field. By following Blink convention of using the macro at the top of a class declaration,
// its constructor will run first.
class GarbageCollectedMixinConstructorMarker {
public:
    GarbageCollectedMixinConstructorMarker()
    {
        // FIXME: if prompt conservative GCs are needed, forced GCs that
        // were denied while within this scope, could now be performed.
        // For now, assume the next out-of-line allocation request will
        // happen soon enough and take care of it. Mixin objects aren't
        // overly common.
        ThreadState* state = ThreadState::current();
        state->leaveGCForbiddenScopeIfNeeded(this);
    }
};

// Base class for objects allocated in the Blink garbage-collected heap.
//
// Defines a 'new' operator that allocates the memory in the heap.  'delete'
// should not be called on objects that inherit from GarbageCollected.
//
// Instances of GarbageCollected will *NOT* get finalized.  Their destructor
// will not be called.  Therefore, only classes that have trivial destructors
// with no semantic meaning (including all their subclasses) should inherit from
// GarbageCollected.  If there are non-trival destructors in a given class or
// any of its subclasses, GarbageCollectedFinalized should be used which
// guarantees that the destructor is called on an instance when the garbage
// collector determines that it is no longer reachable.
template<typename T> class GarbageCollected;

// Base class for objects allocated in the Blink garbage-collected heap.
//
// Defines a 'new' operator that allocates the memory in the heap.  'delete'
// should not be called on objects that inherit from GarbageCollected.
//
// Instances of GarbageCollectedFinalized will have their destructor called when
// the garbage collector determines that the object is no longer reachable.
template<typename T>
class GarbageCollectedFinalized : public GarbageCollected<T> {
    WTF_MAKE_NONCOPYABLE(GarbageCollectedFinalized);

protected:
    // finalizeGarbageCollectedObject is called when the object is freed from
    // the heap.  By default finalization means calling the destructor on the
    // object.  finalizeGarbageCollectedObject can be overridden to support
    // calling the destructor of a subclass.  This is useful for objects without
    // vtables that require explicit dispatching.  The name is intentionally a
    // bit long to make name conflicts less likely.
    void finalizeGarbageCollectedObject()
    {
        static_cast<T*>(this)->~T();
    }

    GarbageCollectedFinalized() { }
    ~GarbageCollectedFinalized() { }

    template<typename U> friend struct HasFinalizer;
    template<typename U, bool> friend struct FinalizerTraitImpl;
};

// Base class for objects that are in the Blink garbage-collected heap
// and are still reference counted.
//
// This class should be used sparingly and only to gradually move
// objects from being reference counted to being managed by the blink
// garbage collector.
//
// While the current reference counting keeps one of these objects
// alive it will have a Persistent handle to itself allocated so we
// will not reclaim the memory.  When the reference count reaches 0 the
// persistent handle will be deleted.  When the garbage collector
// determines that there are no other references to the object it will
// be reclaimed and the destructor of the reclaimed object will be
// called at that time.
template<typename T>
class RefCountedGarbageCollected : public GarbageCollectedFinalized<T> {
    WTF_MAKE_NONCOPYABLE(RefCountedGarbageCollected);

public:
    RefCountedGarbageCollected()
        : m_refCount(0)
    {
    }

    // Implement method to increase reference count for use with RefPtrs.
    //
    // In contrast to the normal WTF::RefCounted, the reference count can reach
    // 0 and increase again.  This happens in the following scenario:
    //
    // (1) The reference count becomes 0, but members, persistents, or
    //     on-stack pointers keep references to the object.
    //
    // (2) The pointer is assigned to a RefPtr again and the reference
    //     count becomes 1.
    //
    // In this case, we have to resurrect m_keepAlive.
    void ref()
    {
        if (UNLIKELY(!m_refCount)) {
            ASSERT(ThreadState::current()->findPageFromAddress(reinterpret_cast<Address>(this)));
            makeKeepAlive();
        }
        ++m_refCount;
    }

    // Implement method to decrease reference count for use with RefPtrs.
    //
    // In contrast to the normal WTF::RefCounted implementation, the
    // object itself is not deleted when the reference count reaches
    // 0.  Instead, the keep-alive persistent handle is deallocated so
    // that the object can be reclaimed when the garbage collector
    // determines that there are no other references to the object.
    void deref()
    {
        ASSERT(m_refCount > 0);
        if (!--m_refCount) {
            delete m_keepAlive;
            m_keepAlive = 0;
        }
    }

    bool hasOneRef()
    {
        return m_refCount == 1;
    }

protected:
    ~RefCountedGarbageCollected() { }

private:
    void makeKeepAlive()
    {
        ASSERT(!m_keepAlive);
        m_keepAlive = new Persistent<T>(static_cast<T*>(this));
    }

    int m_refCount;
    Persistent<T>* m_keepAlive;
};

template<typename T, bool = WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<T>::Type, GarbageCollected>::value> class NeedsAdjustAndMark;

template<typename T>
class NeedsAdjustAndMark<T, true> {
    static_assert(sizeof(T), "T must be fully defined");
public:
    static const bool value = false;
};
template <typename T> const bool NeedsAdjustAndMark<T, true>::value;

template<typename T>
class NeedsAdjustAndMark<T, false> {
    static_assert(sizeof(T), "T must be fully defined");
public:
    static const bool value = IsGarbageCollectedMixin<typename WTF::RemoveConst<T>::Type>::value;
};
template <typename T> const bool NeedsAdjustAndMark<T, false>::value;

// TODO(sof): migrate to wtf/TypeTraits.h
template<typename T>
class IsFullyDefined {
    using TrueType = char;
    struct FalseType {
        char dummy[2];
    };

    template<typename U, size_t sz = sizeof(U)> static TrueType isSizeofKnown(U*);
    static FalseType isSizeofKnown(...);
    static T& t;
public:
    static const bool value = sizeof(TrueType) == sizeof(isSizeofKnown(&t));
};

} // namespace blink

#endif


text:
[![Join the chat at https://gitter.im/oncue/remotely](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/oncue/remotely?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![image](https://travis-ci.org/oncue/remotely.svg)](https://travis-ci.org/oncue/remotely)  [ ![Download](https://api.bintray.com/packages/oncue/releases/remotely/images/download.svg) ](https://bintray.com/oncue/releases/remotely/_latestVersion)

Remotely is a purely functional remoting library for reasonable people. It's fast, lightweight and models network operations as explicit monadic computations.

Please [see the documentation](http://oncue.github.io/remotely/) for more information.

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <title>Cisco Software Manager Server</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">

    <link rel="stylesheet" type="text/css" href="/static/jquery/css/base.css">
    <link rel="stylesheet" type="text/css" href="/static/jquery/css/smoothness/jquery-ui-1.10.4.custom.min.css">

    <link rel="stylesheet" href="/static/datetimepicker/css/bootstrap-datetimepicker.min.css">

    <link rel="stylesheet" href="/static/bootstrap/3.1.1/css/bootstrap.min.css">

    <link rel="stylesheet" type="text/css" href="/static/datatables-1.10.4/media/css/dataTables.bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/static/datatables-1.10.4/media/css/jquery.dataTables.min.css">

    <link rel="stylesheet" href="/static/select2-4.0.0/dist/css/select2.css">

    <link href="/static/x-wizard-1.1/assets/css/gsdk-base-modified.css" rel="stylesheet" />

    <link href="/static/jasny-bootstrap-3.1.3/css/jasny-bootstrap.css" rel="stylesheet" />
    <link href="/static/jasny-bootstrap-3.1.3/css/navmenu-reveal.css" rel="stylesheet" />

    {% block base_head %}{% endblock %}

    {% block head %}{% endblock %}

    {% block menu_bar %}{% endblock %}

            {% block title %}{% endblock %}

    {% block main %}{% endblock %}

            Copyright © 2000 -

            Cisco Systems, Inc. All rights reserved.


text:
package spec

import (
	"fmt"

	"github.com/stretchr/testify/mock"

	v1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/serializer"
	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
	"k8s.io/autoscaler/vertical-pod-autoscaler/pkg/recommender/model"
	v1lister "k8s.io/client-go/listers/core/v1"
)

var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme)

func init() {
	utilruntime.Must(v1.AddToScheme(scheme))
}

const pod1Yaml = `
apiVersion: v1
kind: Pod
metadata:
  name: Pod1
  labels:
    Pod1LabelKey: Pod1LabelValue
spec:
  containers:
  - name: Name11
    image: Name11Image
    resources:
      requests:
        memory: "512Mi"
        cpu: "500m"
  - name: Name12
    image: Name12Image
    resources:
      requests:
        memory: "1024Mi"
        cpu: "1000m"
`

const pod2Yaml = `
apiVersion: v1
kind: Pod
metadata:
  name: Pod2
  labels:
    Pod2LabelKey: Pod2LabelValue
spec:
  containers:
  - name: Name21
    image: Name21Image
    resources:
      requests:
        memory: "2048Mi"
        cpu: "2000m"
  - name: Name22
    image: Name22Image
    resources:
      requests:
        memory: "4096Mi"
        cpu: "4000m"
`

type podListerMock struct {
	mock.Mock
}

func (m *podListerMock) List(selector labels.Selector) (ret []*v1.Pod, err error) {
	args := m.Called()
	return args.Get(0).([]*v1.Pod), args.Error(1)
}

func (m *podListerMock) Pods(namespace string) v1lister.PodNamespaceLister {
	args := m.Called()
	return args.Get(0).(v1lister.PodNamespaceLister)
}

type specClientTestCase struct {
	podSpecs []*BasicPodSpec
	podYamls []string
}

func newEmptySpecClientTestCase() *specClientTestCase {
	return &specClientTestCase{}
}

func newSpecClientTestCase() *specClientTestCase {
	podID1 := model.PodID{Namespace: "", PodName: "Pod1"}
	podID2 := model.PodID{Namespace: "", PodName: "Pod2"}

	containerSpec11 := newTestContainerSpec(podID1, "Name11", 500, 512*1024*1024)
	containerSpec12 := newTestContainerSpec(podID1, "Name12", 1000, 1024*1024*1024)
	containerSpec21 := newTestContainerSpec(podID2, "Name21", 2000, 2048*1024*1024)
	containerSpec22 := newTestContainerSpec(podID2, "Name22", 4000, 4096*1024*1024)

	podSpec1 := newTestPodSpec(podID1, containerSpec11, containerSpec12)
	podSpec2 := newTestPodSpec(podID2, containerSpec21, containerSpec22)

	return &specClientTestCase{
		podSpecs: []*BasicPodSpec{podSpec1, podSpec2},
		podYamls: []string{pod1Yaml, pod2Yaml},
	}
}

func newTestContainerSpec(podID model.PodID, containerName string, milicores int, memory int64) BasicContainerSpec {
	containerID := model.ContainerID{
		PodID:         podID,
		ContainerName: containerName,
	}
	requestedResources := model.Resources{
		model.ResourceCPU:    model.ResourceAmount(milicores),
		model.ResourceMemory: model.ResourceAmount(memory),
	}
	return BasicContainerSpec{
		ID:      containerID,
		Image:   containerName + "Image",
		Request: requestedResources,
	}
}

func newTestPodSpec(podId model.PodID, containerSpecs ...BasicContainerSpec) *BasicPodSpec {
	return &BasicPodSpec{
		ID:         podId,
		PodLabels:  map[string]string{podId.PodName + "LabelKey": podId.PodName + "LabelValue"},
		Containers: containerSpecs,
	}
}

func (tc *specClientTestCase) createFakeSpecClient() SpecClient {
	podListerMock := new(podListerMock)
	podListerMock.On("List").Return(tc.getFakePods(), nil)

	return NewSpecClient(podListerMock)
}

func (tc *specClientTestCase) getFakePods() []*v1.Pod {
	pods := []*v1.Pod{}
	for _, yaml := range tc.podYamls {
		pods = append(pods, newPod(yaml))
	}
	return pods
}

func newPod(yaml string) *v1.Pod {
	decode := codecs.UniversalDeserializer().Decode
	obj, _, err := decode([]byte(yaml), nil, nil)
	if err != nil {
		fmt.Printf("%#v", err)
	}
	return obj.(*v1.Pod)
}


text:
/**
 * @file
 * Extends the Drupal AJAX functionality to integrate the dialog API.
 */

(function ($, Drupal) {

  'use strict';

  /**
   * Initialize dialogs for Ajax purposes.
   *
   * @type {Drupal~behavior}
   */
  Drupal.behaviors.dialog = {
    attach: function (context, settings) {
      var $context = $(context);

      // Provide a known 'drupal-modal' DOM element for Drupal-based modal
      // dialogs. Non-modal dialogs are responsible for creating their own
      // elements, since there can be multiple non-modal dialogs at a time.
      if (!$('#drupal-modal').length) {
        // Add 'ui-front' jQuery UI class so jQuery UI widgets like autocomplete
        // sit on top of dialogs. For more information see
        // http://api.jqueryui.com/theming/stacking-elements/.
        $('
').hide().appendTo('body');
      }

      // Special behaviors specific when attaching content within a dialog.
      // These behaviors usually fire after a validation error inside a dialog.
      var $dialog = $context.closest('.ui-dialog-content');
      if ($dialog.length) {
        // Remove and replace the dialog buttons with those from the new form.
        if ($dialog.dialog('option', 'drupalAutoButtons')) {
          // Trigger an event to detect/sync changes to buttons.
          $dialog.trigger('dialogButtonsChange');
        }

        // Force focus on the modal when the behavior is run.
        $dialog.dialog('widget').trigger('focus');
      }

      var originalClose = settings.dialog.close;
      // Overwrite the close method to remove the dialog on closing.
      settings.dialog.close = function (event) {
        originalClose.apply(settings.dialog, arguments);
        $(event.target).remove();
      };
    },

    /**
     * Scan a dialog for any primary buttons and move them to the button area.
     *
     * @param {jQuery} $dialog
     *   An jQuery object containing the element that is the dialog target.
     *
     * @return {Array}
     *   An array of buttons that need to be added to the button area.
     */
    prepareDialogButtons: function ($dialog) {
      var buttons = [];
      var $buttons = $dialog.find('.form-actions input[type=submit]');
      $buttons.each(function () {
        // Hidden form buttons need special attention. For browser consistency,
        // the button needs to be "visible" in order to have the enter key fire
        // the form submit event. So instead of a simple "hide" or
        // "display: none", we set its dimensions to zero.
        // See http://mattsnider.com/how-forms-submit-when-pressing-enter/
        var $originalButton = $(this).css({
          display: 'block',
          width: 0,
          height: 0,
          padding: 0,
          border: 0
        });
        buttons.push({
          text: $originalButton.html() || $originalButton.attr('value'),
          class: $originalButton.attr('class'),
          click: function (e) {
            $originalButton.trigger('mousedown').trigger('mouseup').trigger('click');
            e.preventDefault();
          }
        });
      });
      return buttons;
    }
  };

  /**
   * Command to open a dialog.
   *
   * @param {Drupal.Ajax} ajax
   * @param {object} response
   * @param {number} [status]
   *
   * @return {bool|undefined}
   */
  Drupal.AjaxCommands.prototype.openDialog = function (ajax, response, status) {
    if (!response.selector) {
      return false;
    }
    var $dialog = $(response.selector);
    if (!$dialog.length) {
      // Create the element if needed.
      $dialog = $('
').appendTo('body');
    }
    // Set up the wrapper, if there isn't one.
    if (!ajax.wrapper) {
      ajax.wrapper = $dialog.attr('id');
    }

    // Use the ajax.js insert command to populate the dialog contents.
    response.command = 'insert';
    response.method = 'html';
    ajax.commands.insert(ajax, response, status);

    // Move the buttons to the jQuery UI dialog buttons area.
    if (!response.dialogOptions.buttons) {
      response.dialogOptions.drupalAutoButtons = true;
      response.dialogOptions.buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog);
    }

    // Bind dialogButtonsChange.
    $dialog.on('dialogButtonsChange', function () {
      var buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog);
      $dialog.dialog('option', 'buttons', buttons);
    });

    // Open the dialog itself.
    response.dialogOptions = response.dialogOptions || {};
    var dialog = Drupal.dialog($dialog.get(0), response.dialogOptions);
    if (response.dialogOptions.modal) {
      dialog.showModal();
    }
    else {
      dialog.show();
    }

    // Add the standard Drupal class for buttons for style consistency.
    $dialog.parent().find('.ui-dialog-buttonset').addClass('form-actions');
  };

  /**
   * Command to close a dialog.
   *
   * If no selector is given, it defaults to trying to close the modal.
   *
   * @param {Drupal.Ajax} [ajax]
   * @param {object} response
   * @param {string} response.selector
   * @param {bool} response.persist
   * @param {number} [status]
   */
  Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) {
    var $dialog = $(response.selector);
    if ($dialog.length) {
      Drupal.dialog($dialog.get(0)).close();
      if (!response.persist) {
        $dialog.remove();
      }
    }

    // Unbind dialogButtonsChange.
    $dialog.off('dialogButtonsChange');
  };

  /**
   * Command to set a dialog property.
   *
   * JQuery UI specific way of setting dialog options.
   *
   * @param {Drupal.Ajax} [ajax]
   * @param {object} response
   * @param {string} response.selector
   * @param {string} response.optionsName
   * @param {string} response.optionValue
   * @param {number} [status]
   */
  Drupal.AjaxCommands.prototype.setDialogOption = function (ajax, response, status) {
    var $dialog = $(response.selector);
    if ($dialog.length) {
      $dialog.dialog('option', response.optionName, response.optionValue);
    }
  };

  /**
   * Binds a listener on dialog creation to handle the cancel link.
   *
   * @param {jQuery.Event} e
   * @param {Drupal.dialog~dialogDefinition} dialog
   * @param {jQuery} $element
   * @param {object} settings
   */
  $(window).on('dialog:aftercreate', function (e, dialog, $element, settings) {
    $element.on('click.dialog', '.dialog-cancel', function (e) {
      dialog.close('cancel');
      e.preventDefault();
      e.stopPropagation();
    });
  });

  /**
   * Removes all 'dialog' listeners.
   *
   * @param {jQuery.Event} e
   * @param {Drupal.dialog~dialogDefinition} dialog
   * @param {jQuery} $element
   */
  $(window).on('dialog:beforeclose', function (e, dialog, $element) {
    $element.off('.dialog');
  });

})(jQuery, Drupal);
;


text:
/*! jquery-pushy - v0.2 - 2014-12-26
* jQuery Navigation Menu plugin using Responsive CSS transforms & transitions with multiple instances and differents positions (left / right / top)
* https://github.com/eduestrella/jquery-pushy
* by Eduardo Estrella Rosario
*/

$.fn.Pushy = function(options) {

	// CONSTANTS
	var POSITION_TOP = "top";
	var POSITION_LEFT = "left";
	var POSITION_RIGHT = "right";

	// SCOPE
	var that = this;

	// PUSHY INSTANCES
 	var instanceNumber = $.fn.Pushy.numInstances = ($.fn.Pushy.numInstances || 0) + 1;

 	// SETTINGS
	var options = options || {};

	this.menu = this.selector || "#menuPushy";
	this.button = options.button || "menu-pushy-button";
	this.container = options.container || "container";
	this.containerPush = (options.containerPush == undefined ? true : options.containerPush);
	this.containerCustomClass = options.containerClass || "";
	this.menuPosition = options.menuPosition || POSITION_LEFT;
	this.menuOpen = (options.menuOpen == undefined ? false : options.menuOpen);
	this.overlayShow = (options.overlayShow == undefined ? true : options.overlayShow);

	// FORMAT INPUT DATA
	this.menuPosition = this.menuPosition.toLowerCase();

	// CREATE DYNAMIC OVERLAY DIV
	if( this.overlayShow === true){
		$(this.menu).after('

');
	}

	// GLOBAL VARS
	var pushy = $(this.menu), //menu css class
		body = $('body'),
		container = $('#'+this.container), //container css class
		overlayPushy = $('#pushyOverlay'+ instanceNumber), //site overlay
		push = $('.push'), //css class to add pushy capability
		menuBtn = $('.'+this.button), //css classes to toggle the menu
		menuSpeed = 200, //jQuery fallback menu speed
		menuWidth = pushy.width() + "px",//jQuery fallback menu width
		pushClass = "push-push", //css class to add pushy capability
		pushyClass = "pushy-" + this.menuPosition + " pushy-" + this.menuPosition + "-open", //menu position & menu open class
		pushyActiveClass = "overlay-pushy overlay-active ", //css class to toggle site overlay
		containerClass = "container-" + this.menuPosition + "-push" +  " " + this.containerCustomClass; //container open class

	// DEFAULT CSS CLASSES
	pushy.addClass('pushy pushy-' + this.menuPosition);
	menuBtn.addClass('menu-btn');

	// DEFAULT STATUS MENU (open / close)
	if(this.menuOpen === true){
		togglePushy();
	}

	function togglePushy(){
		overlayPushy.toggleClass(pushyActiveClass);
		pushy.toggleClass(pushyClass);
		push.toggleClass(pushClass); //css class to add pushy capability

		if(that.containerPush){
			container.toggleClass(containerClass);

			// if TOP position the height calculate dynamicaly
			if(that.menuPosition == POSITION_TOP){
				if(isOpenPushy())
				{
					container.css('transform', 'translate3d(0,' + pushy.height() + 'px,0)');
				}else{
					container.css('transform', 'translate3d(0,0,0)');
				}
			}
		}
	}

	function isOpenPushy(){
		var open = false;

		switch(that.menuPosition){
			case POSITION_TOP:
				open = pushy.hasClass("pushy-top-open");
			break;
			case POSITION_LEFT:
				open = pushy.hasClass("pushy-left-open");
			break;
			case POSITION_RIGHT:
				open = pushy.hasClass("pushy-right-open");
			break;
		}

		return open;
	}

	function openPushyFallback(){
		overlayPushy.addClass(pushyActiveClass);
		pushy.animate({left: "0px"}, menuSpeed);
		container.animate({left: menuWidth}, menuSpeed);
		push.animate({left: menuWidth}, menuSpeed); //css class to add pushy capability
	}

	function closePushyFallback(){
		overlayPushy.removeClass(pushyActiveClass);
		pushy.animate({left: "-" + menuWidth}, menuSpeed);
		container.animate({left: "0px"}, menuSpeed);
		push.animate({left: "0px"}, menuSpeed); //css class to add pushy capability
	}

	//checks if 3d transforms are supported removing the modernizr dependency
	cssTransforms3d = (function csstransforms3d(){
		var el = document.createElement('p'),
		supported = false,
		transforms = {
		    'webkitTransform':'-webkit-transform',
		    'OTransform':'-o-transform',
		    'msTransform':'-ms-transform',
		    'MozTransform':'-moz-transform',
		    'transform':'transform'
		};

		// Add it to the body to get the computed style
		document.body.insertBefore(el, null);

		for(var t in transforms){
		    if( el.style[t] !== undefined ){
		        el.style[t] = 'translate3d(1px,1px,1px)';
		        supported = window.getComputedStyle(el).getPropertyValue(transforms[t]);
		    }
		}

		document.body.removeChild(el);

		return (supported !== undefined && supported.length > 0 && supported !== "none");
	})();

	if(cssTransforms3d){
		//toggle menu
		menuBtn.click(function() {
			togglePushy();
		});

		//close menu when clicking site overlay
		overlayPushy.click(function(){
			togglePushy();
		});

	}else{
		//jQuery fallback
		pushy.css({left: "-" + menuWidth}); //hide menu by default
		container.css({"overflow-x": "hidden"}); //fixes IE scrollbar issue

		//keep track of menu state (open/close)
		var state = true;

		//toggle menu
		menuBtn.click(function() {
			if (state) {
				openPushyFallback();
				state = false;
			} else {
				closePushyFallback();
				state = true;
			}
		});

		//close menu when clicking site overlay
		siteOverlay.click(function(){
			if (state) {
				openPushyFallback();
				state = false;
			} else {
				closePushyFallback();
				state = true;
			}
		});
	}
}


text:
package com.twitter.server.handler

import com.twitter.finagle.Service
import com.twitter.finagle.http.{Request, Response}
import com.twitter.io.Buf
import com.twitter.server.handler.LintHandler.LintView
import com.twitter.server.util.AdminJsonConverter
import com.twitter.server.util.HtmlUtils.escapeHtml
import com.twitter.server.util.HttpUtils._
import com.twitter.util.Future
import com.twitter.util.lint.{GlobalRules, Issue, Rule}

/**
 * UI for running the globally registered lint [[Rule Rules]].
 */
class LintHandler extends Service[Request, Response] {

  def apply(req: Request): Future[Response] =
    if (expectsHtml(req) && !expectsJson(req)) htmlResponse(req) else jsonResponse(req)

  private[this] def htmlResponse(req: Request): Future[Response] = {
    // first, run the rules.
    val rules = GlobalRules.get.iterable.toSeq
    val (oks, nots) = rules
      .map(rule => rule -> rule())
      .partition { case (_, res) => res.isEmpty }

    // render the ui and respond
    val view = new LintView(rules, oks.map(o => o._1), nots)
    val rendered = view()
    newResponse(
      // note: contentType must be explicit here because of `IndexView.isFragment`
      contentType = "text/html;charset=UTF-8",
      content = Buf.Utf8(rendered)
    )
  }

  private[this] def jsonString(s: String): String =
    s.replace("\n", " ").trim

  private[this] def jsonRule(rule: Rule): Map[String, Any] =
    Map(
      "category" -> rule.category.toString,
      "id" -> rule.id,
      "name" -> rule.name,
      "description" -> jsonString(rule.description)
    )

  private[this] def jsonResponse(req: Request): Future[Response] = {
    val rules = GlobalRules.get.iterable.toSeq
    val jsonMap = jsonMapFromRules(rules)
    newOk(AdminJsonConverter.writeToString(jsonMap), "application/json;charset=UTF-8")
  }

  /** exposed for testing */
  private[handler] def jsonMapFromRules(rules: Seq[Rule]): Map[String, Any] = {
    val (oks, nots) = rules
      .map(rule => rule -> rule())
      .partition { case (_, res) => res.isEmpty }

    val numIssues = nots.foldLeft(0) {
      case (total, (_, issues)) =>
        total + issues.size
    }

    val failureIssues = nots.map {
      case (rule, issues) =>
        jsonRule(rule) ++
          Map("issues" -> issues.map(i => jsonString(i.details)))
    }

    val okRules = oks.map {
      case (rule, _) =>
        rule.id
    }

    Map(
      "lint_results" ->
        Map(
          "metadata" ->
            Map(
              "num_rules_run" -> rules.size,
              "num_rules_ok" -> oks.size,
              "num_rules_failed" -> nots.size,
              "num_issues_found" -> numIssues
            ),
          "failed_rules" -> failureIssues,
          "ok_rules" -> okRules
        )
    )
  }

}

private object LintHandler {

  /**
   * Web UI for [[LintHandler]].
   */
  class LintView(rules: Seq[Rule], oks: Seq[Rule], nots: Seq[(Rule, Seq[Issue])]) {

    def apply(): String = {
      scriptHeader +
        summary +
        failedRows +
        okRows
    }

    private def scriptHeader: String =
      """
"""

    def summary: String = {
      val numIssues = nots.foldLeft(0) {
        case (total, (_, issues)) =>
          total + issues.size
      }

      s"""

Summary

            Number of rules run
            ${escapeHtml(rules.size.toString)}

            Number of rules ok
            ${escapeHtml(oks.size.toString)}

            Number of rules failed
            ${escapeHtml(nots.size.toString)}

            Number of issues found
            ${escapeHtml(numIssues.toString)}

"""
    }

    def nameWithDescription(rule: Rule): String = {
      val desc = escapeHtml(rule.description)
      s"""

        ${escapeHtml(rule.name)}

      """
    }

    def failedRow(rule: Rule, issue: Issue): String = {
      s"""

        ${nameWithDescription(rule)}
        ${escapeHtml(issue.details)}

"""
    }

    def failedRows: String = {
      val data = nots
        .map {
          case (rule, issues) =>
            issues
              .map { issue => failedRow(rule, issue) }
              .mkString("")
        }
        .mkString("")

      s"""

Failed rules

          Name
          Issue

      $data

"""
    }

    def okRows: String = {
      val data = oks
        .map { rule =>
          s"""

            ${nameWithDescription(rule)}

        """
        }
        .mkString("")

      s"""

Ok rules

          Name

      $data

"""
    }

  }

}


text:
Types
=====

.. doxygentypedef:: gboolean


text:
package org.apache.flink.table.data;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.table.types.logical.ArrayType;

import org.apache.commons.lang3.ArrayUtils;

import java.util.Arrays;
import java.util.Objects;

/**
 * An internal data structure representing data of {@link ArrayType}.
 *
 *
Note: All elements of this data structure must be internal data structures and must be of the
 * same type. See {@link RowData} for more information about internal data structures.
 *
 *
{@link GenericArrayData} is a generic implementation of {@link ArrayData} which wraps regular
 * Java arrays.
 *
 *
Every instance wraps a one-dimensional Java array. Non-primitive arrays can be used for
 * representing element nullability. The Java array might be a primitive array such as {@code int[]}
 * or an object array (i.e. instance of {@code Object[]}). Object arrays that contain boxed types
 * (e.g. {@link Integer}) MUST be boxed arrays (i.e. {@code new Integer[]{1, 2, 3}}, not {@code new
 * Object[]{1, 2, 3}}). For multidimensional arrays, an array of {@link GenericArrayData} MUST be
 * passed. For example:
 *
 *
{@code
 * // ARRAY < ARRAY < INT NOT NULL > >
 * new GenericArrayData(
 *   new GenericArrayData[]{
 *     new GenericArrayData(new int[3]),
 *     new GenericArrayData(new int[5])
 *   }
 * )
 * }

 */
@PublicEvolving
public final class GenericArrayData implements ArrayData {

    private final Object array;
    private final int size;
    private final boolean isPrimitiveArray;

    /**
     * Creates an instance of {@link GenericArrayData} using the given Java array.
     *
     *
Note: All elements of the array must be internal data structures.
     */
    public GenericArrayData(Object[] array) {
        this(array, array.length, false);
    }

    public GenericArrayData(int[] primitiveArray) {
        this(primitiveArray, primitiveArray.length, true);
    }

    public GenericArrayData(long[] primitiveArray) {
        this(primitiveArray, primitiveArray.length, true);
    }

    public GenericArrayData(float[] primitiveArray) {
        this(primitiveArray, primitiveArray.length, true);
    }

    public GenericArrayData(double[] primitiveArray) {
        this(primitiveArray, primitiveArray.length, true);
    }

    public GenericArrayData(short[] primitiveArray) {
        this(primitiveArray, primitiveArray.length, true);
    }

    public GenericArrayData(byte[] primitiveArray) {
        this(primitiveArray, primitiveArray.length, true);
    }

    public GenericArrayData(boolean[] primitiveArray) {
        this(primitiveArray, primitiveArray.length, true);
    }

    private GenericArrayData(Object array, int size, boolean isPrimitiveArray) {
        this.array = array;
        this.size = size;
        this.isPrimitiveArray = isPrimitiveArray;
    }

    /**
     * Returns true if this is a primitive array.
     *
     *
A primitive array is an array whose elements are of primitive type.
     */
    public boolean isPrimitiveArray() {
        return isPrimitiveArray;
    }

    /**
     * Converts this {@link GenericArrayData} into an array of Java {@link Object}.
     *
     *
The method will convert a primitive array into an object array. But it will not convert
     * internal data structures into external data structures (e.g. {@link StringData} to {@link
     * String}).
     */
    public Object[] toObjectArray() {
        if (isPrimitiveArray) {
            Class<?> arrayClass = array.getClass();
            if (int[].class.equals(arrayClass)) {
                return ArrayUtils.toObject((int[]) array);
            } else if (long[].class.equals(arrayClass)) {
                return ArrayUtils.toObject((long[]) array);
            } else if (float[].class.equals(arrayClass)) {
                return ArrayUtils.toObject((float[]) array);
            } else if (double[].class.equals(arrayClass)) {
                return ArrayUtils.toObject((double[]) array);
            } else if (short[].class.equals(arrayClass)) {
                return ArrayUtils.toObject((short[]) array);
            } else if (byte[].class.equals(arrayClass)) {
                return ArrayUtils.toObject((byte[]) array);
            } else if (boolean[].class.equals(arrayClass)) {
                return ArrayUtils.toObject((boolean[]) array);
            }
            throw new RuntimeException("Unsupported primitive array: " + arrayClass);
        } else {
            return (Object[]) array;
        }
    }

    @Override
    public int size() {
        return size;
    }

    @Override
    public boolean isNullAt(int pos) {
        return !isPrimitiveArray && ((Object[]) array)[pos] == null;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GenericArrayData that = (GenericArrayData) o;
        return size == that.size
                && isPrimitiveArray == that.isPrimitiveArray
                && Objects.deepEquals(array, that.array);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(size, isPrimitiveArray);
        result = 31 * result + Arrays.deepHashCode(new Object[] {array});
        return result;
    }

    // ------------------------------------------------------------------------------------------
    // Read-only accessor methods
    // ------------------------------------------------------------------------------------------

    @Override
    public boolean getBoolean(int pos) {
        return isPrimitiveArray ? ((boolean[]) array)[pos] : (boolean) getObject(pos);
    }

    @Override
    public byte getByte(int pos) {
        return isPrimitiveArray ? ((byte[]) array)[pos] : (byte) getObject(pos);
    }

    @Override
    public short getShort(int pos) {
        return isPrimitiveArray ? ((short[]) array)[pos] : (short) getObject(pos);
    }

    @Override
    public int getInt(int pos) {
        return isPrimitiveArray ? ((int[]) array)[pos] : (int) getObject(pos);
    }

    @Override
    public long getLong(int pos) {
        return isPrimitiveArray ? ((long[]) array)[pos] : (long) getObject(pos);
    }

    @Override
    public float getFloat(int pos) {
        return isPrimitiveArray ? ((float[]) array)[pos] : (float) getObject(pos);
    }

    @Override
    public double getDouble(int pos) {
        return isPrimitiveArray ? ((double[]) array)[pos] : (double) getObject(pos);
    }

    @Override
    public byte[] getBinary(int pos) {
        return (byte[]) getObject(pos);
    }

    @Override
    public StringData getString(int pos) {
        return (StringData) getObject(pos);
    }

    @Override
    public DecimalData getDecimal(int pos, int precision, int scale) {
        return (DecimalData) getObject(pos);
    }

    @Override
    public TimestampData getTimestamp(int pos, int precision) {
        return (TimestampData) getObject(pos);
    }

    @SuppressWarnings("unchecked")
    @Override
    public <T> RawValueData<T> getRawValue(int pos) {
        return (RawValueData<T>) getObject(pos);
    }

    @Override
    public RowData getRow(int pos, int numFields) {
        return (RowData) getObject(pos);
    }

    @Override
    public ArrayData getArray(int pos) {
        return (ArrayData) getObject(pos);
    }

    @Override
    public MapData getMap(int pos) {
        return (MapData) getObject(pos);
    }

    private Object getObject(int pos) {
        return ((Object[]) array)[pos];
    }

    // ------------------------------------------------------------------------------------------
    // Conversion Utilities
    // ------------------------------------------------------------------------------------------

    private boolean anyNull() {
        for (Object element : (Object[]) array) {
            if (element == null) {
                return true;
            }
        }
        return false;
    }

    private void checkNoNull() {
        if (anyNull()) {
            throw new RuntimeException("Primitive array must not contain a null value.");
        }
    }

    @Override
    public boolean[] toBooleanArray() {
        if (isPrimitiveArray) {
            return (boolean[]) array;
        }
        checkNoNull();
        return ArrayUtils.toPrimitive((Boolean[]) array);
    }

    @Override
    public byte[] toByteArray() {
        if (isPrimitiveArray) {
            return (byte[]) array;
        }
        checkNoNull();
        return ArrayUtils.toPrimitive((Byte[]) array);
    }

    @Override
    public short[] toShortArray() {
        if (isPrimitiveArray) {
            return (short[]) array;
        }
        checkNoNull();
        return ArrayUtils.toPrimitive((Short[]) array);
    }

    @Override
    public int[] toIntArray() {
        if (isPrimitiveArray) {
            return (int[]) array;
        }
        checkNoNull();
        return ArrayUtils.toPrimitive((Integer[]) array);
    }

    @Override
    public long[] toLongArray() {
        if (isPrimitiveArray) {
            return (long[]) array;
        }
        checkNoNull();
        return ArrayUtils.toPrimitive((Long[]) array);
    }

    @Override
    public float[] toFloatArray() {
        if (isPrimitiveArray) {
            return (float[]) array;
        }
        checkNoNull();
        return ArrayUtils.toPrimitive((Float[]) array);
    }

    @Override
    public double[] toDoubleArray() {
        if (isPrimitiveArray) {
            return (double[]) array;
        }
        checkNoNull();
        return ArrayUtils.toPrimitive((Double[]) array);
    }
}


text:
(function() {
    var pe = game.ParticleEditor = game.ParticleEditor || {};

    pe.PropertyWrapper = Object.extend({
        init : function(propertyName) {
            this.object = null;
            this.propertyPath = propertyName.split(".");
            this.propertyName = this.propertyPath.pop();
        },
        _getNestedObject : function() {
            var object = this.object;
            for ( var i = 0, propertyPath = this.propertyPath, length = propertyPath.length; i < length; ++i) {
                object = object[propertyPath[i]];
            }
            return object;
        },
        getValue : function() {
            if (!this.object) {
                return;
            }
            var object = this._getNestedObject();
            return object[this.propertyName];
        },
        setValue : function(value) {
            if (!this.object) {
                return false;
            }
            var object = this._getNestedObject(), propertyName = this.propertyName;
            if (object[propertyName] !== value) {
                object[propertyName] = value;
                me.event.publish("propertyChanged", [ this.object ]);
                return true;
            }
            return false;
        },
    });

    pe.WidgetBase = Object.extend({
        init : function(propertyName) {
            this.property = new pe.PropertyWrapper(propertyName);
            this.rootNode = null;
        },
        addInput : function(label, input) {
            if (!this.rootNode) {
                this.rootNode = document.createElement("div");
            }
            var labelNode = document.createElement("label");
            labelNode.appendChild(document.createTextNode(label.replace(/([A-Z])/g, ' $1').toLowerCase()))
            labelNode.appendChild(input)
            this.rootNode.appendChild(labelNode);
        },
        setObject : function(object) {
            this.property.object = object;
        },
        sync : function() {
            console.warn("sync is not implemented yet.");
        },
        appendTo : function(container) {
            if (this.rootNode) {
                container.appendChild(this.rootNode);
            }
        }
    });

    pe.NumberInputWidget = pe.WidgetBase.extend({
        init : function(propertyName, settings) {
            this._super(pe.WidgetBase, 'init', [propertyName]);
            settings = settings || {};

            var container = document.createElement("div");
            container.classList.add("slider");

            var slider = this.slider = document.createElement("input");
            var input = this.input = document.createElement("input");
            slider.setAttribute("type", "range");
            input.setAttribute("type", "number");

            if (typeof settings.step === "number") {
                slider.setAttribute("step", settings.step);
                input.setAttribute("step", (settings.step % 1 > 0) ? "any" : "1");
            } else {
                slider.setAttribute("step", "any");
                input.setAttribute("step", "any");
            }

            var min = (typeof settings.min === "number") ? settings.min : -Infinity;
            var max = (typeof settings.max === "number") ? settings.max : Infinity;
            input.setAttribute("min", min);
            input.setAttribute("max", max);

            var sliderMin = (typeof settings.sliderMin === "number") ? settings.sliderMin : -Infinity;
            var sliderMax = (typeof settings.sliderMax === "number") ? settings.sliderMax : Infinity;
            slider.setAttribute("min", Math.max(min, sliderMin));
            slider.setAttribute("max", Math.min(max, sliderMax));

            slider.addEventListener("input", this.onSliderChange.bind(this));
            slider.addEventListener("change", this.onSliderChange.bind(this));
            input.addEventListener("change", this.onChange.bind(this));

            container.appendChild(slider);
            container.appendChild(input);

            this.addInput(propertyName, container);
        },
        onSliderChange : function() {
            if (this.slider.validity.valid) {
                this.property.setValue(parseFloat(this.slider.value));
            }
        },
        onChange : function() {
            if (this.input.validity.valid) {
                this.property.setValue(parseFloat(this.input.value));
            }
        },
        sync : function() {
            var value = this.property.getValue();
            this.input.value = value;
            this.slider.value = value;
        }
    });

    pe.TextInputWidget = pe.WidgetBase.extend({
        init : function(propertyName) {
            this._super(pe.WidgetBase, 'init', [propertyName]);

            var input = this.input = document.createElement("input");
            input.setAttribute("type", "text");
            input.addEventListener("change", this.onChange.bind(this));
            this.addInput(propertyName, input);
        },
        onChange : function() {
            if (this.input.validity.valid) {
                this.property.setValue(this.input.value);
            }
        },
        sync : function() {
            this.input.value = this.property.getValue() || "";
        }
    });

    pe.BooleanInputWidget = pe.WidgetBase.extend({
        init : function(propertyName) {
            this._super(pe.WidgetBase, 'init', [propertyName]);

            var input = this.input = document.createElement("input");
            input.setAttribute("type", "checkbox");
            input.addEventListener("change", this.onChange.bind(this));
            this.addInput(propertyName, input);
        },
        onChange : function() {
            this.property.setValue(this.input.checked);
        },
        sync : function() {
            this.input.checked = this.property.getValue();
        }
    });

    pe.ImageSelectionWidget = pe.WidgetBase.extend({
        init : function(propertyName, resourceList) {
            this._super(pe.WidgetBase, 'init', [propertyName]);

            var select = this.select = document.createElement("select");
            select.addEventListener("change", this.onChange.bind(this));
            this.resourceList = resourceList = resourceList || game.resources || [];
            for ( var i = 0, length = resourceList.length, resource, option; i < length; ++i) {
                resource = resourceList[i];
                if (resource.type === "image") {
                    option = document.createElement("option");
                    option.setAttribute("value", resource.name);
                    option.appendChild(document.createTextNode(resource.name));
                    select.appendChild(option);
                }
            }
            this.addInput(propertyName, select);
        },
        onChange : function() {
            var image = me.loader.getImage(this.select.value);
            this.property.setValue(image);
        },
        sync : function() {
            var image = this.property.getValue();
            if (image) {
                var resourceList = this.resourceList;
                for ( var i = 0, length = resourceList.length, resource; i < length; ++i) {
                    resource = resourceList[i];
                    if (image === me.loader.getImage(resource.name)) {
                        this.select.selectedIndex = i;
                        break;
                    }
                }
            } else {
                this.select.selectedIndex = -1;
            }
        }
    });

    pe.ShapeWidget = pe.WidgetBase.extend({
        init : function() {
            this._super(pe.WidgetBase, 'init', [""]);

            this.shape = new pe.ShapeWidget.Helper("rgba(255, 86, 86, 0.3)");
            this.dragHandler = new pe.DragHandler(new me.Color(255, 86, 86, 1));
            this.dragHandler.onDrag = this.onDrag.bind(this);

            var input = this.input = document.createElement("input");
            input.setAttribute("type", "checkbox");
            input.addEventListener("change", this.onChange.bind(this));
            this.addInput("shape widget", input);
        },
        setObject : function(object) {
            this.object = object;
        },
        onDrag : function(pos) {
            var object = this.object;
            if (object) {
                pos.sub(object.pos).clampSelf(0, Infinity);
                object.resize(pos.x, pos.y);
                me.event.publish("propertyChanged", [ object ]);
            }
        },
        onChange : function() {
            if (this.input.checked) {
                me.game.world.addChild(this.shape);
                this.dragHandler.enable();
            } else {
                me.game.world.removeChild(this.shape);
                this.dragHandler.disable();
            }
        },
        show : function() {
            if (!this.input.checked) {
                this.input.checked = true;
                this.onChange();
            }
        },
        hide : function() {
            if (this.input.checked) {
                this.input.checked = false;
                this.onChange();
            }
        },
        sync : function() {
            var object = this.object;
            if (object) {
                this.dragHandler.floating = this.shape.floating = object.floating;
                this.shape.setShape(object.pos, object.width, object.height);
                this.dragHandler.setPosition(object.pos.x + object.width, object.pos.y + object.height);
            }
        }
    });

    pe.ShapeWidget.Helper = me.Renderable.extend({
        init : function(color) {
            this._super(me.Renderable, 'init', [0, 0, 0, 0]);
            this.z = Infinity;
            this.color = color;
        },
        setShape : function(v, w, h) {
            this.resize(w, h);
            this.pos.set(v.x, v.y);
            return this;
        },
        draw : function(renderer) {
            renderer.setColor(this.color);
            renderer.fillRect(this.left, this.top, this.width, this.height);
            renderer.setLineWidth(1);
            renderer.strokeRect(this.left, this.top, this.width, this.height);
        }
    });

    pe.DragHandler = me.Renderable.extend({
        init : function(color) {
            this.originalSize = 40;
            this.createGradients(color, this.originalSize);
            this._super(me.Renderable, 'init', [0, 0, this.originalSize, this.originalSize]);
            this.z = Infinity;
            this.dragging = false;
            this.grabOffset = new me.Vector2d(0, 0);

            this._startDrag = this.startDrag.bind(this);
            this._stopDrag = this.stopDrag.bind(this);
            this._drag = this.drag.bind(this);

            this.onDrag = function() {};

            me.input.registerPointerEvent("pointerup", me.game.viewport, this._stopDrag);
            me.input.registerPointerEvent("pointermove", me.game.viewport, this._drag);
        },
        createGradients : function(color, size) {
            var context = me.video.renderer.getContext();
            var bigGradient = this.bigGradient = context.createRadialGradient(0, 0, 0, 0, 0, size / 2);
            var smallGradient = this.smallGradient = context.createRadialGradient(0, 0, 0, 0, 0, size / 4);

            color.alpha = 0;
            bigGradient.addColorStop(0, color.toRGBA());
            smallGradient.addColorStop(0, color.toRGBA());

            color.alpha = 0.8;
            bigGradient.addColorStop(0.9, color.toRGBA());
            smallGradient.addColorStop(0.9, color.toRGBA());

            color.alpha = 0;
            bigGradient.addColorStop(1, color.toRGBA());
            smallGradient.addColorStop(1, color.toRGBA());

            this.color = bigGradient;
        },
        enable : function(container) {
            me.input.registerPointerEvent("pointerdown", this, this._startDrag);
            (container || me.game.world).addChild(this);
        },
        disable : function(container) {
            if (this.dragging) {
                this.stopDrag();
            }
            me.input.releasePointerEvent("pointerdown", this, this._startDrag);
            (container || this.ancestor || me.game.world).removeChild(this);
        },
        setPosition : function(x, y) {
            this.pos.set(x - (this.width / 2), y - (this.height / 2));
        },
        startDrag : function(event) {
            this.dragging = true;
            this.color = this.smallGradient;

            var size = this.originalSize / 2;
            this.resize(size, size);
            size /= 2;
            this.translate(size, size);

            var mousepos = me.input.mouse.pos;
            var x = mousepos.x - this.pos.x;
            var y = mousepos.y - this.pos.y;
            this.grabOffset.set(x, y);
            return false;
        },
        stopDrag : function() {
            if (this.dragging) {
                this.dragging = false;
                this.color = this.bigGradient;
                var size = this.originalSize;
                this.resize(size, size);
                size /= -4;
                this.translate(size, size);
                return false;
            }
        },
        drag : function(event) {
            if (this.dragging) {
                var pos = me.input.mouse.pos.clone().sub(this.grabOffset);
                pos.x += (this.width / 2);
                pos.y += (this.height / 2);
                this.onDrag(pos);
                return false;
            }
        },
        draw : function(renderer) {
            renderer.save();
            var context = renderer.getContext();
            context.fillStyle = this.color;
            renderer.fillArc(this.pos.x, this.pos.y, this.width / 2, 0, Math.PI * 2);
            renderer.restore();
        }
    });

    pe.VectorWidget = pe.WidgetBase.extend({
        init : function(name, color) {
            this._super(pe.WidgetBase, 'init', [""]);
            this.origin = new me.Vector2d(0, 0);
            this.vector = new me.Vector2d(0, 0);

            this.shape = new pe.VectorWidget.Helper(this, color);
            this.dragHandler = new pe.DragHandler(color);
            this.dragHandler.onDrag = this.onDrag.bind(this);

            var input = this.input = document.createElement("input");
            input.setAttribute("type", "checkbox");
            input.addEventListener("change", this.onChange.bind(this));
            this.addInput(name + " widget", input);
        },
        setObject : function(object) {
            this.object = object;
        },
        setVector : function(x, y) {
            this.vector.set(x, y);
            this.dragHandler.setPosition(this.origin.x + x, this.origin.y + y);
        },
        onDrag : function(pos) {
            var object = this.object;
            if (object) {
                pos.x -= object.pos.x + (object.width / 2);
                pos.y -= object.pos.y + (object.height / 2);
                var x = pos.x;
                var y = pos.y;
                if (x !== this.vector.x || y !== this.vector.y) {
                    this.onVectorChanged(pos);
                    this.setVector(x, y);
                    me.event.publish("propertyChanged", [ object ]);
                }
            }
        },
        onChange : function() {
            if (this.input.checked) {
                me.game.world.addChild(this.shape);
                this.dragHandler.enable();
            } else {
                me.game.world.removeChild(this.shape);
                this.dragHandler.disable();
            }
        },
        show : function() {
            if (!this.input.checked) {
                this.input.checked = true;
                this.onChange();
            }
        },
        hide : function() {
            if (this.input.checked) {
                this.input.checked = false;
                this.onChange();
            }
        },
        sync : function() {
            var object = this.object;
            if (object) {
                this.dragHandler.floating = this.shape.floating = object.floating;
                this.origin.set(object.pos.x + (object.width / 2), object.pos.y + (object.height / 2));
                this.onSync(object);
                this.shape.setShape(this.origin, this.vector.x, this.vector.y);
            }
        },
        onVectorChanged : function(vector) {
        },
        onSync : function(object) {
        }
    });

    pe.VectorWidget.Helper = me.Renderable.extend({
        init : function(widget, color) {
            this._super(me.Renderable, 'init', [0, 0, 0, 0]);
            this.widget = widget;
            this.z = Infinity;
            this.color = color.toRGBA();
        },
        setShape : function(v, w, h) {
            var x = w < 0 ? v.x + w : v.x;
            var y = h < 0 ? v.y + h : v.y;
            this.pos.set(x, y);
            this.resize(Math.abs(w), Math.abs(h));
            return this;
        },
        draw : function(renderer) {
            var origin = this.widget.origin;
            var vector = this.widget.vector;
            renderer.save();
            renderer.setColor(this.color);
            renderer.setLineWidth(5);
            renderer.strokeLine(
                origin.x,
                origin.y,
                origin.x + vector.x,
                origin.y + vector.y
            );
            renderer.restore();
        }
    });

    pe.VelocityWidget = pe.VectorWidget.extend({
        init : function() {
            this._super(pe.VectorWidget, 'init', ["velocity", new me.Color(229, 216, 47, 0.3)]);
            this.scale = 30;
        },
        onVectorChanged : function(vector) {
            var object = this.object;
            object.speed = vector.length() / this.scale;
            object.angle = Math.atan2(vector.x, vector.y) - Math.PI / 2;
            if (object.angle < -Math.PI) {
                object.angle += 2 * Math.PI;
            }
        },
        onSync : function(object) {
            var length = object.speed * this.scale;
            var angle = object.angle;
            this.setVector(Math.cos(angle) * length, -Math.sin(angle) * length);
        }
    });

    pe.ForceWidget = pe.VectorWidget.extend({
        init : function() {
            this._super(pe.VectorWidget, 'init', ["force", new me.Color(79, 214, 72, 0.3)]);
            this.scale = 300;
        },
        onVectorChanged : function(vector) {
            var object = this.object;
            object.wind = vector.x / this.scale;
            object.gravity = vector.y / this.scale;
        },
        onSync : function(object) {
            this.setVector(object.wind * this.scale, object.gravity * this.scale);
        }
    });

    pe.VelocityVariationWidget = pe.WidgetBase.extend({
        init : function() {
            this._super(pe.WidgetBase, 'init', [""]);
            this.scale = 30;

            this.shape = new pe.VelocityVariationWidget.Helper(new me.Color(105, 190, 255, 0.3));
            this.dragHandler = new pe.DragHandler(new me.Color(150, 150, 255, 1));
            this.dragHandler.onDrag = this.onDrag.bind(this);

            var input = this.input = document.createElement("input");
            input.setAttribute("type", "checkbox");
            input.addEventListener("change", this.onChange.bind(this));
            this.addInput("velocity variation widget", input);
        },
        onDrag : function(pos) {
            var object = this.object;
            if (object) {
                pos.x -= object.pos.x + (object.width / 2);
                pos.y -= object.pos.y + (object.height / 2);
                var variation = object.angle - Math.atan2(-pos.y, pos.x);
                if (variation < -Math.PI / 2) {
                    variation += 2 * Math.PI;
                }
                object.angleVariation = variation.clamp(0, Math.PI);
                variation = (pos.length() / this.scale) - object.speed;
                object.speedVariation = variation < 0 ? 0 : variation;
                me.event.publish("propertyChanged", [ object ]);
            }
        },
        onChange : function() {
            if (this.input.checked) {
                me.game.world.addChild(this.shape);
                this.dragHandler.enable();
            } else {
                me.game.world.removeChild(this.shape);
                this.dragHandler.disable();
            }
        },
        show : function() {
            if (!this.input.checked) {
                this.input.checked = true;
                this.onChange();
            }
        },
        hide : function() {
            if (this.input.checked) {
                this.input.checked = false;
                this.onChange();
            }
        },
        setObject : function(object) {
            this.object = object;
        },
        sync : function() {
            var object = this.object;
            if (object) {
                this.shape.floating = object.floating;
                this.dragHandler.floating = object.floating;

                this.shape.set(object);
                var angle = object.angle - object.angleVariation;
                var radius = (object.speed + object.speedVariation) * this.scale;
                var x = object.pos.x + (object.width / 2) + Math.cos(angle) * radius;
                var y = object.pos.y + (object.height / 2) - Math.sin(angle) * radius;
                this.dragHandler.setPosition(x, y);
            }
        }
    });

    pe.VelocityVariationWidget.Helper = me.Renderable.extend({
        init : function(color) {
            this._super(me.Renderable, 'init', [0, 0, 0, 0]);
            this.color = color.toRGBA();
            this.startAngle = 0;
            this.endAngle = 0;
            this.minRadius = 0;
            this.maxRadius = 0;
            this.scale = 30;
            this.z = Infinity;
        },
        set : function(object) {
            this.pos.set(object.pos.x + (object.width / 2), object.pos.y + (object.height / 2));
            this.startAngle = -(object.angle - object.angleVariation);
            this.endAngle = -(object.angle + object.angleVariation);
            this.minRadius = (object.speed - object.speedVariation) * this.scale;
            this.maxRadius = (object.speed + object.speedVariation) * this.scale;
        },
        draw : function(renderer) {
            var x = this.pos.x,
                y = this.pos.y,
                context = renderer.getContext();

            context.strokeStyle = this.color;
            context.fillStyle = this.color;
            context.beginPath();
            context.arc(x, y, this.maxRadius, this.startAngle, this.endAngle, true);
            if (this.minRadius < 0) {
                context.arc(x, y, -this.minRadius, this.endAngle + Math.PI, this.startAngle + Math.PI);
            } else {
                context.arc(x, y, this.minRadius, this.endAngle, this.startAngle);
            }
            context.closePath();
            context.fill();
            context.stroke();
        }
    });
})();


text:
package graphql.execution.instrumentation.dataloader;

import graphql.ExecutionResult;
import graphql.ExecutionResultImpl;
import graphql.PublicApi;
import graphql.collect.ImmutableKit;
import graphql.execution.AsyncExecutionStrategy;
import graphql.execution.ExecutionContext;
import graphql.execution.ExecutionStrategy;
import graphql.execution.instrumentation.ExecutionStrategyInstrumentationContext;
import graphql.execution.instrumentation.InstrumentationContext;
import graphql.execution.instrumentation.InstrumentationState;
import graphql.execution.instrumentation.SimplePerformantInstrumentation;
import graphql.execution.instrumentation.parameters.InstrumentationCreateStateParameters;
import graphql.execution.instrumentation.parameters.InstrumentationExecuteOperationParameters;
import graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters;
import graphql.execution.instrumentation.parameters.InstrumentationExecutionStrategyParameters;
import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters;
import graphql.language.OperationDefinition;
import graphql.schema.DataFetcher;
import org.dataloader.DataLoader;
import org.dataloader.DataLoaderRegistry;
import org.dataloader.stats.Statistics;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

import static graphql.execution.instrumentation.InstrumentationState.ofState;
import static graphql.execution.instrumentation.SimpleInstrumentationContext.noOp;

/**
 * This graphql {@link graphql.execution.instrumentation.Instrumentation} will dispatch
 * all the contained {@link org.dataloader.DataLoader}s when each level of the graphql
 * query is executed.
 *

 * This allows you to use {@link org.dataloader.DataLoader}s in your {@link graphql.schema.DataFetcher}s
 * to optimal loading of data.
 *

 * A DataLoaderDispatcherInstrumentation will be automatically added to the {@link graphql.GraphQL}
 * instrumentation list if one is not present.
 *
 * @see org.dataloader.DataLoader
 * @see org.dataloader.DataLoaderRegistry
 */
@PublicApi
public class DataLoaderDispatcherInstrumentation extends SimplePerformantInstrumentation {

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

    private final DataLoaderDispatcherInstrumentationOptions options;

    /**
     * Creates a DataLoaderDispatcherInstrumentation with the default options
     */
    public DataLoaderDispatcherInstrumentation() {
        this(DataLoaderDispatcherInstrumentationOptions.newOptions());
    }

    /**
     * Creates a DataLoaderDispatcherInstrumentation with the specified options
     *
     * @param options the options to control the behaviour
     */
    public DataLoaderDispatcherInstrumentation(DataLoaderDispatcherInstrumentationOptions options) {
        this.options = options;
    }

    @Override
    public InstrumentationState createState(InstrumentationCreateStateParameters parameters) {
        return new DataLoaderDispatcherInstrumentationState(log, parameters.getExecutionInput().getDataLoaderRegistry());
    }

    @Override
    public @NotNull DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters, InstrumentationState rawState) {
        DataLoaderDispatcherInstrumentationState state = ofState(rawState);
        if (state.isAggressivelyBatching()) {
            return dataFetcher;
        }
        //
        // currently only AsyncExecutionStrategy with DataLoader and hence this allows us to "dispatch"
        // on every object if it's not using aggressive batching for other execution strategies
        // which allows them to work if used.
        return (DataFetcher<Object>) environment -> {
            Object obj = dataFetcher.get(environment);
            immediatelyDispatch(state);
            return obj;
        };
    }

    private void immediatelyDispatch(DataLoaderDispatcherInstrumentationState state) {
        state.getApproach().dispatch();
    }

    @Override
    public @Nullable InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters, InstrumentationState rawState) {
        DataLoaderDispatcherInstrumentationState state = ofState(rawState);
        //
        // during #instrumentExecutionInput they could have enhanced the data loader registry
        // so we grab it now just before the query operation gets started
        //
        DataLoaderRegistry finalRegistry = parameters.getExecutionContext().getDataLoaderRegistry();
        state.setDataLoaderRegistry(finalRegistry);
        if (!isDataLoaderCompatibleExecution(parameters.getExecutionContext())) {
            state.setAggressivelyBatching(false);
        }
        return noOp();
    }

    private boolean isDataLoaderCompatibleExecution(ExecutionContext executionContext) {
        //
        // Currently we only support aggressive batching for the AsyncExecutionStrategy.
        // This may change in the future but this is the fix for now.
        //
        OperationDefinition.Operation operation = executionContext.getOperationDefinition().getOperation();
        ExecutionStrategy strategy = executionContext.getStrategy(operation);
        return (strategy instanceof AsyncExecutionStrategy);
    }

    @Override
    public @Nullable ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters, InstrumentationState rawState) {
        DataLoaderDispatcherInstrumentationState state = ofState(rawState);
        //
        // if there are no data loaders, there is nothing to do
        //
        if (state.hasNoDataLoaders()) {
            return new ExecutionStrategyInstrumentationContext() {
                @Override
                public void onDispatched(CompletableFuture<ExecutionResult> result) {
                }

                @Override
                public void onCompleted(ExecutionResult result, Throwable t) {
                }
            };

        }
        return state.getApproach().beginExecutionStrategy(parameters, state.getState());
    }

    @Override
    public @Nullable InstrumentationContext<Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters, InstrumentationState rawState) {
        DataLoaderDispatcherInstrumentationState state = ofState(rawState);
        //
        // if there are no data loaders, there is nothing to do
        //
        if (state.hasNoDataLoaders()) {
            return noOp();
        }
        return state.getApproach().beginFieldFetch(parameters, state.getState());
    }

    @Override
    public @NotNull CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters, InstrumentationState rawState) {
        if (!options.isIncludeStatistics()) {
            return CompletableFuture.completedFuture(executionResult);
        }
        DataLoaderDispatcherInstrumentationState state = ofState(rawState);
        Map<Object, Object> currentExt = executionResult.getExtensions();
        Map<Object, Object> statsMap = new LinkedHashMap<>(currentExt == null ? ImmutableKit.emptyMap() : currentExt);
        Map<Object, Object> dataLoaderStats = buildStatsMap(state);
        statsMap.put("dataloader", dataLoaderStats);

        if (log.isDebugEnabled()) {
            log.debug("Data loader stats : {}", dataLoaderStats);
        }

        return CompletableFuture.completedFuture(new ExecutionResultImpl(executionResult.getData(), executionResult.getErrors(), statsMap));
    }

    private Map<Object, Object> buildStatsMap(DataLoaderDispatcherInstrumentationState state) {
        DataLoaderRegistry dataLoaderRegistry = state.getDataLoaderRegistry();
        Statistics allStats = dataLoaderRegistry.getStatistics();
        Map<Object, Object> statsMap = new LinkedHashMap<>();
        statsMap.put("overall-statistics", allStats.toMap());

        Map<Object, Object> individualStatsMap = new LinkedHashMap<>();

        for (String dlKey : dataLoaderRegistry.getKeys()) {
            DataLoader<Object, Object> dl = dataLoaderRegistry.getDataLoader(dlKey);
            Statistics statistics = dl.getStatistics();
            individualStatsMap.put(dlKey, statistics.toMap());
        }

        statsMap.put("individual-statistics", individualStatsMap);

        return statsMap;
    }
}