text:
namespace System.Xml.Xsl.XsltOld {
    using Res = System.Xml.Utils.Res;
    using System;
    using System.Diagnostics;
    using System.Text;
    using System.Xml;
    using System.Xml.XPath;
    using System.Collections;

    internal sealed class RecordBuilder {
        private int             outputState;
        private RecordBuilder   next;

        RecordOutput            output;

        // Atomization:
        private XmlNameTable    nameTable;
        private OutKeywords     atoms;

        // Namespace manager for output
        private OutputScopeManager  scopeManager;

        // Main node + Fields Collection
        private BuilderInfo     mainNode           = new BuilderInfo();
        private ArrayList       attributeList      = new ArrayList();
        private int             attributeCount;
        private ArrayList       namespaceList      = new ArrayList();
        private int             namespaceCount;
        private BuilderInfo     dummy = new BuilderInfo();

        // Current position in the list
        private BuilderInfo     currentInfo;
        // Builder state
        private bool            popScope;
        private int             recordState;
        private int             recordDepth;

        private const int       NoRecord    = 0;      // No part of a new record was generated (old record was cleared out)
        private const int       SomeRecord  = 1;      // Record was generated partially        (can be eventually record)
        private const int       HaveRecord  = 2;      // Record was fully generated

        private const char      s_Minus         = '-';
        private const string    s_Space         = " ";
        private const string    s_SpaceMinus    = " -";
        private const char      s_Question      = '?';
        private const char      s_Greater       = '>';
        private const string    s_SpaceGreater  = " >";

        private const string    PrefixFormat    = "xp_{0}";

        internal RecordBuilder(RecordOutput output, XmlNameTable nameTable) {
            Debug.Assert(output != null);
            this.output    = output;
            this.nameTable = nameTable != null ? nameTable : new NameTable();
            this.atoms     = new OutKeywords(this.nameTable);
            this.scopeManager   = new OutputScopeManager(this.nameTable, this.atoms);
        }

        //
        // Internal properties
        //

        internal int OutputState {
            get { return this.outputState; }
            set { this.outputState = value; }
        }

        internal RecordBuilder Next {
            get { return this.next; }
            set { this.next = value; }
        }

        internal RecordOutput Output {
            get { return this.output; }
        }

        internal BuilderInfo MainNode {
            get { return this.mainNode; }
        }

        internal ArrayList AttributeList {
            get { return this.attributeList; }
        }

        internal int AttributeCount {
            get { return this.attributeCount; }
        }

        internal OutputScopeManager Manager {
            get { return this.scopeManager; }
        }

        private void ValueAppend(string s, bool disableOutputEscaping) {
            this.currentInfo.ValueAppend(s, disableOutputEscaping);
        }

        private bool CanOutput(int state) {
            Debug.Assert(this.recordState != HaveRecord);

            // If we have no record cached or the next event doesn't start new record, we are OK

            if (this.recordState == NoRecord || (state & StateMachine.BeginRecord) == 0) {
                return true;
            }
            else {
                this.recordState = HaveRecord;
                FinalizeRecord();
                SetEmptyFlag(state);
                return this.output.RecordDone(this) == Processor.OutputResult.Continue;
            }
        }

        internal Processor.OutputResult BeginEvent(int state, XPathNodeType nodeType, string prefix, string name, string nspace, bool empty, Object htmlProps, bool search) {
            if (! CanOutput(state)) {
                return Processor.OutputResult.Overflow;
            }

            Debug.Assert(this.recordState == NoRecord || (state & StateMachine.BeginRecord) == 0);

            AdjustDepth(state);
            ResetRecord(state);
            PopElementScope();

            prefix = (prefix != null) ? this.nameTable.Add(prefix) : this.atoms.Empty;
            name   = (name   != null) ? this.nameTable.Add(name)   : this.atoms.Empty;
            nspace = (nspace != null) ? this.nameTable.Add(nspace) : this.atoms.Empty;

            switch (nodeType) {
            case XPathNodeType.Element:
                this.mainNode.htmlProps = htmlProps as HtmlElementProps;
                this.mainNode.search = search;
                BeginElement(prefix, name, nspace, empty);
                break;
            case XPathNodeType.Attribute:
                BeginAttribute(prefix, name, nspace, htmlProps, search);
                break;
            case XPathNodeType.Namespace:
                BeginNamespace(name, nspace);
                break;
            case XPathNodeType.Text:
                break;
            case XPathNodeType.ProcessingInstruction:
                if (BeginProcessingInstruction(prefix, name, nspace) == false) {
                    return Processor.OutputResult.Error;
                }
                break;
            case XPathNodeType.Comment:
                BeginComment();
                break;
            case XPathNodeType.Root:
                break;
            case XPathNodeType.Whitespace:
            case XPathNodeType.SignificantWhitespace:
            case XPathNodeType.All:
                break;
            }

            return CheckRecordBegin(state);
        }

        internal Processor.OutputResult TextEvent(int state, string text, bool disableOutputEscaping) {
            if (! CanOutput(state)) {
                return Processor.OutputResult.Overflow;
            }

            Debug.Assert(this.recordState == NoRecord || (state & StateMachine.BeginRecord) == 0);

            AdjustDepth(state);
            ResetRecord(state);
            PopElementScope();

            if ((state & StateMachine.BeginRecord) != 0) {
                this.currentInfo.Depth      = this.recordDepth;
                this.currentInfo.NodeType   = XmlNodeType.Text;
            }

            ValueAppend(text, disableOutputEscaping);

            return CheckRecordBegin(state);
        }

        internal Processor.OutputResult EndEvent(int state, XPathNodeType nodeType) {
            if (! CanOutput(state)) {
                return Processor.OutputResult.Overflow;
            }

            AdjustDepth(state);
            PopElementScope();
            this.popScope = (state & StateMachine.PopScope) != 0;

            if ((state & StateMachine.EmptyTag) != 0 && this.mainNode.IsEmptyTag == true) {
                return Processor.OutputResult.Continue;
            }

            ResetRecord(state);

            if ((state & StateMachine.BeginRecord) != 0) {
                if(nodeType == XPathNodeType.Element) {
                    EndElement();
                }
            }

            return CheckRecordEnd(state);
        }

        internal void Reset() {
            if (this.recordState == HaveRecord) {
                this.recordState = NoRecord;
            }
        }

        internal void TheEnd() {
            if (this.recordState == SomeRecord) {
                this.recordState = HaveRecord;
                FinalizeRecord();
                this.output.RecordDone(this);
            }
            this.output.TheEnd();
        }

        //
        // Utility implementation methods
        //

        private int FindAttribute(string name, string nspace, ref string prefix) {
            Debug.Assert(this.attributeCount <= this.attributeList.Count);

            for (int attrib = 0; attrib < this.attributeCount; attrib ++) {
                Debug.Assert(this.attributeList[attrib] != null && this.attributeList[attrib] is BuilderInfo);

                BuilderInfo attribute = (BuilderInfo) this.attributeList[attrib];

                if (Ref.Equal(attribute.LocalName, name)) {
                    if (Ref.Equal(attribute.NamespaceURI, nspace)) {
                        return attrib;
                    }
                    if (Ref.Equal(attribute.Prefix, prefix)) {
                        // prefix conflict. Should be renamed.
                        prefix = string.Empty;
                    }
                }

            }

            return -1;
        }

        private void BeginElement(string prefix, string name, string nspace, bool empty) {
            Debug.Assert(this.attributeCount == 0);

            this.currentInfo.NodeType     = XmlNodeType.Element;
            this.currentInfo.Prefix       = prefix;
            this.currentInfo.LocalName    = name;
            this.currentInfo.NamespaceURI = nspace;
            this.currentInfo.Depth        = this.recordDepth;
            this.currentInfo.IsEmptyTag   = empty;

            this.scopeManager.PushScope(name, nspace, prefix);
        }

        private void EndElement() {
            Debug.Assert(this.attributeCount == 0);
            OutputScope elementScope = this.scopeManager.CurrentElementScope;

            this.currentInfo.NodeType     = XmlNodeType.EndElement;
            this.currentInfo.Prefix       = elementScope.Prefix;
            this.currentInfo.LocalName    = elementScope.Name;
            this.currentInfo.NamespaceURI = elementScope.Namespace;
            this.currentInfo.Depth        = this.recordDepth;
        }

        private int NewAttribute() {
            if (this.attributeCount >= this.attributeList.Count) {
                Debug.Assert(this.attributeCount == this.attributeList.Count);
                this.attributeList.Add(new BuilderInfo());
            }
            return this.attributeCount ++;
        }

        private void BeginAttribute(string prefix, string name, string nspace, Object htmlAttrProps, bool search) {
            int attrib = FindAttribute(name, nspace, ref prefix);

            if (attrib == -1) {
                attrib = NewAttribute();
            }

            Debug.Assert(this.attributeList[attrib] != null && this.attributeList[attrib] is BuilderInfo);

            BuilderInfo attribute = (BuilderInfo) this.attributeList[attrib];
            attribute.Initialize(prefix, name, nspace);
            attribute.Depth = this.recordDepth;
            attribute.NodeType = XmlNodeType.Attribute;
            attribute.htmlAttrProps = htmlAttrProps as HtmlAttributeProps;
            attribute.search = search;
            this.currentInfo  = attribute;
        }

        private void BeginNamespace(string name, string nspace) {
            bool thisScope = false;
            if (Ref.Equal(name, this.atoms.Empty)) {
                if (Ref.Equal(nspace, this.scopeManager.DefaultNamespace)) {
                    // Main Node is OK
                }
                else if (Ref.Equal(this.mainNode.NamespaceURI, this.atoms.Empty)) {
                    // http://www.w3.org/1999/11/REC-xslt-19991116-errata/ E25
                    // Should throw an error but ingnoring it in Everett.
                    // Would be a breaking change
                }
                else {
                    DeclareNamespace(nspace, name);
                }
            }
            else {
                string nspaceDeclared = this.scopeManager.ResolveNamespace(name, out thisScope);
                if (nspaceDeclared != null) {
                    if (! Ref.Equal(nspace, nspaceDeclared)) {
                        if(!thisScope) {
                            DeclareNamespace(nspace, name);
                        }
                    }
                }
                else {
                     DeclareNamespace(nspace, name);
                }
            }
            this.currentInfo = dummy;
            currentInfo.NodeType = XmlNodeType.Attribute;
        }

        private bool BeginProcessingInstruction(string prefix, string name, string nspace) {
            this.currentInfo.NodeType     = XmlNodeType.ProcessingInstruction;
            this.currentInfo.Prefix       = prefix;
            this.currentInfo.LocalName    = name;
            this.currentInfo.NamespaceURI = nspace;
            this.currentInfo.Depth  = this.recordDepth;
            return true;
        }

        private void BeginComment() {
            this.currentInfo.NodeType   = XmlNodeType.Comment;
            this.currentInfo.Depth = this.recordDepth;
        }

        private void AdjustDepth(int state) {
            switch (state & StateMachine.DepthMask) {
            case StateMachine.DepthUp:
                this.recordDepth ++;
                break;
            case StateMachine.DepthDown:
                this.recordDepth --;
                break;
            default:
                break;
            }
        }

        private void ResetRecord(int state) {
            Debug.Assert(this.recordState == NoRecord || this.recordState == SomeRecord);

            if ((state & StateMachine.BeginRecord) != 0) {
                this.attributeCount     = 0;
                this.namespaceCount     = 0;
                this.currentInfo        = this.mainNode;

                this.currentInfo.Initialize(this.atoms.Empty, this.atoms.Empty, this.atoms.Empty);
                this.currentInfo.NodeType      = XmlNodeType.None;
                this.currentInfo.IsEmptyTag    = false;
                this.currentInfo.htmlProps     = null;
                this.currentInfo.htmlAttrProps = null;
            }
        }

        private void PopElementScope() {
            if (this.popScope) {
                this.scopeManager.PopScope();
                this.popScope = false;
            }
        }

        private Processor.OutputResult CheckRecordBegin(int state) {
            Debug.Assert(this.recordState == NoRecord || this.recordState == SomeRecord);

            if ((state & StateMachine.EndRecord) != 0) {
                this.recordState = HaveRecord;
                FinalizeRecord();
                SetEmptyFlag(state);
                return this.output.RecordDone(this);
            }
            else {
                this.recordState = SomeRecord;
                return Processor.OutputResult.Continue;
            }
        }

        private Processor.OutputResult CheckRecordEnd(int state) {
            Debug.Assert(this.recordState == NoRecord || this.recordState == SomeRecord);

            if ((state & StateMachine.EndRecord) != 0) {
                this.recordState = HaveRecord;
                FinalizeRecord();
                SetEmptyFlag(state);
                return this.output.RecordDone(this);
            }
            else {
                // For end event, if there is no end token, don't force token
                return Processor.OutputResult.Continue;
            }
        }

        private void SetEmptyFlag(int state) {
            Debug.Assert(this.mainNode != null);

            if ((state & StateMachine.BeginChild) != 0) {
                this.mainNode.IsEmptyTag = false;
            }
        }

        private void AnalyzeSpaceLang() {
            Debug.Assert(this.mainNode.NodeType == XmlNodeType.Element);

            for (int attr = 0; attr < this.attributeCount; attr ++) {
                Debug.Assert(this.attributeList[attr] is BuilderInfo);
                BuilderInfo info = (BuilderInfo) this.attributeList[attr];

                if (Ref.Equal(info.Prefix, this.atoms.Xml)) {
                    OutputScope scope = this.scopeManager.CurrentElementScope;

                    if (Ref.Equal(info.LocalName, this.atoms.Lang)) {
                        scope.Lang  = info.Value;
                    }
                    else if (Ref.Equal(info.LocalName, this.atoms.Space)) {
                        scope.Space = TranslateXmlSpace(info.Value);
                    }
                }
            }
        }

        private void FixupElement() {
            Debug.Assert(this.mainNode.NodeType == XmlNodeType.Element);

            if (Ref.Equal(this.mainNode.NamespaceURI, this.atoms.Empty)) {
                this.mainNode.Prefix = this.atoms.Empty;
            }

            if (Ref.Equal(this.mainNode.Prefix, this.atoms.Empty)) {
                if (Ref.Equal(this.mainNode.NamespaceURI, this.scopeManager.DefaultNamespace)) {
                    // Main Node is OK
                }
                else {
                    DeclareNamespace(this.mainNode.NamespaceURI, this.mainNode.Prefix);
                }
            }
            else {
                bool   thisScope = false;
                string nspace = this.scopeManager.ResolveNamespace(this.mainNode.Prefix, out thisScope);
                if (nspace != null) {
                    if (! Ref.Equal(this.mainNode.NamespaceURI, nspace)) {
                        if (thisScope) {    // Prefix conflict
                            this.mainNode.Prefix = GetPrefixForNamespace(this.mainNode.NamespaceURI);
                        }
                        else {
                            DeclareNamespace(this.mainNode.NamespaceURI, this.mainNode.Prefix);
                        }
                    }
                }
                else {
                    DeclareNamespace(this.mainNode.NamespaceURI, this.mainNode.Prefix);
                }
            }

            OutputScope elementScope = this.scopeManager.CurrentElementScope;
            elementScope.Prefix      = this.mainNode.Prefix;
        }

        private void FixupAttributes(int attributeCount) {
            for (int attr = 0; attr < attributeCount; attr ++) {
                Debug.Assert(this.attributeList[attr] is BuilderInfo);
                BuilderInfo info = (BuilderInfo) this.attributeList[attr];

                if (Ref.Equal(info.NamespaceURI, this.atoms.Empty)) {
                    info.Prefix = this.atoms.Empty;
                }
                else {
                    if (Ref.Equal(info.Prefix, this.atoms.Empty)) {
                        info.Prefix = GetPrefixForNamespace(info.NamespaceURI);
                    }
                    else {
                        bool thisScope = false;
                        string nspace = this.scopeManager.ResolveNamespace(info.Prefix, out thisScope);
                        if (nspace != null) {
                            if (! Ref.Equal(info.NamespaceURI, nspace)) {
                                if(thisScope) { // prefix conflict
                                    info.Prefix = GetPrefixForNamespace(info.NamespaceURI);
                                }
                                else {
                                    DeclareNamespace(info.NamespaceURI, info.Prefix);
                                }
                            }
                        }
                        else {
                            DeclareNamespace(info.NamespaceURI, info.Prefix);
                        }
                    }
                }
            }
        }

        private void AppendNamespaces() {
            for (int i = this.namespaceCount - 1; i >= 0; i --) {
                BuilderInfo attribute = (BuilderInfo) this.attributeList[NewAttribute()];
                attribute.Initialize((BuilderInfo)this.namespaceList[i]);
            }
        }

        private void AnalyzeComment() {
            Debug.Assert(this.mainNode.NodeType == XmlNodeType.Comment);
            Debug.Assert((object) this.currentInfo == (object) this.mainNode);

            StringBuilder newComment = null;
            string        comment    = this.mainNode.Value;
            bool          minus      = false;
            int index = 0, begin = 0;

            for (; index < comment.Length; index ++) {
                switch (comment[index]) {
                    case s_Minus:
                        if (minus) {
                            if (newComment == null)
                                newComment = new StringBuilder(comment, begin, index, 2 * comment.Length);
                            else
                                newComment.Append(comment, begin, index - begin);

                            newComment.Append(s_SpaceMinus);
                            begin = index + 1;
                        }
                        minus = true;
                        break;
                    default:
                        minus = false;
                        break;
                }
            }

            if (newComment != null) {
                if (begin < comment.Length)
                    newComment.Append(comment, begin, comment.Length - begin);

                if (minus)
                    newComment.Append(s_Space);

                this.mainNode.Value = newComment.ToString();
            }
            else if (minus) {
                this.mainNode.ValueAppend(s_Space, false);
            }
        }

        private void AnalyzeProcessingInstruction() {
            Debug.Assert(this.mainNode.NodeType == XmlNodeType.ProcessingInstruction || this.mainNode.NodeType == XmlNodeType.XmlDeclaration);
            //Debug.Assert((object) this.currentInfo == (object) this.mainNode);

            StringBuilder newPI    = null;
            string        pi       = this.mainNode.Value;
            bool          question = false;
            int index = 0, begin = 0;

            for (; index < pi.Length; index ++) {
                switch (pi[index]) {
                case s_Question:
                    question = true;
                    break;
                case s_Greater:
                    if (question) {
                        if (newPI == null) {
                            newPI = new StringBuilder(pi, begin, index, 2 * pi.Length);
                        }
                        else {
                            newPI.Append(pi, begin, index - begin);
                        }
                        newPI.Append(s_SpaceGreater);
                        begin = index + 1;
                    }
                    question = false;
                    break;
                default:
                    question = false;
                    break;
                }
            }

            if (newPI != null) {
                if (begin < pi.Length) {
                    newPI.Append(pi, begin, pi.Length - begin);
                }
                this.mainNode.Value = newPI.ToString();
            }
        }

        private void FinalizeRecord() {
            switch (this.mainNode.NodeType) {
            case XmlNodeType.Element:
                // Save count since FixupElement can add attribute...
                int attributeCount = this.attributeCount;

                FixupElement();
                FixupAttributes(attributeCount);
                AnalyzeSpaceLang();
                AppendNamespaces();
                break;
            case XmlNodeType.Comment:
                AnalyzeComment();
                break;
            case XmlNodeType.ProcessingInstruction:
                AnalyzeProcessingInstruction();
                break;
            }
        }

        private int NewNamespace() {
            if (this.namespaceCount >= this.namespaceList.Count) {
                Debug.Assert(this.namespaceCount == this.namespaceList.Count);
                this.namespaceList.Add(new BuilderInfo());
            }
            return this.namespaceCount ++;
        }

        private void DeclareNamespace(string nspace, string prefix) {
            int index = NewNamespace();

            Debug.Assert(this.namespaceList[index] != null && this.namespaceList[index] is BuilderInfo);

            BuilderInfo ns = (BuilderInfo) this.namespaceList[index];
            if (prefix == this.atoms.Empty) {
                ns.Initialize(this.atoms.Empty, this.atoms.Xmlns, this.atoms.XmlnsNamespace);
            }
            else {
                ns.Initialize(this.atoms.Xmlns, prefix, this.atoms.XmlnsNamespace);
            }
            ns.Depth = this.recordDepth;
            ns.NodeType = XmlNodeType.Attribute;
            ns.Value = nspace;

            this.scopeManager.PushNamespace(prefix, nspace);
        }

        private string DeclareNewNamespace(string nspace) {
            string prefix = this.scopeManager.GeneratePrefix(PrefixFormat);
            DeclareNamespace(nspace, prefix);
            return prefix;
        }

        internal string GetPrefixForNamespace(string nspace) {
            string prefix = null;

            if (this.scopeManager.FindPrefix(nspace, out prefix)) {
                Debug.Assert(prefix != null && prefix.Length > 0);
                return prefix;
            }
            else {
                return DeclareNewNamespace(nspace);
            }
        }

        private static XmlSpace TranslateXmlSpace(string space) {
            if (space == "default") {
                return XmlSpace.Default;
            }
            else if (space == "preserve") {
                return XmlSpace.Preserve;
            }
            else {
                return XmlSpace.None;
            }
        }
    }
}


text:
  <button class="menu-icon" type="button" data-toggle></button>

Menu

            <input type="search" placeholder="Search everything...">

            Search

        <%= __('menu.marketplace') %>

        <%= __('menu.account.workspace') %>

        <%= __('menu.account.settings') %>

        <%= __('menu.login') %>

        <%= __('menu.logout') %>

redpajama_set_name: RedPajamaGithub


text:
define("dojox/grid/util", [
	"../main",
	"dojo/_base/lang",
	"dojo/dom"
], function(dojox, lang, dom){

	var dgu = lang.getObject("grid.util", true, dojox);

/*=====
dgu = {
	// summary:
	//		grid utility library
};
=====*/

	dgu.na = '...';
	dgu.rowIndexTag = "gridRowIndex";
	dgu.gridViewTag = "gridView";

	dgu.fire = function(ob, ev, args){
		var fn = ob && ev && ob[ev];
		return fn && (args ? fn.apply(ob, args) : ob[ev]());
	};

	dgu.setStyleHeightPx = function(inElement, inHeight){
		if(inHeight >= 0){
			var s = inElement.style;
			var v = inHeight + 'px';
			if(inElement && s['height'] != v){
				s['height'] = v;
			}
		}
	};

	dgu.mouseEvents = [ 'mouseover', 'mouseout', /*'mousemove',*/ 'mousedown', 'mouseup', 'click', 'dblclick', 'contextmenu' ];

	dgu.keyEvents = [ 'keyup', 'keydown', 'keypress' ];

	dgu.funnelEvents = function(inNode, inObject, inMethod, inEvents){
		var evts = (inEvents ? inEvents : dgu.mouseEvents.concat(dgu.keyEvents));
		for (var i=0, l=evts.length; i<l; i++){
			inObject.connect(inNode, 'on' + evts[i], inMethod);
		}
	};

	dgu.removeNode = function(inNode){
		inNode = dom.byId(inNode);
		inNode && inNode.parentNode && inNode.parentNode.removeChild(inNode);
		return inNode;
	};

	dgu.arrayCompare = function(inA, inB){
		for(var i=0,l=inA.length; i<l; i++){
			if(inA[i] != inB[i]){return false;}
		}
		return (inA.length == inB.length);
	};

	dgu.arrayInsert = function(inArray, inIndex, inValue){
		if(inArray.length <= inIndex){
			inArray[inIndex] = inValue;
		}else{
			inArray.splice(inIndex, 0, inValue);
		}
	};

	dgu.arrayRemove = function(inArray, inIndex){
		inArray.splice(inIndex, 1);
	};

	dgu.arraySwap = function(inArray, inI, inJ){
		var cache = inArray[inI];
		inArray[inI] = inArray[inJ];
		inArray[inJ] = cache;
	};

	return dgu;

});


text:
package org.apache.shardingsphere.driver.jdbc.adapter;

import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.metadata.resource.CachedDatabaseMetaData;

import java.sql.DatabaseMetaData;
import java.sql.RowIdLifetime;

/**
 * Adapted database meta data.
 */
@RequiredArgsConstructor
public abstract class AdaptedDatabaseMetaData extends WrapperAdapter implements DatabaseMetaData {

    private final CachedDatabaseMetaData cachedDatabaseMetaData;

    @Override
    public final String getURL() {
        return cachedDatabaseMetaData.getUrl();
    }

    @Override
    public final String getUserName() {
        return cachedDatabaseMetaData.getUserName();
    }

    @Override
    public final String getDatabaseProductName() {
        return cachedDatabaseMetaData.getDatabaseProductName();
    }

    @Override
    public final String getDatabaseProductVersion() {
        return cachedDatabaseMetaData.getDatabaseProductVersion();
    }

    @Override
    public final String getDriverName() {
        return cachedDatabaseMetaData.getDriverName();
    }

    @Override
    public final String getDriverVersion() {
        return cachedDatabaseMetaData.getDriverVersion();
    }

    @Override
    public final int getDriverMajorVersion() {
        return cachedDatabaseMetaData.getDriverMajorVersion();
    }

    @Override
    public final int getDriverMinorVersion() {
        return cachedDatabaseMetaData.getDriverMinorVersion();
    }

    @Override
    public final int getDatabaseMajorVersion() {
        return cachedDatabaseMetaData.getDatabaseMajorVersion();
    }

    @Override
    public final int getDatabaseMinorVersion() {
        return cachedDatabaseMetaData.getDatabaseMinorVersion();
    }

    @Override
    public final int getJDBCMajorVersion() {
        return cachedDatabaseMetaData.getJdbcMajorVersion();
    }

    @Override
    public final int getJDBCMinorVersion() {
        return cachedDatabaseMetaData.getJdbcMinorVersion();
    }

    @Override
    public final boolean isReadOnly() {
        return cachedDatabaseMetaData.isReadOnly();
    }

    @Override
    public final boolean allProceduresAreCallable() {
        return cachedDatabaseMetaData.isAllProceduresAreCallable();
    }

    @Override
    public final boolean allTablesAreSelectable() {
        return cachedDatabaseMetaData.isAllTablesAreSelectable();
    }

    @Override
    public final boolean nullsAreSortedHigh() {
        return cachedDatabaseMetaData.isNullsAreSortedHigh();
    }

    @Override
    public final boolean nullsAreSortedLow() {
        return cachedDatabaseMetaData.isNullsAreSortedLow();
    }

    @Override
    public final boolean nullsAreSortedAtStart() {
        return cachedDatabaseMetaData.isNullsAreSortedAtStart();
    }

    @Override
    public final boolean nullsAreSortedAtEnd() {
        return cachedDatabaseMetaData.isNullsAreSortedAtEnd();
    }

    @Override
    public final boolean usesLocalFiles() {
        return cachedDatabaseMetaData.isUsesLocalFiles();
    }

    @Override
    public final boolean usesLocalFilePerTable() {
        return cachedDatabaseMetaData.isUsesLocalFilePerTable();
    }

    @Override
    public final boolean supportsMixedCaseIdentifiers() {
        return cachedDatabaseMetaData.isStoresMixedCaseIdentifiers();
    }

    @Override
    public final boolean storesUpperCaseIdentifiers() {
        return cachedDatabaseMetaData.isStoresUpperCaseIdentifiers();
    }

    @Override
    public final boolean storesLowerCaseIdentifiers() {
        return cachedDatabaseMetaData.isStoresLowerCaseIdentifiers();
    }

    @Override
    public final boolean storesMixedCaseIdentifiers() {
        return cachedDatabaseMetaData.isStoresMixedCaseIdentifiers();
    }

    @Override
    public final boolean supportsMixedCaseQuotedIdentifiers() {
        return cachedDatabaseMetaData.isSupportsMixedCaseQuotedIdentifiers();
    }

    @Override
    public final boolean storesUpperCaseQuotedIdentifiers() {
        return cachedDatabaseMetaData.isStoresUpperCaseQuotedIdentifiers();
    }

    @Override
    public final boolean storesLowerCaseQuotedIdentifiers() {
        return cachedDatabaseMetaData.isStoresLowerCaseQuotedIdentifiers();
    }

    @Override
    public final boolean storesMixedCaseQuotedIdentifiers() {
        return cachedDatabaseMetaData.isSupportsMixedCaseQuotedIdentifiers();
    }

    @Override
    public final String getIdentifierQuoteString() {
        return cachedDatabaseMetaData.getIdentifierQuoteString();
    }

    @Override
    public final String getSQLKeywords() {
        return cachedDatabaseMetaData.getSqlKeywords();
    }

    @Override
    public final String getNumericFunctions() {
        return cachedDatabaseMetaData.getNumericFunctions();
    }

    @Override
    public final String getStringFunctions() {
        return cachedDatabaseMetaData.getStringFunctions();
    }

    @Override
    public final String getSystemFunctions() {
        return cachedDatabaseMetaData.getSystemFunctions();
    }

    @Override
    public final String getTimeDateFunctions() {
        return cachedDatabaseMetaData.getTimeDateFunctions();
    }

    @Override
    public final String getSearchStringEscape() {
        return cachedDatabaseMetaData.getSearchStringEscape();
    }

    @Override
    public final String getExtraNameCharacters() {
        return cachedDatabaseMetaData.getExtraNameCharacters();
    }

    @Override
    public final boolean supportsAlterTableWithAddColumn() {
        return cachedDatabaseMetaData.isSupportsAlterTableWithAddColumn();
    }

    @Override
    public final boolean supportsAlterTableWithDropColumn() {
        return cachedDatabaseMetaData.isSupportsAlterTableWithDropColumn();
    }

    @Override
    public final boolean supportsColumnAliasing() {
        return cachedDatabaseMetaData.isSupportsColumnAliasing();
    }

    @Override
    public final boolean nullPlusNonNullIsNull() {
        return cachedDatabaseMetaData.isNullPlusNonNullIsNull();
    }

    @Override
    public final boolean supportsConvert() {
        return cachedDatabaseMetaData.isSupportsConvert();
    }

    @Override
    public final boolean supportsConvert(final int fromType, final int toType) {
        return cachedDatabaseMetaData.isSupportsConvert();
    }

    @Override
    public final boolean supportsTableCorrelationNames() {
        return cachedDatabaseMetaData.isSupportsTableCorrelationNames();
    }

    @Override
    public final boolean supportsDifferentTableCorrelationNames() {
        return cachedDatabaseMetaData.isSupportsDifferentTableCorrelationNames();
    }

    @Override
    public final boolean supportsExpressionsInOrderBy() {
        return cachedDatabaseMetaData.isSupportsExpressionsInOrderBy();
    }

    @Override
    public final boolean supportsOrderByUnrelated() {
        return cachedDatabaseMetaData.isSupportsOrderByUnrelated();
    }

    @Override
    public final boolean supportsGroupBy() {
        return cachedDatabaseMetaData.isSupportsGroupBy();
    }

    @Override
    public final boolean supportsGroupByUnrelated() {
        return cachedDatabaseMetaData.isSupportsGroupByUnrelated();
    }

    @Override
    public final boolean supportsGroupByBeyondSelect() {
        return cachedDatabaseMetaData.isSupportsGroupByBeyondSelect();
    }

    @Override
    public final boolean supportsLikeEscapeClause() {
        return cachedDatabaseMetaData.isSupportsLikeEscapeClause();
    }

    @Override
    public final boolean supportsMultipleResultSets() {
        return cachedDatabaseMetaData.isSupportsMultipleResultSets();
    }

    @Override
    public final boolean supportsMultipleTransactions() {
        return cachedDatabaseMetaData.isSupportsMultipleTransactions();
    }

    @Override
    public final boolean supportsNonNullableColumns() {
        return cachedDatabaseMetaData.isSupportsNonNullableColumns();
    }

    @Override
    public final boolean supportsMinimumSQLGrammar() {
        return cachedDatabaseMetaData.isSupportsMinimumSQLGrammar();
    }

    @Override
    public final boolean supportsCoreSQLGrammar() {
        return cachedDatabaseMetaData.isSupportsCoreSQLGrammar();
    }

    @Override
    public final boolean supportsExtendedSQLGrammar() {
        return cachedDatabaseMetaData.isSupportsExtendedSQLGrammar();
    }

    @Override
    public final boolean supportsANSI92EntryLevelSQL() {
        return cachedDatabaseMetaData.isSupportsANSI92EntryLevelSQL();
    }

    @Override
    public final boolean supportsANSI92IntermediateSQL() {
        return cachedDatabaseMetaData.isSupportsANSI92IntermediateSQL();
    }

    @Override
    public final boolean supportsANSI92FullSQL() {
        return cachedDatabaseMetaData.isSupportsANSI92FullSQL();
    }

    @Override
    public final boolean supportsIntegrityEnhancementFacility() {
        return cachedDatabaseMetaData.isSupportsIntegrityEnhancementFacility();
    }

    @Override
    public final boolean supportsOuterJoins() {
        return cachedDatabaseMetaData.isSupportsOuterJoins();
    }

    @Override
    public final boolean supportsFullOuterJoins() {
        return cachedDatabaseMetaData.isSupportsFullOuterJoins();
    }

    @Override
    public final boolean supportsLimitedOuterJoins() {
        return cachedDatabaseMetaData.isSupportsLimitedOuterJoins();
    }

    @Override
    public final String getSchemaTerm() {
        return cachedDatabaseMetaData.getSchemaTerm();
    }

    @Override
    public final String getProcedureTerm() {
        return cachedDatabaseMetaData.getProcedureTerm();
    }

    @Override
    public final String getCatalogTerm() {
        return cachedDatabaseMetaData.getCatalogTerm();
    }

    @Override
    public final boolean isCatalogAtStart() {
        return cachedDatabaseMetaData.isCatalogAtStart();
    }

    @Override
    public final String getCatalogSeparator() {
        return cachedDatabaseMetaData.getCatalogSeparator();
    }

    @Override
    public final boolean supportsSchemasInDataManipulation() {
        return cachedDatabaseMetaData.isSupportsSchemasInDataManipulation();
    }

    @Override
    public final boolean supportsSchemasInProcedureCalls() {
        return cachedDatabaseMetaData.isSupportsSchemasInProcedureCalls();
    }

    @Override
    public final boolean supportsSchemasInTableDefinitions() {
        return cachedDatabaseMetaData.isSupportsSchemasInTableDefinitions();
    }

    @Override
    public final boolean supportsSchemasInIndexDefinitions() {
        return cachedDatabaseMetaData.isSupportsSchemasInIndexDefinitions();
    }

    @Override
    public final boolean supportsSchemasInPrivilegeDefinitions() {
        return cachedDatabaseMetaData.isSupportsSchemasInPrivilegeDefinitions();
    }

    @Override
    public final boolean supportsCatalogsInDataManipulation() {
        return cachedDatabaseMetaData.isSupportsCatalogsInDataManipulation();
    }

    @Override
    public final boolean supportsCatalogsInProcedureCalls() {
        return cachedDatabaseMetaData.isSupportsCatalogsInProcedureCalls();
    }

    @Override
    public final boolean supportsCatalogsInTableDefinitions() {
        return cachedDatabaseMetaData.isSupportsCatalogsInTableDefinitions();
    }

    @Override
    public final boolean supportsCatalogsInIndexDefinitions() {
        return cachedDatabaseMetaData.isSupportsCatalogsInIndexDefinitions();
    }

    @Override
    public final boolean supportsCatalogsInPrivilegeDefinitions() {
        return cachedDatabaseMetaData.isSupportsCatalogsInPrivilegeDefinitions();
    }

    @Override
    public final boolean supportsPositionedDelete() {
        return cachedDatabaseMetaData.isSupportsPositionedDelete();
    }

    @Override
    public final boolean supportsPositionedUpdate() {
        return cachedDatabaseMetaData.isSupportsPositionedUpdate();
    }

    @Override
    public final boolean supportsSelectForUpdate() {
        return cachedDatabaseMetaData.isSupportsSelectForUpdate();
    }

    @Override
    public final boolean supportsStoredProcedures() {
        return cachedDatabaseMetaData.isSupportsStoredProcedures();
    }

    @Override
    public final boolean supportsSubqueriesInComparisons() {
        return cachedDatabaseMetaData.isSupportsSubqueriesInComparisons();
    }

    @Override
    public final boolean supportsSubqueriesInExists() {
        return cachedDatabaseMetaData.isSupportsSubqueriesInExists();
    }

    @Override
    public final boolean supportsSubqueriesInIns() {
        return cachedDatabaseMetaData.isSupportsSubqueriesInIns();
    }

    @Override
    public final boolean supportsSubqueriesInQuantifieds() {
        return cachedDatabaseMetaData.isSupportsSubqueriesInQuantifieds();
    }

    @Override
    public final boolean supportsCorrelatedSubqueries() {
        return cachedDatabaseMetaData.isSupportsCorrelatedSubqueries();
    }

    @Override
    public final boolean supportsUnion() {
        return cachedDatabaseMetaData.isSupportsUnion();
    }

    @Override
    public final boolean supportsUnionAll() {
        return cachedDatabaseMetaData.isSupportsUnionAll();
    }

    @Override
    public final boolean supportsOpenCursorsAcrossCommit() {
        return cachedDatabaseMetaData.isSupportsOpenCursorsAcrossCommit();
    }

    @Override
    public final boolean supportsOpenCursorsAcrossRollback() {
        return cachedDatabaseMetaData.isSupportsOpenCursorsAcrossRollback();
    }

    @Override
    public final boolean supportsOpenStatementsAcrossCommit() {
        return cachedDatabaseMetaData.isSupportsOpenStatementsAcrossCommit();
    }

    @Override
    public final boolean supportsOpenStatementsAcrossRollback() {
        return cachedDatabaseMetaData.isSupportsOpenStatementsAcrossRollback();
    }

    @Override
    public final int getMaxBinaryLiteralLength() {
        return cachedDatabaseMetaData.getMaxBinaryLiteralLength();
    }

    @Override
    public final int getMaxCharLiteralLength() {
        return cachedDatabaseMetaData.getMaxCharLiteralLength();
    }

    @Override
    public final int getMaxColumnNameLength() {
        return cachedDatabaseMetaData.getMaxColumnNameLength();
    }

    @Override
    public final int getMaxColumnsInGroupBy() {
        return cachedDatabaseMetaData.getMaxColumnsInGroupBy();
    }

    @Override
    public final int getMaxColumnsInIndex() {
        return cachedDatabaseMetaData.getMaxColumnsInIndex();
    }

    @Override
    public final int getMaxColumnsInOrderBy() {
        return cachedDatabaseMetaData.getMaxColumnsInOrderBy();
    }

    @Override
    public final int getMaxColumnsInSelect() {
        return cachedDatabaseMetaData.getMaxColumnsInSelect();
    }

    @Override
    public final int getMaxColumnsInTable() {
        return cachedDatabaseMetaData.getMaxColumnsInTable();
    }

    @Override
    public final int getMaxConnections() {
        return cachedDatabaseMetaData.getMaxConnections();
    }

    @Override
    public final int getMaxCursorNameLength() {
        return cachedDatabaseMetaData.getMaxCursorNameLength();
    }

    @Override
    public final int getMaxIndexLength() {
        return cachedDatabaseMetaData.getMaxIndexLength();
    }

    @Override
    public final int getMaxSchemaNameLength() {
        return cachedDatabaseMetaData.getMaxSchemaNameLength();
    }

    @Override
    public final int getMaxProcedureNameLength() {
        return cachedDatabaseMetaData.getMaxProcedureNameLength();
    }

    @Override
    public final int getMaxCatalogNameLength() {
        return cachedDatabaseMetaData.getMaxCatalogNameLength();
    }

    @Override
    public final int getMaxRowSize() {
        return cachedDatabaseMetaData.getMaxRowSize();
    }

    @Override
    public final boolean doesMaxRowSizeIncludeBlobs() {
        return cachedDatabaseMetaData.isDoesMaxRowSizeIncludeBlobs();
    }

    @Override
    public final int getMaxStatementLength() {
        return cachedDatabaseMetaData.getMaxStatementLength();
    }

    @Override
    public final int getMaxStatements() {
        return cachedDatabaseMetaData.getMaxStatements();
    }

    @Override
    public final int getMaxTableNameLength() {
        return cachedDatabaseMetaData.getMaxTableNameLength();
    }

    @Override
    public final int getMaxTablesInSelect() {
        return cachedDatabaseMetaData.getMaxTablesInSelect();
    }

    @Override
    public final int getMaxUserNameLength() {
        return cachedDatabaseMetaData.getMaxUserNameLength();
    }

    @Override
    public final int getDefaultTransactionIsolation() {
        return cachedDatabaseMetaData.getDefaultTransactionIsolation();
    }

    @Override
    public final boolean supportsTransactions() {
        return cachedDatabaseMetaData.isSupportsTransactions();
    }

    @Override
    public final boolean supportsDataDefinitionAndDataManipulationTransactions() {
        return cachedDatabaseMetaData.isSupportsDataDefinitionAndDataManipulationTransactions();
    }

    @Override
    public final boolean supportsDataManipulationTransactionsOnly() {
        return cachedDatabaseMetaData.isSupportsDataManipulationTransactionsOnly();
    }

    @Override
    public final boolean dataDefinitionCausesTransactionCommit() {
        return cachedDatabaseMetaData.isDataDefinitionCausesTransactionCommit();
    }

    @Override
    public final boolean dataDefinitionIgnoredInTransactions() {
        return cachedDatabaseMetaData.isDataDefinitionIgnoredInTransactions();
    }

    @Override
    public final boolean supportsBatchUpdates() {
        return cachedDatabaseMetaData.isSupportsBatchUpdates();
    }

    @Override
    public final boolean supportsSavepoints() {
        return cachedDatabaseMetaData.isSupportsSavepoints();
    }

    @Override
    public final boolean supportsNamedParameters() {
        return cachedDatabaseMetaData.isSupportsNamedParameters();
    }

    @Override
    public final boolean supportsMultipleOpenResults() {
        return cachedDatabaseMetaData.isSupportsMultipleOpenResults();
    }

    @Override
    public final boolean supportsGetGeneratedKeys() {
        return cachedDatabaseMetaData.isSupportsGetGeneratedKeys();
    }

    @Override
    public final int getResultSetHoldability() {
        return cachedDatabaseMetaData.getResultSetHoldability();
    }

    @SuppressWarnings("MagicConstant")
    @Override
    public final int getSQLStateType() {
        return cachedDatabaseMetaData.getSqlStateType();
    }

    @Override
    public final boolean locatorsUpdateCopy() {
        return cachedDatabaseMetaData.isLocatorsUpdateCopy();
    }

    @Override
    public final boolean supportsStatementPooling() {
        return cachedDatabaseMetaData.isSupportsStatementPooling();
    }

    @Override
    public final boolean supportsStoredFunctionsUsingCallSyntax() {
        return cachedDatabaseMetaData.isSupportsStoredFunctionsUsingCallSyntax();
    }

    @Override
    public final boolean autoCommitFailureClosesAllResultSets() {
        return cachedDatabaseMetaData.isAutoCommitFailureClosesAllResultSets();
    }

    @Override
    public final RowIdLifetime getRowIdLifetime() {
        return cachedDatabaseMetaData.getRowIdLifetime();
    }

    @Override
    public final boolean generatedKeyAlwaysReturned() {
        return cachedDatabaseMetaData.isGeneratedKeyAlwaysReturned();
    }

    @Override
    public final boolean ownInsertsAreVisible(final int type) {
        return true;
    }

    @Override
    public final boolean ownUpdatesAreVisible(final int type) {
        return true;
    }

    @Override
    public final boolean ownDeletesAreVisible(final int type) {
        return true;
    }

    @Override
    public final boolean othersInsertsAreVisible(final int type) {
        return true;
    }

    @Override
    public final boolean othersUpdatesAreVisible(final int type) {
        return true;
    }

    @Override
    public final boolean othersDeletesAreVisible(final int type) {
        return true;
    }

    @Override
    public final boolean insertsAreDetected(final int type) {
        return true;
    }

    @Override
    public final boolean updatesAreDetected(final int type) {
        return true;
    }

    @Override
    public final boolean deletesAreDetected(final int type) {
        return true;
    }

    @Override
    public final boolean supportsResultSetType(final int type) {
        return true;
    }

    @Override
    public final boolean supportsResultSetConcurrency(final int type, final int concurrency) {
        return true;
    }

    @Override
    public final boolean supportsResultSetHoldability(final int holdability) {
        return true;
    }

    @Override
    public final boolean supportsTransactionIsolationLevel(final int level) {
        return true;
    }
}


text:
var fs = require('fs');
var path = require('path');
var _ = require('lodash');
var getSize = require('get-folder-size');
var gzipSize = require('gzip-size');
var validateMessage = require('validate-commit-msg');

//simple regex matcher to detect usage of helper function and its type signature
var hotMatch = /\bhot\(/gi;
var hotSignatureMatch = /\bimport \{.*?hot.*?\} from '.*?\/helpers\/marble-testing'/gi;

var coldMatch = /\bcold\(/gi;
var coldSignatureMatch = /\bimport \{.*?cold.*?\} from '.*?\/helpers\/marble-testing'/gi;

var errorCount = 0;

// Warn when PR size is large
var bigPRThreshold = 600;
if (danger.github.pr.additions + danger.github.pr.deletions > bigPRThreshold) {
  warn(':exclamation: Big PR (' + ++errorCount + ')');
  markdown('> (' + errorCount + ') : Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR will helps faster, easier review.');
}

// Check test exclusion (.only) is included
var modifiedSpecFiles = danger.git.modified_files.filter(function (filePath) {
  return filePath.match(/-spec.(js|jsx|ts|tsx)$/gi);
});

var testFilesIncludeExclusion = modifiedSpecFiles.reduce(function (acc, value) {
  var content = fs.readFileSync(value).toString();
  var invalid = _.includes(content, 'it.only') || _.includes(content, 'describe.only');
  if (invalid) {
    acc.push(path.basename(value));
  }
  return acc;
}, []);

if (testFilesIncludeExclusion.length > 0) {
  fail('an \`only\` was left in tests (' + testFilesIncludeExclusion + ')');
}

// Check test cases missing type signature import for test marble helper functions
var testFilesMissingTypes = modifiedSpecFiles.reduce(function (acc, value) {
  var content = fs.readFileSync(value).toString();

  var hotFnMatchesWithoutTypes = content.match(hotMatch) && !content.match(hotSignatureMatch);
  var coldFnMatchesWithoutTypes = content.match(coldMatch) && !content.match(coldSignatureMatch);

  if (hotFnMatchesWithoutTypes || coldFnMatchesWithoutTypes) {
    acc.push(path.basename(value));
  }

  return acc;
}, []);

if (testFilesMissingTypes.length > 0) {
  fail('missing type definition import in tests (' + testFilesMissingTypes + ') (' + ++errorCount + ')');
  markdown('> (' + errorCount + ') : It seems updated test cases uses test scheduler interface `hot`, `cold` but miss to import type signature for those.');
}

//validate commit message in PR if it conforms conventional change log, notify if it doesn't.
var messageConventionValid = danger.git.commits.reduce(function (acc, value) {
  var valid = validateMessage(value.message);
  return valid && acc;
}, true);

if (!messageConventionValid) {
  warn('commit message does not follows conventional change log (' + ++errorCount + ')');
  markdown('> (' + errorCount + ') : RxJS uses conventional change log to generate changelog automatically. It seems some of commit messages are not following those, please check [contributing guideline](https://github.com/ReactiveX/rxjs/blob/master/CONTRIBUTING.md#commit-message-format) and update commit messages.');
}

// TODO(benlesh): update script to run against proper global files
// The name has changed to `rxjs.umd.js` from `Rx.js`

// function getKB(size) {
//   return (size / 1024).toFixed(1);
// }

// function getFormattedKB(size) {
//   if (size < 0) {
//     return '-' + size.toString();
//   } else if (size > 0) {
//     return '+' + size.toString();
//   }
//   return size.toString();
// }

// var globalFile = 'Rx.js';
// var minFile = 'Rx.min.js';

// function sizeDiffBadge(name, value) {
//   var color = 'lightgrey';
//   if (value > 0) {
//     color = 'red';
//   } else if (value < 0) {
//     color = 'green';
//   }
//   return 'https://img.shields.io/badge/' + name + '-' + getFormattedKB(getKB(value)) + 'KB-' + color + '.svg?style=flat-square';
// }

// //post size of build
// schedule(new Promise(function (res) {
//   getSize('./dist/cjs', function (e, result) {
//     var localGlobalFile = path.resolve('./dist/global', globalFile);
//     var localMinFile = path.resolve('./dist/global', minFile);

//     //get sizes of PR build
//     var global = fs.statSync(localGlobalFile);
//     var global_gzip = gzipSize.sync(fs.readFileSync(localGlobalFile, 'utf8'));
//     var min = fs.statSync(localMinFile);
//     var min_gzip = gzipSize.sync(fs.readFileSync(localMinFile, 'utf8'));

//     //resolve path to release build
//     var releasePath = path.dirname(require.resolve(require.resolve('rxjs')));
//     var bundlePath = path.resolve(releasePath, 'bundles');
//     var bundleGlobalFile = path.resolve(bundlePath, globalFile);
//     var bundleMinFile = path.resolve(bundlePath, minFile);

//     var packagePath = path.resolve(releasePath, 'package.json');
//     var releaseVersion = require(packagePath).version;

//     //get sizes of release build
//     var bundleGlobal = fs.statSync(bundleGlobalFile);
//     var bundle_global_gzip = gzipSize.sync(fs.readFileSync(bundleGlobalFile, 'utf8'));
//     var bundleMin = fs.statSync(bundleMinFile);
//     var bundle_min_gzip = gzipSize.sync(fs.readFileSync(bundleMinFile, 'utf8'));

//     var sizeMessage = '  ';
//     sizeMessage += ' ';
//     sizeMessage += ' ';
//     sizeMessage += ' ';
//     sizeMessage += ' ';
//     message(sizeMessage);

//     markdown('> CJS: **' + getKB(result) +
//       '**KB, global: **' + getKB(global.size) +
//       '**KB (gzipped: **' + getKB(global_gzip) +
//       '**KB), min: **' + getKB(min.size) +
//       '**KB (gzipped: **' + getKB(min_gzip) + '**KB)');

//     res();
//   });
// }));


text:
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2019-2020 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0

package com.google.appinventor.components.runtime;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import android.widget.RelativeLayout;
import com.github.mikephil.charting.charts.PieChart;
import com.github.mikephil.charting.components.LegendEntry;
import com.google.appinventor.components.common.ComponentConstants;
import org.junit.Before;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

/**
 * Test class for the Pie Chart View.
 * The test class also tests the integration with the Chart Component
 * with the given view.
 *
 * @see com.google.appinventor.components.runtime.AbstractChartTest
 */
public class PieChartTest extends AbstractChartTest<PieChartView, PieChart> {
  private RelativeLayout rootView;

  @Before
  public void setUp() {
    super.setUp();

    chartView = (PieChartView) chartComponent.getChartView();
    chartView.createChartModel(); // Creates root Pie Chart
    rootView = (RelativeLayout) chartView.getView();
    chart = (PieChart) rootView.getChildAt(0);
  }

  @Override
  public void testChartType() {
    assertEquals(getType(), chartComponent.Type());
    assertThat(chartView.getView(), instanceOf(RelativeLayout.class));
    assertThat(chart, instanceOf(PieChart.class));
    assertThat(chartView, instanceOf(PieChartView.class));
  }

  @Override
  public void testCreateChartModel() {
    // Get model and assert that it is of the appropriate type
    ChartDataModel model = chartView.createChartModel();
    assertThat(model, instanceOf(PieChartDataModel.class));

    // Assert that the new Pie Chart ring has been added to the root ivew
    assertEquals(2, rootView.getChildCount());

    // Get the newly added inner Chart
    PieChart innerChart = (PieChart) rootView.getChildAt(1);

    // Assert that the newly added Inner Chart's data instance is
    // equal to the model's Data instance
    assertEquals(innerChart.getData(), model.getData());

    // Assert that the root Chart's & Inner Chart's data instances
    // are not the same
    assertNotSame(chart.getData(), innerChart.getData());
  }

  /**
   * Test case to ensure that setting the Pie Radius
   * of the Chart while the type is of type Pie Chart
   * actually has effect on the radius.
   * <p>
   * Since the calculated values are non-direct, for
   * simplicity, this test case tests a non-full Pie Chart
   * fill and a full fill, the difference between them being
   * that the full fill disables hole drawing, and the partial
   * fill enables it.
   */
  @Test
  public void testChangePieRadius() {
    final int firstRadius = 50;
    final int newRadius = 100;

    // Set the Pie Radius to non-full and
    // assert that the hole is drawn
    chartComponent.PieRadius(firstRadius);
    assertTrue(chart.isDrawHoleEnabled());

    // Set the Pie Radius to 100 (full fill)
    // and assert that the hole is no longer drawn
    chartComponent.PieRadius(newRadius);
    assertFalse(chart.isDrawHoleEnabled());
  }

  /**
   * Test case to ensure that adding a single Legend Entry properly
   * adds it to the root Pie Chart's Legend.
   */
  @Test
  public void testAddSingleLegendEntry() {
    LegendEntry entry = new LegendEntry();
    entry.label = "Label";

    chartView.addLegendEntry(entry);

    List<LegendEntry> entries = chartView.getLegendEntries();

    assertEquals(1, entries.size());
    assertEquals(entry, entries.get(0));
  }

  /**
   * Test case to ensure that adding multiple LEgnd Entries properly
   * adds them to the root Pie Chart's Legend.
   */
  @Test
  public void testAddMultipleLegendEntries() {
    final int entries = 5;
    List<LegendEntry> expectedEntries = new ArrayList<LegendEntry>();

    for (int i = 0; i < entries; ++i) {
      LegendEntry entry = new LegendEntry();
      entry.label = "Entry " + i;

      // Add Entry to both expected
      expectedEntries.add(entry);
      chartView.addLegendEntry(entry);
    }

    // Get the LegendEntries array and assert that the count of entries
    // is the same as the expected count
    List<LegendEntry> legendEntries = chartView.getLegendEntries();
    assertEquals(entries, legendEntries.size());

    for (int i = 0; i < entries; ++i) {
      // Get the expected and actual LegendEntries, and
      // assert that they are equal
      LegendEntry expected = expectedEntries.get(i);
      LegendEntry actual = legendEntries.get(i);
      assertEquals(expected, actual);
    }
  }

  /**
   * Test case to ensure that removing a Legend Entry from the
   * Pie Chart View properly removes it form the root Pie Chart's
   * legend as well.
   */
  @Test
  public void testRemoveLegendEntry() {
    int entries = 4;
    List<LegendEntry> expectedEntries = new ArrayList<LegendEntry>();

    for (int i = 0; i < entries; ++i) {
      LegendEntry entry = new LegendEntry();
      entry.label = "Entry " + i;

      // Add entry to both the Chart View and the expected entries List
      expectedEntries.add(entry);
      chartView.addLegendEntry(entry);
    }

    // Remove the first entry from both the expected entries List
    // and the Chart View itself
    LegendEntry removeEntry = expectedEntries.remove(0);
    chartView.removeLegendEntry(removeEntry);

    // Get the LegendEntries of the chart, and assert that the
    // size with the expected entries is equivalent
    List<LegendEntry> legendEntries = chartView.getLegendEntries();
    assertEquals(expectedEntries.size(), legendEntries.size());

    for (int i = 0; i < expectedEntries.size(); ++i) {
      // Get both the expected and actual Legend Entries,
      // and assert that they are equal
      LegendEntry expected = expectedEntries.get(i);
      LegendEntry actual = legendEntries.get(i);
      assertEquals(expected, actual);
    }
  }

  /**
   * Test case to ensure that attempting to remove
   * a LegendEntry that does not exist in the Legend of
   * the root Pie Chart view does not remove any entries
   * at all.
   */
  @Test
  public void testRemoveLegendEntryNonExistent() {
    // Create a new Legend Entry and add it to the Legend
    LegendEntry entry = new LegendEntry();
    entry.label = "Entry";
    chartView.addLegendEntry(entry);

    // Create a different Legend Entry and attempt to remove it
    // from the Legend
    LegendEntry removeEntry = new LegendEntry();
    removeEntry.label = "Test";
    chartView.removeLegendEntry(removeEntry);

    // Get the entries of the Legend and assert that no entries
    // have been removed.
    List<LegendEntry> legendEntries = chartView.getLegendEntries();
    assertEquals(1, legendEntries.size());
    assertEquals(entry, legendEntries.get(0));
  }

  @Override
  public int getType() {
    return ComponentConstants.CHART_TYPE_PIE;
  }
}


text:
[![Build Status](https://travis-ci.org/MovingImage24/videomanager-sdk.svg?branch=master)](https://travis-ci.org/MovingImage24/videomanager-sdk)
[![Latest Stable Version](https://poser.pugx.org/mi/videomanager-sdk/v/stable)](https://packagist.org/packages/mi/videomanager-sdk)
[![Latest Unstable Version](https://poser.pugx.org/mi/videomanager-sdk/v/unstable)](https://packagist.org/packages/mi/videomanager-sdk)
[![Total Downloads](https://poser.pugx.org/mi/videomanager-sdk/downloads)](https://packagist.org/packages/mi/videomanager-sdk)
[![License](https://poser.pugx.org/mi/videomanager-sdk/license)](https://packagist.org/packages/mi/videomanager-sdk)
[![StyleCI](https://styleci.io/repos/37715011/shield)](https://styleci.io/repos/37715011)

## Overview

...

## Installation

...

## Usage

...

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

# License

This library is under the [MIT license](https://github.com/MovingImage24/videomanager-sdk/blob/master/LICENSE).


text:
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.json;

import com.google.common.io.CharStreams;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;

import java.io.IOException;
import java.io.Reader;
import java.io.UncheckedIOException;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;

public class Json {
  final static Gson GSON = new GsonBuilder()
      .registerTypeAdapterFactory(ListAdapter.FACTORY)
      .registerTypeAdapterFactory(MapAdapter.FACTORY)
      .setLenient()
      .serializeNulls()
      .disableHtmlEscaping()
      .create();

  public static final Type LIST_OF_MAPS_TYPE = new TypeToken<List<Map<String, Object>>>() {}.getType();
  public static final Type MAP_TYPE = new TypeToken<Map<String, Object>>() {}.getType();
  public static final Type OBJECT_TYPE = new TypeToken<Object>() {}.getType();

  private final JsonToBeanConverter toBean = new JsonToBeanConverter();
  private final BeanToJsonConverter toJson = new BeanToJsonConverter();

  public String toJson(Object toConvert) {
    return toJson.convert(toConvert);
  }

  /**
   * @deprecated No replacement. Use raw java types instead.
   */
  @Deprecated
  public JsonElement toJsonElement(Object toConvert) {
    return toJson.convertObject(toConvert);
  }

  public <T> T toType(Object source, Type typeOfT) {
    Class<?> type;
    if (typeOfT instanceof ParameterizedType) {
      type = (Class<?>) ((ParameterizedType) typeOfT).getRawType();
    } else if (typeOfT instanceof Class) {
      type = (Class<?>) typeOfT;
    } else {
      throw new IllegalArgumentException("Unable to convert type: " + typeOfT);
    }
    //noinspection unchecked
    return (T) toBean.convert(type, source);
  }

  private static Object readValue(JsonReader in, Gson gson) throws IOException {
    switch (in.peek()) {
      case BEGIN_ARRAY:
        return gson.fromJson(in, List.class);

      case BEGIN_OBJECT:
        return gson.fromJson(in, Map.class);

      case BOOLEAN:
      case NULL:
      case STRING:
        return gson.fromJson(in, Object.class);

      case NUMBER:
        String number = in.nextString();
        if (number.indexOf('.') != -1) {
          return Double.parseDouble(number);
        }
        return Long.parseLong(number);

      default:
        throw new JsonParseException("Unexpected type: " + in.peek());
    }
  }

  public JsonInput newInput(Reader from) throws UncheckedIOException {
    return new JsonInput(GSON, GSON.newJsonReader(from));
  }

  public JsonOutput newOutput(Appendable to) throws UncheckedIOException {
    try {
      return new JsonOutput(toJson, GSON.newJsonWriter(CharStreams.asWriter(to)));
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
  }

  private static class MapAdapter extends TypeAdapter<Map<?, ?>> {

    private final static TypeAdapterFactory FACTORY = new TypeAdapterFactory() {
      @SuppressWarnings("unchecked")
      @Override
      public <T> TypeAdapter<T> create(Gson gson, com.google.gson.reflect.TypeToken<T> type) {
        if (type.getRawType() == Map.class) {
          return (TypeAdapter<T>) new MapAdapter(gson);
        }
        return null;
      }
    };

    private final Gson gson;

    private MapAdapter(Gson gson) {
      this.gson = Objects.requireNonNull(gson);
    }

    @Override
    public Map<?, ?> read(JsonReader in) throws IOException {
      if (in.peek() == JsonToken.NULL) {
        in.nextNull();
        return null;
      }

      Map<String, Object> map = new TreeMap<>();
      in.beginObject();

      while (in.hasNext()) {
        String key = in.nextName();
        Object value = readValue(in, gson);

        map.put(key, value);
      }

      in.endObject();
      return map;
    }

    @Override
    public void write(JsonWriter out, Map<?, ?> value) throws IOException {
      // It's fine to use GSON's own default writer for this.
      out.beginObject();
      for (Map.Entry<?, ?> entry : value.entrySet()) {
        out.name(String.valueOf(entry.getKey()));
        @SuppressWarnings("unchecked")
        TypeAdapter<Object>
            adapter =
            (TypeAdapter<Object>) gson.getAdapter(entry.getValue().getClass());
        adapter.write(out, entry.getValue());
      }
      out.endObject();
    }
  }

  private static class ListAdapter extends TypeAdapter<List<?>> {

    private final static TypeAdapterFactory FACTORY = new TypeAdapterFactory() {
      @SuppressWarnings("unchecked")
      @Override
      public <T> TypeAdapter<T> create(Gson gson, com.google.gson.reflect.TypeToken<T> type) {
        if (type.getRawType() == List.class) {
          return (TypeAdapter<T>) new ListAdapter(gson);
        }
        return null;
      }
    };

    private final Gson gson;

    private ListAdapter(Gson gson) {
      this.gson = Objects.requireNonNull(gson);
    }

    @Override
    public List<?> read(JsonReader in) throws IOException {
      if (in.peek() == JsonToken.NULL) {
        in.nextNull();
        return null;
      }

      List<Object> list = new LinkedList<>();
      in.beginArray();

      while (in.hasNext()) {
        list.add(readValue(in, gson));
      }

      in.endArray();
      return list;
    }

    @Override
    public void write(JsonWriter out, List<?> value) throws IOException {
      out.beginArray();
      for (Object entry : value) {
        @SuppressWarnings("unchecked")
        TypeAdapter<Object> adapter = (TypeAdapter<Object>) gson.getAdapter(entry.getClass());
        adapter.write(out, entry);
      }
      out.endArray();
    }
  }
}


text:
<?php

include "FileSystem/IShellCommands.php";
include "FileSystem/Shell.php";

if (!isset($_SESSION))
	session_start();

# shell instance
$filesystem = new \Pleets\FileSystem\Shell();

if (isset($_SESSION["path"]))
	$path = $_SESSION["path"];
else
	$path = $filesystem->pwd();

$filesystem->cd($path);

$response = array();
$response["message"] = "";

$command = explode(" ", $_POST["command"]);
$command[1] = array_key_exists(1, $command) ? $command[1] : "";
$command[2] = array_key_exists(2, $command) ? $command[2] : "";

switch ($command[0])
{
	case 'pwd':
		$response["message"] = $filesystem->$command[0]();
		break;
	case 'ls':
		$response["message"] =  implode(" ", $filesystem->$command[0]($command[1]));
		break;
	case 'cd':
		if ($filesystem->$command[0]($command[1]) === false)
			$response["message"] = "unknown error!";
		break;
	case 'touch':
		$filesystem->$command[0]($command[1]);
		break;
	case 'rm':
		$filesystem->$command[0]($command[1]);
		break;
	case 'cp':
		$filesystem->$command[0]($command[1], $command[2]);
		break;
	case 'mv':
		$filesystem->$command[0]($command[1], $command[2]);
		break;
	case 'mkdir':
		$filesystem->$command[0]($command[1], $command[2]);
		break;
	case 'rmdir':
		$filesystem->$command[0]($command[1]);
		break;
	default:
		$response["message"] = "Command not found!";
		break;
}

$response["path"] = $_SESSION["path"] = $filesystem->pwd();

echo json_encode($response);

?>


text:
BOARD ?= quark_d2000_crb
CONF_FILE ?= prj.conf

include ${ZEPHYR_BASE}/Makefile.inc


text:
import os
import shutil
import stat
import tempfile
import threading
import time
import unittest
from collections import namedtuple

from pyspark import SparkConf, SparkFiles, SparkContext
from pyspark.testing.utils import ReusedPySparkTestCase, PySparkTestCase, QuietTest, SPARK_HOME

class CheckpointTests(ReusedPySparkTestCase):

    def setUp(self):
        self.checkpointDir = tempfile.NamedTemporaryFile(delete=False)
        os.unlink(self.checkpointDir.name)
        self.sc.setCheckpointDir(self.checkpointDir.name)

    def tearDown(self):
        shutil.rmtree(self.checkpointDir.name)

    def test_basic_checkpointing(self):
        parCollection = self.sc.parallelize([1, 2, 3, 4])
        flatMappedRDD = parCollection.flatMap(lambda x: range(1, x + 1))

        self.assertFalse(flatMappedRDD.isCheckpointed())
        self.assertTrue(flatMappedRDD.getCheckpointFile() is None)

        flatMappedRDD.checkpoint()
        result = flatMappedRDD.collect()
        time.sleep(1)  # 1 second
        self.assertTrue(flatMappedRDD.isCheckpointed())
        self.assertEqual(flatMappedRDD.collect(), result)
        self.assertEqual("file:" + self.checkpointDir.name,
                         os.path.dirname(os.path.dirname(flatMappedRDD.getCheckpointFile())))

    def test_checkpoint_and_restore(self):
        parCollection = self.sc.parallelize([1, 2, 3, 4])
        flatMappedRDD = parCollection.flatMap(lambda x: [x])

        self.assertFalse(flatMappedRDD.isCheckpointed())
        self.assertTrue(flatMappedRDD.getCheckpointFile() is None)

        flatMappedRDD.checkpoint()
        flatMappedRDD.count()  # forces a checkpoint to be computed
        time.sleep(1)  # 1 second

        self.assertTrue(flatMappedRDD.getCheckpointFile() is not None)
        recovered = self.sc._checkpointFile(flatMappedRDD.getCheckpointFile(),
                                            flatMappedRDD._jrdd_deserializer)
        self.assertEqual([1, 2, 3, 4], recovered.collect())

class LocalCheckpointTests(ReusedPySparkTestCase):

    def test_basic_localcheckpointing(self):
        parCollection = self.sc.parallelize([1, 2, 3, 4])
        flatMappedRDD = parCollection.flatMap(lambda x: range(1, x + 1))

        self.assertFalse(flatMappedRDD.isCheckpointed())
        self.assertFalse(flatMappedRDD.isLocallyCheckpointed())

        flatMappedRDD.localCheckpoint()
        result = flatMappedRDD.collect()
        time.sleep(1)  # 1 second
        self.assertTrue(flatMappedRDD.isCheckpointed())
        self.assertTrue(flatMappedRDD.isLocallyCheckpointed())
        self.assertEqual(flatMappedRDD.collect(), result)

class AddFileTests(PySparkTestCase):

    def test_add_py_file(self):
        # To ensure that we're actually testing addPyFile's effects, check that
        # this job fails due to `userlibrary` not being on the Python path:
        # disable logging in log4j temporarily
        def func(x):
            from userlibrary import UserClass
            return UserClass().hello()
        with QuietTest(self.sc):
            self.assertRaises(Exception, self.sc.parallelize(range(2)).map(func).first)

        # Add the file, so the job should now succeed:
        path = os.path.join(SPARK_HOME, "python/test_support/userlibrary.py")
        self.sc.addPyFile(path)
        res = self.sc.parallelize(range(2)).map(func).first()
        self.assertEqual("Hello World!", res)

    def test_add_file_locally(self):
        path = os.path.join(SPARK_HOME, "python/test_support/hello/hello.txt")
        self.sc.addFile(path)
        download_path = SparkFiles.get("hello.txt")
        self.assertNotEqual(path, download_path)
        with open(download_path) as test_file:
            self.assertEqual("Hello World!\n", test_file.readline())

    def test_add_file_recursively_locally(self):
        path = os.path.join(SPARK_HOME, "python/test_support/hello")
        self.sc.addFile(path, True)
        download_path = SparkFiles.get("hello")
        self.assertNotEqual(path, download_path)
        with open(download_path + "/hello.txt") as test_file:
            self.assertEqual("Hello World!\n", test_file.readline())
        with open(download_path + "/sub_hello/sub_hello.txt") as test_file:
            self.assertEqual("Sub Hello World!\n", test_file.readline())

    def test_add_py_file_locally(self):
        # To ensure that we're actually testing addPyFile's effects, check that
        # this fails due to `userlibrary` not being on the Python path:
        def func():
            from userlibrary import UserClass
        self.assertRaises(ImportError, func)
        path = os.path.join(SPARK_HOME, "python/test_support/userlibrary.py")
        self.sc.addPyFile(path)
        from userlibrary import UserClass
        self.assertEqual("Hello World!", UserClass().hello())

    def test_add_egg_file_locally(self):
        # To ensure that we're actually testing addPyFile's effects, check that
        # this fails due to `userlibrary` not being on the Python path:
        def func():
            from userlib import UserClass
        self.assertRaises(ImportError, func)
        path = os.path.join(SPARK_HOME, "python/test_support/userlib-0.1.zip")
        self.sc.addPyFile(path)
        from userlib import UserClass
        self.assertEqual("Hello World from inside a package!", UserClass().hello())

    def test_overwrite_system_module(self):
        self.sc.addPyFile(os.path.join(SPARK_HOME, "python/test_support/SimpleHTTPServer.py"))

        import SimpleHTTPServer
        self.assertEqual("My Server", SimpleHTTPServer.__name__)

        def func(x):
            import SimpleHTTPServer
            return SimpleHTTPServer.__name__

        self.assertEqual(["My Server"], self.sc.parallelize(range(1)).map(func).collect())

class ContextTests(unittest.TestCase):

    def test_failed_sparkcontext_creation(self):
        # Regression test for SPARK-1550
        self.assertRaises(Exception, lambda: SparkContext("an-invalid-master-name"))

    def test_get_or_create(self):
        with SparkContext.getOrCreate() as sc:
            self.assertTrue(SparkContext.getOrCreate() is sc)

    def test_parallelize_eager_cleanup(self):
        with SparkContext() as sc:
            temp_files = os.listdir(sc._temp_dir)
            rdd = sc.parallelize([0, 1, 2])
            post_parallalize_temp_files = os.listdir(sc._temp_dir)
            self.assertEqual(temp_files, post_parallalize_temp_files)

    def test_set_conf(self):
        # This is for an internal use case. When there is an existing SparkContext,
        # SparkSession's builder needs to set configs into SparkContext's conf.
        sc = SparkContext()
        sc._conf.set("spark.test.SPARK16224", "SPARK16224")
        self.assertEqual(sc._jsc.sc().conf().get("spark.test.SPARK16224"), "SPARK16224")
        sc.stop()

    def test_stop(self):
        sc = SparkContext()
        self.assertNotEqual(SparkContext._active_spark_context, None)
        sc.stop()
        self.assertEqual(SparkContext._active_spark_context, None)

    def test_with(self):
        with SparkContext() as sc:
            self.assertNotEqual(SparkContext._active_spark_context, None)
        self.assertEqual(SparkContext._active_spark_context, None)

    def test_with_exception(self):
        try:
            with SparkContext() as sc:
                self.assertNotEqual(SparkContext._active_spark_context, None)
                raise Exception()
        except:
            pass
        self.assertEqual(SparkContext._active_spark_context, None)

    def test_with_stop(self):
        with SparkContext() as sc:
            self.assertNotEqual(SparkContext._active_spark_context, None)
            sc.stop()
        self.assertEqual(SparkContext._active_spark_context, None)

    def test_progress_api(self):
        with SparkContext() as sc:
            sc.setJobGroup('test_progress_api', '', True)
            rdd = sc.parallelize(range(10)).map(lambda x: time.sleep(100))

            def run():
                # When thread is pinned, job group should be set for each thread for now.
                # Local properties seem not being inherited like Scala side does.
                if os.environ.get("PYSPARK_PIN_THREAD", "false").lower() == "true":
                    sc.setJobGroup('test_progress_api', '', True)
                try:
                    rdd.count()
                except Exception:
                    pass
            t = threading.Thread(target=run)
            t.daemon = True
            t.start()
            # wait for scheduler to start
            time.sleep(1)

            tracker = sc.statusTracker()
            jobIds = tracker.getJobIdsForGroup('test_progress_api')
            self.assertEqual(1, len(jobIds))
            job = tracker.getJobInfo(jobIds[0])
            self.assertEqual(1, len(job.stageIds))
            stage = tracker.getStageInfo(job.stageIds[0])
            self.assertEqual(rdd.getNumPartitions(), stage.numTasks)

            sc.cancelAllJobs()
            t.join()
            # wait for event listener to update the status
            time.sleep(1)

            job = tracker.getJobInfo(jobIds[0])
            self.assertEqual('FAILED', job.status)
            self.assertEqual([], tracker.getActiveJobsIds())
            self.assertEqual([], tracker.getActiveStageIds())

            sc.stop()

    def test_startTime(self):
        with SparkContext() as sc:
            self.assertGreater(sc.startTime, 0)

    def test_forbid_insecure_gateway(self):
        # Fail immediately if you try to create a SparkContext
        # with an insecure gateway
        parameters = namedtuple('MockGatewayParameters', 'auth_token')(None)
        mock_insecure_gateway = namedtuple('MockJavaGateway', 'gateway_parameters')(parameters)
        with self.assertRaises(ValueError) as context:
            SparkContext(gateway=mock_insecure_gateway)
        self.assertIn("insecure Py4j gateway", str(context.exception))

    def test_resources(self):
        """Test the resources are empty by default."""
        with SparkContext() as sc:
            resources = sc.resources
            self.assertEqual(len(resources), 0)

class ContextTestsWithResources(unittest.TestCase):

    def setUp(self):
        class_name = self.__class__.__name__
        self.tempFile = tempfile.NamedTemporaryFile(delete=False)
        self.tempFile.write(b'echo {\\"name\\": \\"gpu\\", \\"addresses\\": [\\"0\\"]}')
        self.tempFile.close()
        # create temporary directory for Worker resources coordination
        self.tempdir = tempfile.NamedTemporaryFile(delete=False)
        os.unlink(self.tempdir.name)
        os.chmod(self.tempFile.name, stat.S_IRWXU | stat.S_IXGRP | stat.S_IRGRP |
                 stat.S_IROTH | stat.S_IXOTH)
        conf = SparkConf().set("spark.test.home", SPARK_HOME)
        conf = conf.set("spark.resources.dir", self.tempdir.name)
        conf = conf.set("spark.driver.resource.gpu.amount", "1")
        conf = conf.set("spark.driver.resource.gpu.discoveryScript", self.tempFile.name)
        self.sc = SparkContext('local-cluster[2,1,1024]', class_name, conf=conf)

    def test_resources(self):
        """Test the resources are available."""
        resources = self.sc.resources
        self.assertEqual(len(resources), 1)
        self.assertTrue('gpu' in resources)
        self.assertEqual(resources['gpu'].name, 'gpu')
        self.assertEqual(resources['gpu'].addresses, ['0'])

    def tearDown(self):
        os.unlink(self.tempFile.name)
        shutil.rmtree(self.tempdir.name)
        self.sc.stop()

if __name__ == "__main__":
    from pyspark.tests.test_context import *

    try:
        import xmlrunner
        testRunner = xmlrunner.XMLTestRunner(output='target/test-reports', verbosity=2)
    except ImportError:
        testRunner = None
    unittest.main(testRunner=testRunner, verbosity=2)


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit7a1f309072c4bdf0be1587c1f65a96b1::getLoader();


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('cookie_app', '0017_ox'),
    ]

    operations = [
        migrations.DeleteModel(
            name='Ox',
        ),
        migrations.AlterModelOptions(
            name='more_data_page',
            options={'verbose_name_plural': 'oxen'},
        ),
    ]


text:
package com.ibm.wala.viz.viewer;

import java.awt.BorderLayout;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;

import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;

public class SourceViewer extends JPanel{
  private URL sourceURL;
  private JTextField sourceCodeLocation;
  private DefaultListModel sourceCodeLinesList = new DefaultListModel();
  private JList sourceCodeLines;

  public SourceViewer() {
    super(new BorderLayout());
    sourceURL = null;
    sourceCodeLines = new JList(sourceCodeLinesList);
    sourceCodeLocation = new JTextField("Source code");
    this.add(sourceCodeLocation, BorderLayout.PAGE_START);
    this.add(new JScrollPane(sourceCodeLines), BorderLayout.CENTER);
  }

  public void setSource(URL url) {
    setSource(url, IrViewer.NA);
  }

  public void setSource(URL url, int sourceLine) {
    boolean succsess = loadSource(url);
    if (succsess){
      sourceCodeLocation.setText("Source code: " + url);
      if (sourceLine != IrViewer.NA){
        sourceCodeLines.ensureIndexIsVisible(sourceLine-1);
        sourceCodeLines.setSelectedIndex(sourceLine-1);
        sourceCodeLines.validate();
      }
    } else {
      sourceCodeLocation.setText("Error loading source code from: " + url);
    }
  }

  private boolean loadSource(URL url) {
    if (url == null) {
      if (sourceURL != null) {
        // easing the current code.
        sourceCodeLinesList.clear();
      }
      return false; // nothing to load
    } else {
      if (url.equals(sourceURL)) {
        return true; // already loaded
      } else {
        sourceCodeLinesList.clear();
        try {
          BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
          String line;
          while ((line = br.readLine()) != null) {
            sourceCodeLinesList.addElement(line.replaceAll("\t", "   "));
          }
          br.close();
          return true;
        } catch (IOException e) {
          System.err.println("Could not load source at " + url);
          return false;
        }
      }
    }
  }

  public void removeSelection() {
    int curSelectedIndex = sourceCodeLines.getSelectedIndex();
    sourceCodeLines.removeSelectionInterval(curSelectedIndex, curSelectedIndex);
  }

  public void removeSource() {
    sourceURL = null;
    sourceCodeLocation.setText("Source code");
    sourceCodeLinesList.clear();
    sourceCodeLines.validate();
  }

}


text:
            Home

                Ventas

                   <?php
                    $deputy = $_SESSION['deputy'];
                    $estado= ($deputy->allowed('Venta/'));
                    if($estado){
                   ?>

Ventas realizadas

                    <?php
                    }
                   ?>
                   <?php
                    $deputy = $_SESSION['deputy'];
                    $estado= ($deputy->allowed('Venta/create'));
                    if($estado){
                   ?>

Ingreso venta

                  <?php
                  }
                 ?>

                <?php
                    $deputy = $_SESSION['deputy'];
                    $estado= ($deputy->allowed('Usuario/'));
                    if($estado){
                ?>

                Productos

Listar Producto

                   <?php
                    $deputy = $_SESSION['deputy'];
                    $estado= ($deputy->allowed('Producto/create'));
                    if($estado){
                   ?>

Agregar Producto

                    <?php
                    }
                   ?>

                <?php
                    }
                   ?>
              <?php
                    $deputy = $_SESSION['deputy'];
                    $estado= ($deputy->allowed('Usuario/'));
                    if($estado){
                ?>

                Usuarios

Listar Usuarios

                   <?php
                    $deputy = $_SESSION['deputy'];
                    $estado= ($deputy->allowed('Usuario/create'));
                    if($estado){
                   ?>

Agregar Usuario

                    <?php
                    }
                   ?>

               <?php
                    }
                   ?>
                <?php
                    $deputy = $_SESSION['deputy'];
                    $estado= ($deputy->allowed('Categoria/'));
                    if($estado){
                ?>

                Categorias

Listar Categorias

                    <?php
                    $deputy = $_SESSION['deputy'];
                    $estado= ($deputy->allowed('Categoria/create'));
                    if($estado){
                   ?>

Agregar categoria

                    <?php
                    }
                   ?>

               <?php
                    }
                   ?>
                <?php
                    $deputy = $_SESSION['deputy'];
                    $estado= ($deputy->allowed('Categoria/'));
                    if($estado){
                ?>

                Consultas

Producto Más Vendido

Mejor Vendedor

              <?php
                    }
                   ?>

Salir


text:
<?php

namespace Org\Schema\Thing\Place\Landform\BodyOfWater;

/**
 * Class Waterfall
 * A waterfall, like Niagara.
 * @author      AppBels <app.bels@gmail.com>
 * @name        Waterfall
 * @namespace   Org\Schema\Thing\Place\Landform\BodyOfWater
 * @package     Org\Schema
 * @see         https://schema.org/Waterfall
 * Date         10/04/2017
 */
class Waterfall extends \Org\Schema\Thing\Place\Landform\BodyOfWater
{

	/**
	 * Waterfall constructor.
	 * @access  public
	 * @see     \Org\Schema\Thing\Place\Landform\BodyOfWater::__construct()
	 */
	public function __construct ()
	{
		parent::__construct();
	}

	/**
	 * Waterfall toString.
	 * @access  public
	 * @see     \Org\Schema\Thing\Place\Landform\BodyOfWater::__toString()
	 *
	 * @return  string
	 */
	public function __toString ()
	{
		return parent::__toString();
	}

	/**
	 * Waterfall destructor.
	 * @access  public
	 * @see     \Org\Schema\Thing\Place\Landform\BodyOfWater::__destruct()
	 */
	public function __destruct ()
	{
		parent::__destruct();
	}

}

?>


text:
package com.boardhood.mobile.loader;

import com.boardhood.api.BoardHood;
import com.boardhood.api.model.Conversation;
import com.boardhood.mobile.utils.TaskLoader;

public class ConversationTask extends RestTask<Conversation, Void, Conversation> {
	public ConversationTask(BoardHood client, TaskLoader.TaskListener<Conversation> listener) {
		super(client, listener);
	}

	public ConversationTask(BoardHood client, TaskLoader.TaskListener<Conversation> listener, int type) {
		super(client, listener, type);
	}

	public ConversationTask(BoardHood client) {
		super(client);
	}

	@Override
	public Conversation run(Conversation... params) throws Exception {
		return client.findConversation(
				params[0].getInterest().getId(),
				params[0].getId());
	}

}


text:
/* */
'use strict';
Object.defineProperty(exports, "__esModule", {value: true});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin');
var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixin);
var _svgIcon = require('../../svg-icon');
var _svgIcon2 = _interopRequireDefault(_svgIcon);
function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : {default: obj};
}
var MapsLocalLibrary = _react2.default.createClass({
  displayName: 'MapsLocalLibrary',
  mixins: [_reactAddonsPureRenderMixin2.default],
  render: function render() {
    return _react2.default.createElement(_svgIcon2.default, this.props, _react2.default.createElement('path', {d: 'M12 11.55C9.64 9.35 6.48 8 3 8v11c3.48 0 6.64 1.35 9 3.55 2.36-2.19 5.52-3.55 9-3.55V8c-3.48 0-6.64 1.35-9 3.55zM12 8c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3z'}));
  }
});
exports.default = MapsLocalLibrary;
module.exports = exports['default'];


text:
#ifndef NET_GRPC_PHP_GRPC_CALL_CREDENTIALS_H_
#define NET_GRPC_PHP_GRPC_CALL_CREDENTIALS_H_

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_grpc.h"

#include "grpc/grpc.h"
#include "grpc/grpc_security.h"

/* Class entry for the CallCredentials PHP class */
extern zend_class_entry *grpc_ce_call_credentials;

/* Wrapper struct for grpc_call_credentials that can be associated
 * with a PHP object */
PHP_GRPC_WRAP_OBJECT_START(wrapped_grpc_call_credentials)
  grpc_call_credentials *wrapped;
PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_call_credentials)

#if PHP_MAJOR_VERSION < 7

#define Z_WRAPPED_GRPC_CALL_CREDS_P(zv) \
  (wrapped_grpc_call_credentials *)zend_object_store_get_object(zv TSRMLS_CC)

#else

static inline wrapped_grpc_call_credentials
*wrapped_grpc_call_creds_from_obj(zend_object *obj) {
  return
    (wrapped_grpc_call_credentials*)((char*)(obj) -
                                     XtOffsetOf(wrapped_grpc_call_credentials,
                                                std));
}

#define Z_WRAPPED_GRPC_CALL_CREDS_P(zv) \
  wrapped_grpc_call_creds_from_obj(Z_OBJ_P((zv)))

#endif /* PHP_MAJOR_VERSION */

/* Struct to hold callback function for plugin creds API */
typedef struct plugin_state {
  zend_fcall_info *fci;
  zend_fcall_info_cache *fci_cache;
} plugin_state;

/* Callback function for plugin creds API */
void plugin_get_metadata(void *state, grpc_auth_metadata_context context,
                         grpc_credentials_plugin_metadata_cb cb,
                         void *user_data);

/* Cleanup function for plugin creds API */
void plugin_destroy_state(void *ptr);

/* Initializes the CallCredentials PHP class */
void grpc_init_call_credentials(TSRMLS_D);

#endif /* NET_GRPC_PHP_GRPC_CALL_CREDENTIALS_H_ */


text:
/*global angular*/
(function () {
    'use strict';

    //Slideshows service used to communicate Slideshows REST endpoints
    angular.module('core').factory('Slideshows', ['$resource',
        function ($resource) {
            return $resource('slideshows/:slideshowId', {
                slideshowId: '@_id'
            }, {
                update: {
                    method: 'PUT'
                },
                getDevices: {
                    method: 'GET',
                    url: 'slideshowDevices/:slideshowId',
                    isArray: true,
                    params: {name: '@name'}
                },
                setDevices: {
                    method: 'PUT',
                    url: 'slideshowDevices/:slideshowId'
                },
                getFilteredNamesAndTags:  {
                    method: 'GET',
                    url: '/slideshows/filteredNamesAndTags'
                },
                filter:  {
                    method: 'GET',
                    url: '/slideshows/filter',
                    isArray: true
                },
                filterByName: {
                    method: 'GET',
                    url: '/slideshows/filterByName',
                    isArray: true
                }
            });
        }]);
}());