text:
package io.github.factoryfx.soap;

import java.util.function.Function;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.eclipse.jetty.server.Server;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import io.github.factoryfx.factory.builder.FactoryTreeBuilder;
import io.github.factoryfx.factory.builder.Scope;
import io.github.factoryfx.factory.storage.DataUpdate;
import io.github.factoryfx.jetty.builder.FactoryTemplateName;
import io.github.factoryfx.jetty.builder.SimpleJettyServerBuilder;
import io.github.factoryfx.server.Microservice;
import io.github.factoryfx.soap.example.HelloWorld;
import io.github.factoryfx.soap.example.SoapDummyRequest;
import io.github.factoryfx.soap.example.SoapDummyRequest2;
import io.github.factoryfx.soap.example.SoapDummyRequestException1;
import io.github.factoryfx.soap.example.SoapDummyRequestException2;
import io.github.factoryfx.soap.example.SoapDummyRequestNested;
import io.github.factoryfx.soap.example.SoapDummyResponse;
import io.github.factoryfx.soap.examplenoroot.HelloWorldNoXmlRootElement;
import io.github.factoryfx.soap.examplenoroot.ObjectFactory;
import io.github.factoryfx.soap.examplenoroot.SoapDummyRequestNoRoot;
import io.github.factoryfx.soap.examplenoroot.SoapDummyRequestNoRoot2;
import io.github.factoryfx.soap.examplenoroot.SoapDummyResponseNoRoot;
import io.github.factoryfx.soap.examplenoroot.SoapDummyResponseNoRoot2;
import io.github.factoryfx.soap.server.SoapJettyServerFactory;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import jakarta.xml.soap.MessageFactory;
import jakarta.xml.soap.MimeHeaders;
import jakarta.xml.soap.SOAPBody;
import jakarta.xml.soap.SOAPConnection;
import jakarta.xml.soap.SOAPConnectionFactory;
import jakarta.xml.soap.SOAPConstants;
import jakarta.xml.soap.SOAPEnvelope;
import jakarta.xml.soap.SOAPException;
import jakarta.xml.soap.SOAPMessage;
import jakarta.xml.soap.SOAPPart;
import jakarta.xml.ws.WebServiceContext;
import jakarta.xml.ws.handler.MessageContext;

public class SoapTest {

    @Test
    public void test() throws Exception {

        FactoryTreeBuilder<Server, SoapJettyServerFactory> builder = new FactoryTreeBuilder<>(SoapJettyServerFactory.class);
//        builder.addFactory(JettyServerFactory.class, Scope.SINGLETON, ctx-> new JettyServerBuilder<>()
//                .withHost("localhost").withPort(8088).removeDefaultJerseyServlet()
//                .withServlet("/*",ctx.get(SoapHandlerFactory.class)).build());

        builder.addBuilder(ctx -> {
            SimpleJettyServerBuilder<SoapJettyServerFactory> jettyServerBuilder = new SimpleJettyServerBuilder<>();
            jettyServerBuilder.withHost("localhost").withPort(8088).withServlet(ctx.getUnsafe(SoapHandlerFactory.class), "/*", new FactoryTemplateName("soap"));
            return jettyServerBuilder;
        });

        builder.addFactoryUnsafe(SoapHandlerFactory.class, Scope.SINGLETON, ctx -> {
            SoapHandlerFactory<HelloWorld, SoapJettyServerFactory> soapHandlerFactory = new SoapHandlerFactory<>();

            soapHandlerFactory.serviceBean.set(ctx.get(HelloWorldFactory.class));
            return soapHandlerFactory;
        });
        builder.addSingleton(HelloWorldFactory.class, ctx -> {
            HelloWorldFactory helloWorldFactory = new HelloWorldFactory();
            HelloWorld goodCase = new HelloWorld() {

                @Resource
                private WebServiceContext webServiceContext;

                @Override
                public SoapDummyResponse subIMMEDIATETEMPLATECHANGE(SoapDummyRequest parameters) throws SoapDummyRequestException1, SoapDummyRequestException2 {
                    return new SoapDummyResponse();
                }

                @Override
                public SoapDummyResponse methodWithRequestResponse(SoapDummyRequest2 parameters, HttpServletRequest request, HttpServletResponse resp) {
                    Assertions.assertNotNull(request);
                    Assertions.assertNotNull(resp);
                    Assertions.assertSame(request, webServiceContext.getMessageContext().get(MessageContext.SERVLET_REQUEST));
                    Assertions.assertSame(resp, webServiceContext.getMessageContext().get(MessageContext.SERVLET_RESPONSE));
                    return new SoapDummyResponse();
                }
            };
            helloWorldFactory.service.set(goodCase);
            return helloWorldFactory;
        });

        Microservice<Server, SoapJettyServerFactory> microService = builder.microservice().build();
        microService.start();

        try {
            callSoapWebService("http://localhost:8088", createSOAPRequest("action"));
            callSoapWebService("http://localhost:8088", createSOAPRequest2());
            DataUpdate<SoapJettyServerFactory> newFactory = microService.prepareNewFactory();
            HelloWorldFactory helloWorldFactory = new HelloWorldFactory();
            HelloWorld badCase = new HelloWorld() {

                @Override
                public SoapDummyResponse subIMMEDIATETEMPLATECHANGE(SoapDummyRequest parameters) throws SoapDummyRequestException1, SoapDummyRequestException2 {
                    throw new SoapDummyRequestException1();
                }

                @Override
                public SoapDummyResponse methodWithRequestResponse(SoapDummyRequest2 parameters, HttpServletRequest request, HttpServletResponse resp) {
                    return new SoapDummyResponse();
                }
            };

            helloWorldFactory.service.set(badCase);
            SoapHandlerFactory<HelloWorld, SoapJettyServerFactory> servletUnsafe = newFactory.root.server.get().getServletUnsafe(SoapHandlerFactory.class);
            servletUnsafe.serviceBean.set(helloWorldFactory);
            microService.updateCurrentFactory(newFactory);
            callSoapWebService("http://localhost:8088", createSOAPRequest("action"));

        } finally {
            microService.stop();
        }

    }

    @Test
    public void testNoXmlRoot() throws Exception {

        FactoryTreeBuilder<Server, SoapJettyServerFactory> builder = new FactoryTreeBuilder<>(SoapJettyServerFactory.class);
//        builder.addFactory(JettyServerFactory.class, Scope.SINGLETON, ctx-> new JettyServerBuilder<>()
//                .withHost("localhost").withPort(8088).removeDefaultJerseyServlet()
//                .withServlet("/*",ctx.get(SoapHandlerFactory.class)).build());

        builder.addBuilder(ctx -> {
            SimpleJettyServerBuilder<SoapJettyServerFactory> jettyServerBuilder = new SimpleJettyServerBuilder<>();
            jettyServerBuilder.withHost("localhost").withPort(8088)
                    .withServlet(ctx.getUnsafe(SoapHandlerFactory.class), "/*", new FactoryTemplateName("soap"));
            return jettyServerBuilder;
        });

        builder.addFactoryUnsafe(SoapHandlerFactory.class, Scope.SINGLETON, ctx -> {
            SoapHandlerFactory<HelloWorldNoXmlRootElement, SoapJettyServerFactory> soapHandlerFactory = new SoapHandlerFactory<>();
            soapHandlerFactory.serviceBean.set(ctx.get(HelloWorldNoXmlRootElementFactory.class));
            return soapHandlerFactory;
        });

        builder.addSingleton(HelloWorldNoXmlRootElementFactory.class, ctx -> {
            HelloWorldNoXmlRootElementFactory helloWorldFactory = new HelloWorldNoXmlRootElementFactory();
            HelloWorldNoXmlRootElement goodCase = new HelloWorldNoXmlRootElement() {

                @Resource
                private WebServiceContext webServiceContext;

                @Override
                public SoapDummyResponseNoRoot subDummyRequest(SoapDummyRequestNoRoot parameters) throws SoapDummyRequestException1, SoapDummyRequestException2 {
                    return new SoapDummyResponseNoRoot();
                }

                @Override
                public SoapDummyResponseNoRoot2 methodWithRequestResponse(SoapDummyRequestNoRoot2 parameters, HttpServletRequest request, HttpServletResponse resp) {
                    Assertions.assertNotNull(request);
                    Assertions.assertNotNull(resp);
                    Assertions.assertSame(request, webServiceContext.getMessageContext().get(MessageContext.SERVLET_REQUEST));
                    Assertions.assertSame(resp, webServiceContext.getMessageContext().get(MessageContext.SERVLET_RESPONSE));
                    return new SoapDummyResponseNoRoot2();

                }

            };
            helloWorldFactory.service.set(goodCase);
            return helloWorldFactory;
        });

        Microservice<Server, SoapJettyServerFactory> microService = builder.microservice().build();
        microService.start();

        try {
            callSoapWebService("http://localhost:8088", createSOAPRequestNoXmlRootElement(SOAPConstants.SOAP_1_1_PROTOCOL, null));
            callSoapWebService("http://localhost:8088", createSOAPRequestNoXmlRootElement(SOAPConstants.SOAP_1_2_PROTOCOL, "action"));

            DataUpdate<SoapJettyServerFactory> newFactory = microService.prepareNewFactory();
            HelloWorldNoXmlRootElementFactory helloWorldFactory = new HelloWorldNoXmlRootElementFactory();
            HelloWorldNoXmlRootElement badCase = new HelloWorldNoXmlRootElement() {

                @Override
                public SoapDummyResponseNoRoot subDummyRequest(SoapDummyRequestNoRoot parameters) throws SoapDummyRequestException1, SoapDummyRequestException2 {
                    throw new SoapDummyRequestException1();
                }

                @Override
                public SoapDummyResponseNoRoot2 methodWithRequestResponse(SoapDummyRequestNoRoot2 parameters, HttpServletRequest request, HttpServletResponse resp) {
                    return new SoapDummyResponseNoRoot2();
                }
            };

            helloWorldFactory.service.set(badCase);
            SoapHandlerFactory<HelloWorldNoXmlRootElement, SoapJettyServerFactory> servletUnsafe = newFactory.root.server.get().getServletUnsafe(SoapHandlerFactory.class);
            servletUnsafe.serviceBean.set(helloWorldFactory);
            microService.updateCurrentFactory(newFactory);
            callSoapWebService("http://localhost:8088", createSOAPRequestNoXmlRootElement(SOAPConstants.SOAP_1_1_PROTOCOL, null));
            callSoapWebService("http://localhost:8088", createSOAPRequestNoXmlRootElement(SOAPConstants.SOAP_1_2_PROTOCOL, "action"));

        } finally {
            microService.stop();
        }

    }

    // SAAJ - SOAP Client Testing
    public static void main(String args[]) throws Exception {
        /*
            The example below requests from the Web Service at:
             http://www.webservicex.net/uszip.asmx?op=GetInfoByCity

            To call other WS, change the parameters below, which are:
             - the SOAP Endpoint URL (that is, where the service is responding from)
             - the SOAP Action

            Also change the contents of the method createSoapEnvelope() in this class. It constructs
             the inner part of the SOAP envelope that is actually sent.
         */
        String soapEndpointUrl = "http://www.webservicex.net/uszip.asmx";
        String soapAction = "http://www.webserviceX.NET/GetInfoByCity";

        callSoapWebService(soapEndpointUrl, createSOAPRequest(soapAction));
    }

    private static void callSoapWebService(String soapEndpointUrl, SOAPMessage soapMessage) {
        try {
            // Create SOAP Connection
            SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
            SOAPConnection soapConnection = soapConnectionFactory.createConnection();

            // Send SOAP Message to SOAP Server
            SOAPMessage soapResponse = soapConnection.call(soapMessage, soapEndpointUrl);

            // Print the SOAP Response
            System.out.println("Response SOAP Message:");
            soapResponse.writeTo(System.out);

            soapConnection.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    private static void createSoapEnvelope(Object req, SOAPMessage soapMessage) throws SOAPException {
        createSoapEnvelope(req, soapMessage, Function.identity());
    }

    private static void createSoapEnvelope(Object req, SOAPMessage soapMessage, Function<Object, Object> jaxbElementWrapper) throws SOAPException {
        SOAPPart soapPart = soapMessage.getSOAPPart();

        String myNamespace = "myNamespace";
        String myNamespaceURI = "http://www.webserviceX.NET";

        // SOAP Envelope
        SOAPEnvelope envelope = soapPart.getEnvelope();
        envelope.addNamespaceDeclaration(myNamespace, myNamespaceURI);

            /*
            Constructed SOAP Request Message:
            <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:myNamespace="http://www.webserviceX.NET">
                <SOAP-ENV:Header/>
                <SOAP-ENV:Body>
                    <myNamespace:GetInfoByCity>
                        <myNamespace:USCity>New York</myNamespace:USCity>
                    </myNamespace:GetInfoByCity>
                </SOAP-ENV:Body>
            </SOAP-ENV:Envelope>
            */

        // SOAP Body
        SOAPBody soapBody = envelope.getBody();
        Marshaller marshaller = null;
        DocumentBuilder db = null;
        try {
            marshaller = JAXBContext.newInstance(req.getClass()).createMarshaller();
            db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            org.w3c.dom.Document document = db.newDocument();
            marshaller.marshal(jaxbElementWrapper.apply(req), document);
            org.w3c.dom.Node importedNode = soapBody.getOwnerDocument().importNode(document.getChildNodes().item(0), true);
            soapBody.appendChild(importedNode);
        } catch (JAXBException | ParserConfigurationException e) {
            throw new RuntimeException(e);
        }

    }

    private static SOAPMessage createSOAPRequest(String soapAction) throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        SOAPMessage soapMessage = messageFactory.createMessage();

        SoapDummyRequest req = new SoapDummyRequest();
        req.dummy = "BLA";
        req.soapDummyRequestNested = new SoapDummyRequestNested();
        req.soapDummyRequestNested.dummy = "BLUB";

        createSoapEnvelope(req, soapMessage);

        MimeHeaders headers = soapMessage.getMimeHeaders();
        headers.addHeader("SOAPAction", soapAction);

        soapMessage.saveChanges();

        /* Print the request message, just for debugging purposes */
        System.out.println("Request SOAP Message:");
        soapMessage.writeTo(System.out);
        System.out.println("\n");

        return soapMessage;
    }

    private static SOAPMessage createSOAPRequest2() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        SOAPMessage soapMessage = messageFactory.createMessage();

        createSoapEnvelope(new SoapDummyRequest2(), soapMessage);

        MimeHeaders headers = soapMessage.getMimeHeaders();

        soapMessage.saveChanges();

        /* Print the request message, just for debugging purposes */
        System.out.println("Request SOAP Message:");
        soapMessage.writeTo(System.out);
        System.out.println("\n");

        return soapMessage;
    }

    private static SOAPMessage createSOAPRequestNoXmlRootElement(String protocolVersion, String soapAction) throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(protocolVersion);
        SOAPMessage soapMessage = messageFactory.createMessage();

        SoapDummyRequestNoRoot req = new SoapDummyRequestNoRoot();
        req.dummy = "BLA";
        req.soapDummyRequestNested = new SoapDummyRequestNested();
        req.soapDummyRequestNested.dummy = "BLUB";

        createSoapEnvelope(req, soapMessage, r -> new ObjectFactory().createSoapDummeRequestNoRoot((SoapDummyRequestNoRoot) r));

        if (protocolVersion == SOAPConstants.SOAP_1_2_PROTOCOL && soapAction != null) {
            MimeHeaders headers = soapMessage.getMimeHeaders();
            headers.addHeader("SOAPAction", soapAction);
        }

        soapMessage.saveChanges();

        /* Print the request message, just for debugging purposes */
        System.out.println("Request SOAP Message:");
        soapMessage.writeTo(System.out);
        System.out.println("\n");

        return soapMessage;
    }

}


text:
@interface NSData (Utils)

@end

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

    <title>Code coverage report for app/app.component.ts</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../prettify.css" />
    <link rel="stylesheet" href="../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      all files / app/ app.component.ts

        65.63%
        Statements
        21/32

        0%
        Branches
        0/6

        60%
        Functions
        3/5

        62.07%
        Lines
        18/29

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60	1×
1×

1×
2×

1×

1×

1×

1×

1×

1×
1×
1×
1×
7×
7×
7×

1×

1×

import { Component, OnInit } from '@angular/core';
import {FormGroup, FormControl, Validators, FormBuilder} from "@angular/forms";

@Component({
  moduleId: module.id,
  selector: 'coin-app',
  templateUrl: 'app.component.html',
  styleUrls: ['app.style.css']
})

export class AppComponent implements  OnInit {
  constructor(private _formbuilder: FormBuilder){}

  /*Object for Form Group*/
  currencyForm: FormGroup;
  /*Array of required currency  coins*/
  coins = [200, 100, 50, 20,10, 2, 1];
  /*Created array to set output in this and loop through*/
  getCoinsList:any=[];
  /*Sample array for showing the calculated currency*/
  outputCoins=['2£','1£', '50p', '20p', '10p', '2p','1p']

 /*Initilization of form and currency input with validations*/
  ngOnInit(){
    this.currencyForm = this._formbuilder.group({
      currency: ['£12.56p',Validators.compose([Validators.required, Validators.pattern(/^(\u00A3)?([0-9.]+)p?$/)])]
    })
  }

/*calculate function with all logic required to calculate the coins*/
  calculate(amount:any) {
    if (this.currencyForm.valid) {
      amount = amount.replace(/[^\d.-]/g, '');
      amount = parseFloat(amount).toFixed(2);

      console.log(amount);
      if (amount.indexOf("£") > -1 || amount.indexOf(".") > -1) {
        amount = (amount * 100).toFixed(0);
      } else {
        amount = amount.replace(/[^\d.-]/g, '');
        amount = parseFloat(amount).toFixed(2);
        console.log('2',amount);
      }
       this.getCoinsList = this.setCurrencyValues(amount);
    }
  }

/*SetCurrencyValues function to list out the requried coins to reach the provided currency*/
  setCurrencyValues(amount:any) {
    var coinVal:any = [];
    let calc:any;
    for(let i = 0; i< this.coins.length; i++){
      calc = Math.floor(amount / this.coins[i]);
      amount = amount % this.coins[i];
      coinVal[i] =  calc;
    }
    return coinVal;
  };
}

  Code coverage
  generated by istanbul at Tue Apr 18 2017 14:29:56 GMT+0530 (IST)


text:
package libpod

import (
	"bufio"
	"net"

	"github.com/containers/libpod/libpod/define"
	"k8s.io/client-go/tools/remotecommand"
)

// OCIRuntime is an implementation of an OCI runtime.
// The OCI runtime implementation is expected to be a fairly thin wrapper around
// the actual runtime, and is not expected to include things like state
// management logic - e.g., we do not expect it to determine on its own that
// calling 'UnpauseContainer()' on a container that is not paused is an error.
// The code calling the OCIRuntime will manage this.
// TODO: May want to move the Attach() code under this umbrella. It's highly OCI
// runtime dependent.
// TODO: May want to move the conmon cleanup code here too - it depends on
// Conmon being in use.
type OCIRuntime interface {
	// Name returns the name of the runtime.
	Name() string
	// Path returns the path to the runtime executable.
	Path() string

	// CreateContainer creates the container in the OCI runtime.
	CreateContainer(ctr *Container, restoreOptions *ContainerCheckpointOptions) error
	// UpdateContainerStatus updates the status of the given container.
	UpdateContainerStatus(ctr *Container) error
	// StartContainer starts the given container.
	StartContainer(ctr *Container) error
	// KillContainer sends the given signal to the given container.
	// If all is set, all processes in the container will be signalled;
	// otherwise, only init will be signalled.
	KillContainer(ctr *Container, signal uint, all bool) error
	// StopContainer stops the given container.
	// The container's stop signal (or SIGTERM if unspecified) will be sent
	// first.
	// After the given timeout, SIGKILL will be sent.
	// If the given timeout is 0, SIGKILL will be sent immediately, and the
	// stop signal will be omitted.
	// If all is set, we will attempt to use the --all flag will `kill` in
	// the OCI runtime to kill all processes in the container, including
	// exec sessions. This is only supported if the container has cgroups.
	StopContainer(ctr *Container, timeout uint, all bool) error
	// DeleteContainer deletes the given container from the OCI runtime.
	DeleteContainer(ctr *Container) error
	// PauseContainer pauses the given container.
	PauseContainer(ctr *Container) error
	// UnpauseContainer unpauses the given container.
	UnpauseContainer(ctr *Container) error

	// HTTPAttach performs an attach intended to be transported over HTTP.
	// For terminal attach, the container's output will be directly streamed
	// to output; otherwise, STDOUT and STDERR will be multiplexed, with
	// a header prepended as follows: 1-byte STREAM (0, 1, 2 for STDIN,
	// STDOUT, STDERR), 3 null (0x00) bytes, 4-byte big endian length.
	// If a cancel channel is provided, it can be used to asynchronously
	// termninate the attach session. Detach keys, if given, will also cause
	// the attach session to be terminated if provided via the STDIN
	// channel. If they are not provided, the default detach keys will be
	// used instead. Detach keys of "" will disable detaching via keyboard.
	// The streams parameter may be passed for containers that did not
	// create a terminal and will determine which streams to forward to the
	// client.
	HTTPAttach(ctr *Container, httpConn net.Conn, httpBuf *bufio.ReadWriter, streams *HTTPAttachStreams, detachKeys *string, cancel <-chan bool) error
	// AttachResize resizes the terminal in use by the given container.
	AttachResize(ctr *Container, newSize remotecommand.TerminalSize) error

	// ExecContainer executes a command in a running container.
	// Returns an int (exit code), error channel (errors from attach), and
	// error (errors that occurred attempting to start the exec session).
	ExecContainer(ctr *Container, sessionID string, options *ExecOptions) (int, chan error, error)
	// ExecAttachResize resizes the terminal of a running exec session. Only
	// allowed with sessions that were created with a TTY.
	ExecAttachResize(ctr *Container, sessionID string, newSize remotecommand.TerminalSize) error
	// ExecStopContainer stops a given exec session in a running container.
	// SIGTERM with be sent initially, then SIGKILL after the given timeout.
	// If timeout is 0, SIGKILL will be sent immediately, and SIGTERM will
	// be omitted.
	ExecStopContainer(ctr *Container, sessionID string, timeout uint) error
	// ExecUpdateStatus checks the status of a given exec session.
	// Returns true if the session is still running, or false if it exited.
	ExecUpdateStatus(ctr *Container, sessionID string) (bool, error)
	// ExecContainerCleanup cleans up after an exec session exits.
	// It removes any files left by the exec session that are no longer
	// needed, including the attach socket.
	ExecContainerCleanup(ctr *Container, sessionID string) error

	// CheckpointContainer checkpoints the given container.
	// Some OCI runtimes may not support this - if SupportsCheckpoint()
	// returns false, this is not implemented, and will always return an
	// error.
	CheckpointContainer(ctr *Container, options ContainerCheckpointOptions) error

	// SupportsCheckpoint returns whether this OCI runtime
	// implementation supports the CheckpointContainer() operation.
	SupportsCheckpoint() bool
	// SupportsJSONErrors is whether the runtime can return JSON-formatted
	// error messages.
	SupportsJSONErrors() bool
	// SupportsNoCgroups is whether the runtime supports running containers
	// without cgroups.
	SupportsNoCgroups() bool

	// AttachSocketPath is the path to the socket to attach to a given
	// container.
	// TODO: If we move Attach code in here, this should be made internal.
	// We don't want to force all runtimes to share the same attach
	// implementation.
	AttachSocketPath(ctr *Container) (string, error)
	// ExecAttachSocketPath is the path to the socket to attach to a given
	// exec session in the given container.
	// TODO: Probably should be made internal.
	ExecAttachSocketPath(ctr *Container, sessionID string) (string, error)
	// ExitFilePath is the path to a container's exit file.
	// All runtime implementations must create an exit file when containers
	// exit, containing the exit code of the container (as a string).
	// This is the path to that file for a given container.
	ExitFilePath(ctr *Container) (string, error)

	// RuntimeInfo returns verbose information about the runtime.
	RuntimeInfo() (*define.ConmonInfo, *define.OCIRuntimeInfo, error)
}

// ExecOptions are options passed into ExecContainer. They control the command
// that will be executed and how the exec will proceed.
type ExecOptions struct {
	// Cmd is the command to execute.
	Cmd []string
	// CapAdd is a set of capabilities to add to the executed command.
	CapAdd []string
	// Env is a set of environment variables to add to the container.
	Env map[string]string
	// Terminal is whether to create a new TTY for the exec session.
	Terminal bool
	// Cwd is the working directory for the executed command. If unset, the
	// working directory of the container will be used.
	Cwd string
	// User is the user the command will be executed as. If unset, the user
	// the container was run as will be used.
	User string
	// Streams are the streams that will be attached to the container.
	Streams *define.AttachStreams
	// PreserveFDs is a number of additional file descriptors (in addition
	// to 0, 1, 2) that will be passed to the executed process. The total FDs
	// passed will be 3 + PreserveFDs.
	PreserveFDs uint
	// DetachKeys is a set of keys that, when pressed in sequence, will
	// detach from the container.
	// If not provided, the default keys will be used.
	// If provided but set to "", detaching from the container will be
	// disabled.
	DetachKeys *string
}

// HTTPAttachStreams informs the HTTPAttach endpoint which of the container's
// standard streams should be streamed to the client. If this is passed, at
// least one of the streams must be set to true.
type HTTPAttachStreams struct {
	Stdin  bool
	Stdout bool
	Stderr bool
}


text:
Derived Layers

Create new layers based on raw SQL queries.

        <form class="main-form" ng-submit="create()">
          <input type="text" placeholder="Layer name" ng-model="name">

SQL Query

            <textarea ng-model="sql" ui-ace="aceOptions"></textarea>

          <input type="submit" value="{{loading ? 'Obtaining results...' : 'Create query'}}" ng-disabled="loading" />

{{err}}

        </form>

Sample data

      <form ng-submit="create()">

          <input type="submit" value="Click here to create new layer" />

      </form>


text:
\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[letterpaper,10pt]{article}

%Useful packages
\usepackage[margin=.5in]{geometry}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{FiraSans}
\usepackage{xhfill}
\usepackage[fontsize=9pt]{scrextend}

%enumitem decrease item seperation
\setlist[1]{itemsep=-.1mm}

%Document settings
\pagenumbering{gobble}
\setlength\parindent{0pt}

%Commands for this document
\newcommand{\topic}[1]{\vspace{2mm} \rule[.5em]{10mm}{.2pt} {\large \bfseries #1} \xrfill[.5em]{.2pt} \newline \vspace{-2mm}}
%Used for entries, \fullentry{name}{location/position}{date}
\newcommand{\fullentry}[3] { \parbox[t]{.6\textwidth}{\large \bfseries #1} \hfill \parbox[t]{.4\textwidth}{\bfseries \raggedleft #2 \\ #3} \vspace{.5mm} \newline}
%Used to equispace contact info without losing centering
\newcommand{\contact}[1]{\parbox{.18\textwidth}{\centering #1}}

\begin{document}
	%Header
	\begin{center} \huge \bfseries
		Brandon A. Moore
	\end{center}
	%Contact info should be separated with \hfills
	\contact{moore.3071@osu.edu} \hfill \contact{github.com/moore3071} \hfill \contact{PO Box 21161\\Columbus OH 43221} \hfill \contact{moore3071.github.io}

	\xhrulefill{black}{2pt}
	%End Header

	\vspace{5mm}

	\noindent {\bfseries \Large Objective: } Seeking a position which will allow me to use my education and experience to contribute to a company with a strong drive for using technology to help their users and employees.

	\vspace{3mm}

	\topic{EDUCATION}

		\fullentry{BS Computer Science and Engineering\\GPA 3.33}{Ohio State University}{May 2017}
			\vspace{-7mm}
			\begin{itemize}
				\item Conceptualized and implemented a 400\% faster implementation of the Michael Collin's part of speech tagger
				\item Utilized IBM's BlueMix service to build a flexible natural language simulation for hostage negotiation simulation
			\end{itemize}
			\begin{multicols}{3}
				\begin{itemize}
					\setlength\itemsep{.1mm}
					\item Artificial intelligence
					\item Speech \& language processing
					\item networking
					\item information security
					\item Cryptography
					\item software engineering
					\item data types and algorithms
					\item systems design
					\item Web App development
				\end{itemize}
			\end{multicols}

	\topic{EXPERIENCE}

		\fullentry{Software engineer at MoonShot/InSourceCode \\ Internship}{Indianapolis, Indiana}{Summer 2016}
			Summer internship focusing on the maintenance of a number of high profile websites, and the creation of a usable backend service for a rapidly expanding catering service.
			\begin{itemize}
				\item Developed and pushed into production a high-visibility site hooked into a number of APIs for tracking, email notifications, and financial transactions.
				\item Addressed speed problems related to third-party scripts that were actively leading to the loss of viewers
				\item Led a team in developing a concise database schema for catering management
			\end{itemize}

		\fullentry{Software engineer at Bertec \\ Internship}{Columbus, Ohio}{June 2015-May 2016}
			Summer internship focusing on the development of medical software in a small intensive team.
			\begin{itemize}
				\item Refactored code to decrease potential of software rot and provide a cleaner experience for future developers
				\item Introduced unit testing to the software, and provided a road map for high coverage of legacy software
			\end{itemize}

		\fullentry{Intern at Franklin County Emergency\\ Management and Homeland Security}{Columbus, Ohio}{Summer 2014}
			Summer internship focusing on the development of a flood detection system for Franklin County.
			\begin{itemize}
				\item Provided a system for instantaneous notification to EMA personnel of flood conditions
				\item Developed a maintainable database schema with a simple REST API for frontend access
				\item Laid a foundation for the updating of emergency management with the help of staff
			\end{itemize}

	\topic{ACTIVITIES}

		\fullentry{OpenSource Club at\\ The Ohio State University}{President(2016-2017),}{Librarian(2015-2016)}
		\vspace{-7mm}
		\begin{itemize}
			\item Presided over and organized weekly tech talks from members and speakers from the open source community
			\item Built ties with likewise organizations across the nation
			\item Contributed to the unification of extracurricular tech clubs through OHI/O
			\item Documented information on the organization and its servers to facilitate easier officer transition
		\end{itemize}

		{\bf Other activities:}

		\begin{multicols}{3} \raggedright
			\begin{itemize}
				\item Collegiate Web Development Group 2014-2016
				\item Electronics Club at OSU 2014-2016
				\item Buckeye Hackers 2015-2016
				\item Ohio LinuxFest 2016
				\item PyOhio 2016
				\item Cardinal Health hackathon 2014
				\item OHI/O hackathon 2015,2014
				\item Makeathon at OSU 2015
				\item Townhack at OSU 2015
			\end{itemize}
		\end{multicols}

\end{document}


text:
package com.amazonaws.handlers;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import com.amazonaws.AmazonClientException;

/**
 * Factory for creating request/response handler chains.
 */
public class HandlerChainFactory {

    /**
     * Constructs a new request handler chain by analyzing the specified
     * classpath resource.
     *
     * @param resource
     *            The resource to load from the classpath containing the list of
     *            request handlers to instantiate.
     *
     * @return A list of request handlers based on the handlers referenced in
     *         the specified resource.
     */
    public List<RequestHandler> newRequestHandlerChain(String resource) {
        List<RequestHandler> handlers = new ArrayList<RequestHandler>();

        try {
            InputStream input = getClass().getResourceAsStream(resource);
            if (input == null) return handlers;

            BufferedReader reader = new BufferedReader(new InputStreamReader(input));
            while (true) {
                String requestHandlerClassName = reader.readLine();
                if (requestHandlerClassName == null) break;
                requestHandlerClassName = requestHandlerClassName.trim();
                if (requestHandlerClassName.equals("")) continue;

                Class<?> requestHandlerClass = getClass().getClassLoader().loadClass(requestHandlerClassName);
                Object requestHandlerObject = requestHandlerClass.newInstance();
                if (requestHandlerObject instanceof RequestHandler) {
                    handlers.add((RequestHandler)requestHandlerObject);
                } else {
                    throw new AmazonClientException("Unable to instantiate request handler chain for client.  "
                            + "Listed request handler ('" + requestHandlerClassName + "') "
                            + "does not implement the RequestHandler interface.");
                }
            }
        } catch (Exception e) {
            throw new AmazonClientException("Unable to instantiate request handler chain for client: "
                    + e.getMessage(), e);
        }

        return handlers;
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Post Idea - Step 3/3</title>

Post your Idea -  Step 3/3

        <form ng-controller="PostIdeaCtrl" name="PostIdea2" action="#/ideaHunt/dashboard">

                     Business Case
                    <textarea name="businessCase" id="businessCase" class="form-control" rows="3" ></textarea>

                     Implementation Aspects
                    <textarea name="implementationAspects" id="implementationAspects" class="form-control" rows="3" ></textarea>

                     Comparative Landscape
                    <textarea name="comparativeLandscape" id="comparativeLandscape" class="form-control" rows="3" ></textarea>

                     Applicability
                    <textarea name="applicabilityDetail" id="applicabilityDetail" class="form-control" rows="3" ></textarea>

                <button type="submit" class="btn btn-primary">Submit</button>

        </form>

Sample Ideas to help you ...

			                    {{idea.name}}

{{idea.snippet}}


text:
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.impl;

import com.intellij.lang.ASTNode;
import com.intellij.lang.LighterASTNode;
import com.intellij.lang.LighterASTTokenNode;
import com.intellij.lang.impl.PsiBuilderImpl;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.ThrowableComputable;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.impl.source.SourceTreeToPsiMap;
import com.intellij.psi.impl.source.tree.*;
import com.intellij.psi.stubs.ObjectStubSerializer;
import com.intellij.psi.stubs.Stub;
import com.intellij.psi.templateLanguages.OuterLanguageElement;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.util.*;
import com.intellij.util.diff.FlyweightCapableTreeStructure;
import com.intellij.util.graph.InboundSemiGraph;
import com.intellij.util.graph.OutboundSemiGraph;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

public final class DebugUtil {
  private static final Logger LOG = Logger.getInstance(DebugUtil.class);

  @SuppressWarnings("StaticNonFinalField") public static boolean CHECK;
  public static final boolean DO_EXPENSIVE_CHECKS;
  static {
    Application application = ApplicationManager.getApplication();
    DO_EXPENSIVE_CHECKS = application != null && application.isUnitTestMode();
  }
  public static final boolean CHECK_INSIDE_ATOMIC_ACTION_ENABLED = DO_EXPENSIVE_CHECKS;

  public static @NotNull String psiTreeToString(@NotNull PsiElement element, boolean showWhitespaces) {
    ASTNode node = SourceTreeToPsiMap.psiElementToTree(element);
    assert node != null : element;
    return treeToString(node, showWhitespaces);
  }

  public static @NotNull String treeToString(@NotNull ASTNode root, boolean showWhitespaces) {
    StringBuilder buffer = new StringBuilder();
    treeToBuffer(buffer, root, 0, showWhitespaces, false, false, true);
    return buffer.toString();
  }

  public static @NotNull String nodeTreeToString(@NotNull ASTNode root, boolean showWhitespaces) {
    StringBuilder buffer = new StringBuilder();
    treeToBuffer(buffer, root, 0, showWhitespaces, false, false, false);
    return buffer.toString();
  }

  public static @NotNull String treeToString(@NotNull ASTNode root, boolean showWhitespaces, boolean showRanges) {
    StringBuilder buffer = new StringBuilder();
    treeToBuffer(buffer, root, 0, showWhitespaces, showRanges, false, true);
    return buffer.toString();
  }

  public static void treeToBuffer(@NotNull Appendable buffer,
                                  @NotNull ASTNode root,
                                  int indent,
                                  boolean showWhitespaces,
                                  boolean showRanges,
                                  boolean showChildrenRanges,
                                  boolean usePsi) {
    treeToBuffer(buffer, root, indent, showWhitespaces, showRanges, showChildrenRanges, usePsi, null);
  }

  private static void treeToBuffer(Appendable buffer,
                                   ASTNode root,
                                   int indent,
                                   boolean showWhitespaces,
                                   boolean showRanges,
                                   boolean showChildrenRanges,
                                   boolean usePsi,
                                   @Nullable PairConsumer<? super PsiElement, ? super Consumer<? super PsiElement>> extra) {
    ((TreeElement)root).acceptTree(new TreeToBuffer(buffer, indent, showWhitespaces, showRanges, showChildrenRanges, usePsi, extra));
  }

  private static class TreeToBuffer extends RecursiveTreeElementWalkingVisitor {
    private final Appendable buffer;
    private final boolean showWhitespaces;
    private final boolean showRanges;
    private final boolean showChildrenRanges;
    private final boolean usePsi;
    private final PairConsumer<? super PsiElement, ? super Consumer<? super PsiElement>> extra;
    private int indent;

    private TreeToBuffer(Appendable buffer,
                         int indent,
                         boolean showWhitespaces,
                         boolean showRanges,
                         boolean showChildrenRanges,
                         boolean usePsi,
                         PairConsumer<? super PsiElement, ? super Consumer<? super PsiElement>> extra) {
      this.buffer = buffer;
      this.showWhitespaces = showWhitespaces;
      this.showRanges = showRanges;
      this.showChildrenRanges = showChildrenRanges;
      this.usePsi = usePsi;
      this.extra = extra;
      this.indent = indent;
    }

    @Override
    protected void visitNode(TreeElement root) {
      if (!shouldShowNode(root)) {
        indent += 2;
        return;
      }

      StringUtil.repeatSymbol(buffer, ' ', indent);
      try {
        if (root instanceof CompositeElement) {
          if (usePsi) {
            PsiElement psiElement = root.getPsi();
            if (psiElement != null) {
              buffer.append(psiElement.toString());
            }
            else {
              buffer.append(root.getElementType().toString());
            }
          }
          else {
            buffer.append(root.toString());
          }
        }
        else {
          String text = fixWhiteSpaces(root.getText());
          buffer.append(root.toString()).append("('").append(text).append("')");
        }
        if (showRanges) buffer.append(root.getTextRange().toString());
        buffer.append("\n");
        indent += 2;
        if (root instanceof CompositeElement && root.getFirstChildNode() == null && showEmptyChildren()) {
          StringUtil.repeatSymbol(buffer, ' ', indent);
          buffer.append("<empty list>\n");
        }
      }
      catch (IOException e) {
        LOG.error(e);
      }

      super.visitNode(root);
    }

    protected boolean showEmptyChildren() {
      return true;
    }

    protected boolean shouldShowNode(TreeElement node) {
      return showWhitespaces || node.getElementType() != TokenType.WHITE_SPACE;
    }

    @Override
    protected void elementFinished(@NotNull ASTNode e) {
      PsiElement psiElement = extra != null && usePsi && e instanceof CompositeElement ? e.getPsi() : null;
      if (psiElement != null) {
        Consumer<PsiElement> consumer = element ->
          treeToBuffer(buffer, element.getNode(), indent, showWhitespaces, showRanges, showChildrenRanges, true, null);
        extra.consume(psiElement, consumer);
      }
      indent -= 2;
    }
  }

  public static @NotNull String lightTreeToString(@NotNull FlyweightCapableTreeStructure<LighterASTNode> tree, boolean showWhitespaces) {
    StringBuilder buffer = new StringBuilder();
    lightTreeToBuffer(tree, tree.getRoot(), buffer, 0, showWhitespaces);
    return buffer.toString();
  }

  private static void lightTreeToBuffer(FlyweightCapableTreeStructure<LighterASTNode> tree,
                                        @NotNull LighterASTNode node,
                                        Appendable buffer,
                                        int indent,
                                        boolean showWhitespaces) {
    IElementType tokenType = node.getTokenType();
    if (!showWhitespaces && tokenType == TokenType.WHITE_SPACE) return;

    boolean isLeaf = node instanceof LighterASTTokenNode;

    StringUtil.repeatSymbol(buffer, ' ', indent);
    try {
      if (tokenType == TokenType.ERROR_ELEMENT) {
        buffer.append("PsiErrorElement:").append(PsiBuilderImpl.getErrorMessage(node));
      }
      else if (tokenType == TokenType.WHITE_SPACE) {
        buffer.append("PsiWhiteSpace");
      }
      else {
        buffer.append(isLeaf ? "PsiElement" : "Element").append('(').append(tokenType.toString()).append(')');
      }

      if (isLeaf) {
        String text = ((LighterASTTokenNode)node).getText().toString();
        buffer.append("('").append(fixWhiteSpaces(text)).append("')");
      }
      buffer.append('\n');

      if (!isLeaf) {
        Ref<LighterASTNode[]> kids = new Ref<>();
        int numKids = tree.getChildren(node, kids);
        if (numKids == 0) {
          StringUtil.repeatSymbol(buffer, ' ', indent + 2);
          buffer.append("<empty list>\n");
        }
        else {
          for (int i = 0; i < numKids; i++) {
            lightTreeToBuffer(tree, kids.get()[i], buffer, indent + 2, showWhitespaces);
          }
        }
      }
    }
    catch (IOException e) {
      LOG.error(e);
    }
  }

  public static @NotNull String stubTreeToString(@NotNull Stub root) {
    StringBuilder builder = new StringBuilder();
    stubTreeToBuffer(root, builder, 0);
    return builder.toString();
  }

  public static void stubTreeToBuffer(@NotNull Stub node, @NotNull Appendable buffer, int indent) {
    StringUtil.repeatSymbol(buffer, ' ', indent);
    try {
      ObjectStubSerializer<?, ?> stubType = node.getStubType();
      if (stubType != null) {
        buffer.append(stubType.toString()).append(':');
      }
      buffer.append(node.toString()).append('\n');

      List<? extends Stub> children = node.getChildrenStubs();
      for (Stub child : children) {
        stubTreeToBuffer(child, buffer, indent + 2);
      }
    }
    catch (IOException e) {
      LOG.error(e);
    }
  }

  private static void doCheckTreeStructure(@Nullable ASTNode anyElement) {
    if (anyElement == null) return;
    ASTNode root = anyElement;
    while (root.getTreeParent() != null) {
      root = root.getTreeParent();
    }
    if (root instanceof CompositeElement) {
      checkSubtree((CompositeElement)root);
    }
  }

  private static void checkSubtree(CompositeElement root) {
    if (root.rawFirstChild() == null) {
      if (root.rawLastChild() != null) {
        throw new IncorrectTreeStructureException(root, "firstChild == null, but lastChild != null");
      }
    }
    else {
      for (ASTNode child = root.getFirstChildNode(); child != null; child = child.getTreeNext()) {
        if (child instanceof CompositeElement) {
          checkSubtree((CompositeElement)child);
        }
        if (child.getTreeParent() != root) {
          throw new IncorrectTreeStructureException(child, "child has wrong parent value");
        }
        if (child == root.getFirstChildNode()) {
          if (child.getTreePrev() != null) {
            throw new IncorrectTreeStructureException(root, "firstChild.prev != null");
          }
        }
        else {
          if (child.getTreePrev() == null) {
            throw new IncorrectTreeStructureException(child, "not first child has prev == null");
          }
          if (child.getTreePrev().getTreeNext() != child) {
            throw new IncorrectTreeStructureException(child, "element.prev.next != element");
          }
        }
        if (child.getTreeNext() == null) {
          if (root.getLastChildNode() != child) {
            throw new IncorrectTreeStructureException(child, "not last child has next == null");
          }
        }
      }
    }
  }

  public static void checkParentChildConsistent(@NotNull ASTNode element) {
    ASTNode treeParent = element.getTreeParent();
    if (treeParent == null) return;
    ASTNode[] elements = treeParent.getChildren(null);
    if (ArrayUtil.find(elements, element) == -1) {
      throw new IncorrectTreeStructureException(element, "child cannot be found among parents children");
    }
  }

  public static void checkSameCharTabs(@NotNull ASTNode element1, @NotNull ASTNode element2) {
    CharTable fromCharTab = SharedImplUtil.findCharTableByTree(element1);
    CharTable toCharTab = SharedImplUtil.findCharTableByTree(element2);
    LOG.assertTrue(fromCharTab == toCharTab);
  }

  public static @NotNull String psiToString(@NotNull PsiElement element, boolean showWhitespaces) {
    return psiToString(element, showWhitespaces, false);
  }

  public static @NotNull String psiToString(@NotNull PsiElement root, boolean showWhitespaces, boolean showRanges) {
    return psiToString(root, showWhitespaces, showRanges, null);
  }

  public static @NotNull String psiToString(@NotNull PsiElement root,
                                            boolean showWhitespaces,
                                            boolean showRanges,
                                            @Nullable PairConsumer<? super PsiElement, ? super Consumer<? super PsiElement>> extra) {
    StringBuilder buffer = new StringBuilder();
    psiToBuffer(buffer, root, showWhitespaces, showRanges, extra);
    return buffer.toString();
  }

  public static @NotNull String psiToStringIgnoringNonCode(@NotNull PsiElement element) {
    StringBuilder buffer = new StringBuilder();
    ((TreeElement)element.getNode()).acceptTree(
      new TreeToBuffer(buffer, 0, false, false, false, false, null) {
        @Override
        protected boolean shouldShowNode(TreeElement node) {
          return super.shouldShowNode(node) &&
                 !(node instanceof PsiErrorElement) && !(node instanceof PsiComment) &&
                 !(node instanceof LeafPsiElement && StringUtil.isEmptyOrSpaces(node.getText())) &&
                 !(node instanceof OuterLanguageElement);
        }

        @Override
        protected boolean showEmptyChildren() {
          return false;
        }
      });
    return buffer.toString();
  }

  private static void psiToBuffer(Appendable buffer,
                                  PsiElement root,
                                  boolean showWhitespaces,
                                  boolean showRanges,
                                  @Nullable PairConsumer<? super PsiElement, ? super Consumer<? super PsiElement>> extra) {
    final ASTNode node = root.getNode();
    if (node == null) {
      psiToBuffer(buffer, root, 0, showWhitespaces, showRanges, showRanges, extra);
    }
    else {
      treeToBuffer(buffer, node, 0, showWhitespaces, showRanges, showRanges, true, extra);
    }
  }

  public static void psiToBuffer(@NotNull Appendable buffer,
                                 @NotNull PsiElement root,
                                 int indent,
                                 boolean showWhitespaces,
                                 boolean showRanges,
                                 boolean showChildrenRanges) {
    psiToBuffer(buffer, root, indent, showWhitespaces, showRanges, showChildrenRanges, null);
  }

  private static void psiToBuffer(Appendable buffer,
                                  PsiElement root,
                                  int indent,
                                  boolean showWhitespaces,
                                  boolean showRanges,
                                  boolean showChildrenRanges,
                                  @Nullable PairConsumer<? super PsiElement, ? super Consumer<? super PsiElement>> extra) {
    if (!showWhitespaces && root instanceof PsiWhiteSpace) return;

    StringUtil.repeatSymbol(buffer, ' ', indent);
    try {
      buffer.append(root.toString());
      PsiElement child = root.getFirstChild();
      if (child == null) {
        String text = root.getText();
        assert text != null : "text is null for <" + root + ">";
        buffer.append("('").append(fixWhiteSpaces(text)).append("')");
      }

      if (showRanges) buffer.append(root.getTextRange().toString());
      buffer.append("\n");
      while (child != null) {
        psiToBuffer(buffer, child, indent + 2, showWhitespaces, showChildrenRanges, showChildrenRanges, extra);
        child = child.getNextSibling();
      }
      if (extra != null) {
        Consumer<PsiElement> consumer =
          element -> psiToBuffer(buffer, element, indent + 2, !showWhitespaces, showChildrenRanges, showChildrenRanges, null);
        extra.consume(root, consumer);
      }
    }
    catch (IOException e) {
      LOG.error(e);
    }
  }

  private static String fixWhiteSpaces(String text) {
    return text.replace("\n", "\\n").replace("\r", "\\r").replace("\t", "\\t");
  }

  public static @NotNull String currentStackTrace() {
    return ExceptionUtil.currentStackTrace();
  }

  public static class IncorrectTreeStructureException extends RuntimeException {
    private final ASTNode myElement;

    IncorrectTreeStructureException(ASTNode element, String message) {
      super(message);
      myElement = element;
    }

    public ASTNode getElement() {
      return myElement;
    }
  }

  private static final ThreadLocal<Object> ourPsiModificationTrace = new ThreadLocal<>();
  private static final ThreadLocal<Integer> ourPsiModificationDepth = new ThreadLocal<>();

  private static void beginPsiModification(@Nullable String trace) {
    if (!PsiInvalidElementAccessException.isTrackingInvalidation()) {
      return;
    }
    if (ourPsiModificationTrace.get() == null) {
      ourPsiModificationTrace.set(trace != null || ApplicationManagerEx.isInStressTest() ? trace : new Throwable());
    }
    Integer depth = ourPsiModificationDepth.get();
    if (depth == null) depth = 0;
    ourPsiModificationDepth.set(depth + 1);
  }

  private static void endPsiModification() {
    if (!PsiInvalidElementAccessException.isTrackingInvalidation()) {
      return;
    }
    Integer depth = ourPsiModificationDepth.get();
    if (depth == null) {
      LOG.warn("Unmatched PSI modification end", new Throwable());
      depth = 0;
    }
    else {
      depth--;
      ourPsiModificationDepth.set(depth);
    }
    if (depth == 0) {
      ourPsiModificationTrace.set(null);
    }
  }

  /**
   * Any PSI/AST elements invalidated inside the give action will contain a debug trace identifying this transaction,
   * and so will {@link PsiInvalidElementAccessException} thrown when accessing such invalid elements.
   * This should help finding out why a specific PSI element has become invalid.
   *
   * @param trace The debug trace that the invalidated elements should be identified by. May be null, then current stack trace is used.
   */
  public static <T extends Throwable> void performPsiModification(String trace, @NotNull ThrowableRunnable<T> runnable) throws T {
    beginPsiModification(trace);
    try {
      runnable.run();
    }
    finally {
      endPsiModification();
    }
  }

  /**
   * @see #performPsiModification(String, ThrowableRunnable)
   */
  public static <T, E extends Throwable> T performPsiModification(String trace, @NotNull ThrowableComputable<T, E> runnable) throws E {
    beginPsiModification(trace);
    try {
      return runnable.compute();
    }
    finally {
      endPsiModification();
    }
  }

  public static void onInvalidated(@NotNull ASTNode treeElement) {
    Object trace = calcInvalidationTrace(treeElement);
    if (trace != null) {
      PsiInvalidElementAccessException.setInvalidationTrace(treeElement, trace);
    }
  }

  public static void onInvalidated(@NotNull PsiElement o) {
    Object trace = PsiInvalidElementAccessException.getInvalidationTrace(o);
    if (trace == null) {
      PsiInvalidElementAccessException.setInvalidationTrace(o, currentInvalidationTrace());
    }
  }

  public static void onInvalidated(@NotNull FileViewProvider provider) {
    Object trace = calcInvalidationTrace(null);
    if (trace != null) {
      PsiInvalidElementAccessException.setInvalidationTrace(provider, trace);
    }
  }

  private static @Nullable Object calcInvalidationTrace(@Nullable ASTNode treeElement) {
    if (!PsiInvalidElementAccessException.isTrackingInvalidation()) {
      return null;
    }
    if (PsiInvalidElementAccessException.findInvalidationTrace(treeElement) != null) {
      return null;
    }

    return currentInvalidationTrace();
  }

  private static @Nullable Object currentInvalidationTrace() {
    Object trace = ourPsiModificationTrace.get();
    return trace != null || ApplicationManagerEx.isInStressTest() ? trace : handleUnspecifiedTrace();
  }

  private static Throwable handleUnspecifiedTrace() {
    Throwable trace = new Throwable();
    if (ApplicationManager.getApplication().isUnitTestMode()) {
      LOG.error("PSI invalidated outside transaction", trace);
    }
    else {
      LOG.info("PSI invalidated outside transaction", trace);
    }
    return trace;
  }

  public static void revalidateNode(@NotNull ASTNode element) {
    PsiInvalidElementAccessException.setInvalidationTrace(element, null);
  }

  public static void sleep(long millis) {
    TimeoutUtil.sleep(millis);
  }

  public static void checkTreeStructure(ASTNode element) {
    if (CHECK) {
      doCheckTreeStructure(element);
    }
  }

  public static @NotNull String diagnosePsiDocumentInconsistency(@NotNull PsiElement element, @NotNull Document document) {
    PsiUtilCore.ensureValid(element);

    PsiFile file = element.getContainingFile();
    if (file == null) return "no file for " + element + " of " + element.getClass();

    PsiUtilCore.ensureValid(file);

    FileViewProvider viewProvider = file.getViewProvider();
    PsiDocumentManager manager = PsiDocumentManager.getInstance(file.getProject());

    Document actualDocument = viewProvider.getDocument();
    String fileDiagnostics = "File[" + file + " " + file.getName() + ", " + file.getLanguage() + ", " + viewProvider + "]";
    if (actualDocument != document) {
      return "wrong document for " + fileDiagnostics + "; expected " + document + "; actual " + actualDocument;
    }

    PsiFile cachedPsiFile = manager.getCachedPsiFile(document);
    FileViewProvider actualViewProvider = cachedPsiFile == null ? null : cachedPsiFile.getViewProvider();
    if (actualViewProvider != viewProvider) {
      return "wrong view provider for " + document + ", expected " + viewProvider + "; actual " + actualViewProvider;
    }

    if (!manager.isCommitted(document)) return "not committed document " + document + ", " + fileDiagnostics;

    int fileLength = file.getTextLength();
    int docLength = document.getTextLength();
    if (fileLength != docLength) {
      return "file/doc text length different, " + fileDiagnostics + " file.length=" + fileLength + "; doc.length=" + docLength;
    }

    return "unknown inconsistency in " + fileDiagnostics;
  }

  public static @NotNull <T> String graphToString(@NotNull InboundSemiGraph<T> graph) {
    StringBuilder buffer = new StringBuilder();
    printNodes(graph.getNodes().iterator(), node -> graph.getIn(node), 0, new HashSet<>(), buffer);
    return buffer.toString();
  }

  public static @NotNull <T> String graphToString(@NotNull OutboundSemiGraph<T> graph) {
    StringBuilder buffer = new StringBuilder();
    printNodes(graph.getNodes().iterator(), node -> graph.getOut(node), 0, new HashSet<>(), buffer);
    return buffer.toString();
  }

  private static <T> void printNodes(Iterator<? extends T> nodes, Function<? super T, ? extends Iterator<? extends T>> getter, int indent, Set<? super T> visited, StringBuilder buffer) {
    while (nodes.hasNext()) {
      T node = nodes.next();
      StringUtil.repeatSymbol(buffer, ' ', indent);
      buffer.append(node);
      if (visited.add(node)) {
        buffer.append('\n');
        printNodes(getter.fun(node), getter, indent + 2, visited, buffer);
      }
      else {
        buffer.append(" [...]\n");
      }
    }
  }

  //<editor-fold desc="Deprecated stuff">
  /** @deprecated use {@link #performPsiModification} instead */
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2022.2")
  public static void startPsiModification(@Nullable String trace) {
    beginPsiModification(trace);
  }

  /** @deprecated use {@link #performPsiModification} instead */
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2022.2")
  public static void finishPsiModification() {
    endPsiModification();
  }
  //</editor-fold>
}


text:
<?php

declare(strict_types=1);

namespace Mailgun\Model\Route;

use Mailgun\Model\ApiResponse;

/**
 * @author David Garcia <me@davidgarcia.cat>
 */
final class CreateResponse implements ApiResponse
{
    private $message;
    private $route;

    public static function create(array $data): self
    {
        $model = new self();
        $model->message = $data['message'] ?? null;
        $model->route = isset($data['route']) ? Route::create($data['route']) : null;

        return $model;
    }

    private function __construct()
    {
    }

    public function getMessage(): ?string
    {
        return $this->message;
    }

    public function getRoute(): ?Route
    {
        return $this->route;
    }
}


text:
package middleware

import (
	"net/http"
	"net/http/httptest"
	"net/url"
	"testing"

	"github.com/ant0ine/go-json-rest/rest"
	"github.com/stretchr/testify/assert"
)

const internalHandlerBody = "internal"

var encapsulated = rest.HandlerFunc(func(w rest.ResponseWriter, r *rest.Request) {
	// w.WriteJson would just be a hassle here, so we need to explicitly set the content type and cast the jrest
	// type to net/http types
	w.Header().Set("Content-Type", "text/plain")
	_, _ = w.(http.ResponseWriter).Write([]byte(internalHandlerBody))
})

func jrestServer(mw rest.Middleware, endpoint string) http.Handler {
	restAPI := rest.NewApi()
	restAPI.Use(mw)

	router, err := rest.MakeRouter(rest.Get(endpoint, encapsulated))

	if err != nil {
		return nil
	}

	restAPI.SetApp(router)
	return restAPI.MakeHandler()
}

func TestEnabledByDefault(t *testing.T) {
	s := NewRequireHTTPS(CheckRequest{})
	assert.NotNil(t, s)
	assert.False(t, s.check.Disabled)

	s = NewRequireHTTPS(CheckRequest{IsSecure: func(r *rest.Request) bool { return true }})
	assert.NotNil(t, s)
	assert.False(t, s.check.Disabled)
}

func TestCreateAlwaysSetsRequestCheck(t *testing.T) {
	s := NewRequireHTTPS(CheckRequest{})
	assert.NotNil(t, s.check.IsSecure)

	s = NewRequireHTTPS(CheckRequest{Disabled: true})
	assert.NotNil(t, s.check.IsSecure)

	s = NewRequireHTTPS(CheckRequest{Disabled: true, IsSecure: func(r *rest.Request) bool { return true }})
	assert.NotNil(t, s.check.IsSecure)
}

func TestRequestCheckSetFromConfig(t *testing.T) {
	req, _ := http.NewRequest("GET", "http://example.com/", nil)
	wrapped := &rest.Request{
		Request:    req,
		PathParams: nil,
		Env:        map[string]interface{}{},
	}

	s := NewRequireHTTPS(CheckRequest{Disabled: true, IsSecure: func(r *rest.Request) bool { return false }})
	assert.False(t, s.check.IsSecure(wrapped))
	s = NewRequireHTTPS(CheckRequest{Disabled: true, IsSecure: func(r *rest.Request) bool { return true }})
	assert.True(t, s.check.IsSecure(wrapped))
}

func TestDisabledDoesNotRedirectHTTP(t *testing.T) {
	// IsSecure will always return false, but it is disabled
	s := NewRequireHTTPS(CheckRequest{Disabled: true, IsSecure: func(r *rest.Request) bool { return false }})
	res := httptest.NewRecorder()
	req, _ := http.NewRequest("GET", "http://example.com/", nil)

	jrestServer(s, "/").ServeHTTP(res, req)

	assert.Equal(t, res.Code, http.StatusOK)
	assert.Equal(t, internalHandlerBody, res.Body.String())
}

func TestRedirectsHTTPByDefault(t *testing.T) {
	s := NewRequireHTTPS(CheckRequest{})
	res := httptest.NewRecorder()
	req, _ := http.NewRequest("GET", "http://example.com/", nil)

	jrestServer(s, "/").ServeHTTP(res, req)

	assert.Equal(t, res.Code, http.StatusMovedPermanently)
	assert.NotEqual(t, internalHandlerBody, res.Body.String())
}

func TestNoRedirectHTTPSByDefault(t *testing.T) {
	s := NewRequireHTTPS(CheckRequest{})
	res := httptest.NewRecorder()
	req, _ := http.NewRequest("GET", "https://example.com/", nil)

	jrestServer(s, "/").ServeHTTP(res, req)

	assert.Equal(t, res.Code, http.StatusOK)
	assert.Equal(t, internalHandlerBody, res.Body.String())
}

func TestRedirectChangesOnlyScheme(t *testing.T) {
	s := NewRequireHTTPS(CheckRequest{})
	res := httptest.NewRecorder()
	req, _ := http.NewRequest("GET", "http://example.com/?key1=value&key2=value2", nil)
	original := *req.URL //save a copy

	jrestServer(s, "/").ServeHTTP(res, req)

	assert.Equal(t, res.Code, http.StatusMovedPermanently)
	target, err := url.Parse(res.Header().Get("Location"))
	assert.NoError(t, err)
	assert.Equal(t, original.Host, target.Host)
	assert.Equal(t, original.Path, target.Path)
	assert.Equal(t, original.RawQuery, target.RawQuery)
	assert.NotEqual(t, original.Scheme, target.Scheme)
	assert.Equal(t, target.Scheme, "https")
}

func checkProxiedHTTPSHeaders(r *rest.Request) bool {
	return r.Header.Get("X-Forwarded-Proto") == "https" || r.Header.Get("$WSSC") == "https"
}

func TestCustomRequestHeadersCheck(t *testing.T) {
	s := NewRequireHTTPS(CheckRequest{IsSecure: checkProxiedHTTPSHeaders})
	res := httptest.NewRecorder()
	req, _ := http.NewRequest("GET", "http://example.com/", nil)
	req.Header.Set("X-Forwarded-Proto", "https")

	jrestServer(s, "/").ServeHTTP(res, req)
	assert.Equal(t, res.Code, http.StatusOK)
	assert.Equal(t, internalHandlerBody, res.Body.String())
}

func checkBenignPath(r *rest.Request) bool {
	return r.URL.Path == "/benign"
}

func TestSpecificRequestPathAllowed(t *testing.T) {
	s := NewRequireHTTPS(CheckRequest{IsSecure: checkBenignPath})
	res := httptest.NewRecorder()
	req, _ := http.NewRequest("GET", "http://example.com/benign", nil)

	jrestServer(s, "/benign").ServeHTTP(res, req)
	assert.Equal(t, res.Code, http.StatusOK)
	assert.Equal(t, internalHandlerBody, res.Body.String())
}


text:
package com.intellij.util.continuation;

/**
 * @author irengrig
 *         Date: 6/28/11
 *         Time: 3:26 PM
 */
public interface ContinuationPause {
  void suspend();

  void ping();
}


text:
require 'roo'
require 'csv'

module Squib

  # Pulls Excel data from `.xlsx` files into a column-based hash
  #
  # Pulls the data into a Hash of arrays based on the columns. First row is assumed to be the header row.
  # See the example `samples/excel.rb` in the [source repository](https://github.com/andymeneely/squib/tree/master/samples)
  #
  # @example
  #   # Excel file looks like this:
  #   # | h1 | h2 |
  #   # ------------
  #   # | 1  | 2  |
  #   # | 3  | 4  |
  #   data = xlsx file: 'data.xlsx', sheet: 0
  #   {'h1' => [1,3], 'h2' => [2,4]}
  #
  # @option opts file [String]  the file to open. Must end in `.xlsx`. Opens relative to the current directory.
  # @option opts sheet [Integer] (0) The zero-based index of the sheet from which to read.
  # @return [Hash] a hash of arrays based on columns in the spreadsheet
  # @api public
  def xlsx(opts = {})
    opts = Squib::SYSTEM_DEFAULTS.merge(opts)
    opts = Squib::InputHelpers.fileify(opts)
    s    = Roo::Excelx.new(opts[:file])
    s.default_sheet = s.sheets[opts[:sheet]]
    data = {}
    s.first_column.upto(s.last_column) do |col|
      header = s.cell(s.first_row,col).to_s
      data[header] = []
      (s.first_row + 1).upto(s.last_row) do |row|
        cell = s.cell(row,col)
        # Roo hack for avoiding unnecessary .0's on whole integers (https://github.com/roo-rb/roo/issues/139)
        cell = s.excelx_value(row,col) if s.excelx_type(row,col) == [:numeric_or_formula, 'General']
        data[header] << cell
      end#row
    end#col
    data
  end#xlsx
  module_function :xlsx

  # Pulls CSV data from `.csv` files into a column-based hash
  #
  # Pulls the data into a Hash of arrays based on the columns. First row is assumed to be the header row.
  # See the example `samples/csv.rb` in the [source repository](https://github.com/andymeneely/squib/tree/master/samples)
  #
  # @example
  #   # File data.csv looks like this (without the comment symbols)
  #   # h1,h2
  #   # 1,2
  #   # 3,4
  #   data = csv file: 'data.csv'
  #   => {'h1' => [1,3], 'h2' => [2,4]}
  #
  # Parsing uses Ruby's CSV, with options `{headers: true, converters: :numeric}`
  # http://www.ruby-doc.org/stdlib-2.0/libdoc/csv/rdoc/CSV.html
  #
  # @option opts file [String]  the CSV-formatted file to open. Opens relative to the current directory.
  # @return [Hash] a hash of arrays based on columns in the table
  # @api public
  def csv(opts = {})
    opts = Squib::SYSTEM_DEFAULTS.merge(opts)
    opts = Squib::InputHelpers.fileify(opts)
    table = CSV.read(opts[:file], headers: true, converters: :numeric)
    check_duplicate_csv_headers(table)
    hash = Hash.new
    table.headers.each do |header|
      hash[header.to_s] ||= table[header]
    end
    return hash
  end
  module_function :csv

  # Check if the given CSV table has duplicate columns, and throw a warning
  # @api private
  def check_duplicate_csv_headers(table)
    if table.headers.size != table.headers.uniq.size
      dups = table.headers.select{|e| table.headers.count(e) > 1 }
      Squib.logger.warn "CSV duplicated the following column keys: #{dups.join(',')}"
    end
  end
  module_function :check_duplicate_csv_headers

  class Deck

    # Convenience call on deck goes to the module function
    def xlsx(opts = {})
      Squib.xlsx(opts)
    end

    # Convenience call on deck goes to the module function
    def csv(opts = {})
      Squib.csv(opts)
    end

  end
end


text:
package com.lookfirst.wepay.api.req;

import lombok.Data;
import lombok.EqualsAndHashCode;

import com.lookfirst.wepay.api.Transfer;

/**
 * https://stage.wepay.com/developer/reference/disbursement
 *
 * This call allows you to look up the details of a transfer. A transfer is an object that
 * represents the movement of money from a WePay account to an email address.
 *
 * @author Jon Scott Stevens
 * @author Jeff Schnitzer
 */
@Deprecated
@Data
@EqualsAndHashCode(callSuper=false)
public class TransferRequest extends WePayRequest<Transfer> {

	/** Yes	The unique ID of the transfer you want to look up. */
	private String transferId;

	/** */
	@Override
	public String getEndpoint() {
		return "/transfer";
	}
}


text:
using System.IO;

namespace Ojibwe.Common.RestClient.Interfaces
{
    /// <summary>
    /// ISerailizer Interface
    /// </summary>
    public interface ISerializer
    {
        /// <summary>
        /// Seralize Object to Stream
        /// </summary>
        /// <param name="obj">Object to serailize</param>
        /// <param name="stream">Stream to write to</param>
        void Serialize(object obj, Stream stream);
    }
}


text:
.class public Lorg/holoeverywhere/addon/IAddonThemes;
.super Ljava/lang/Object;
.source "IAddonThemes.java"

# interfaces
.implements Lorg/holoeverywhere/ThemeManager$ThemeSetter;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lorg/holoeverywhere/addon/IAddonThemes$ThemeResolver;,
        Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;
    }
.end annotation

# instance fields
.field private mContexts:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Landroid/content/Context;",
            "Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;",
            ">;"
        }
    .end annotation
.end field

.field private mDarkTheme:I

.field private final mDefaultThemeResolver:Lorg/holoeverywhere/addon/IAddonThemes$ThemeResolver;

.field private mLightTheme:I

.field private mMixedTheme:I

.field private final mThemeFlag:I

# direct methods
.method public constructor <init>()V
    .locals 2

    .prologue
    const/4 v1, -0x1

    .line 47
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 25
    iput v1, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mDarkTheme:I

    .line 26
    new-instance v0, Lorg/holoeverywhere/addon/IAddonThemes$1;

    invoke-direct {v0, p0}, Lorg/holoeverywhere/addon/IAddonThemes$1;-><init>(Lorg/holoeverywhere/addon/IAddonThemes;)V

    iput-object v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mDefaultThemeResolver:Lorg/holoeverywhere/addon/IAddonThemes$ThemeResolver;

    .line 41
    iput v1, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mLightTheme:I

    .line 43
    iput v1, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mMixedTheme:I

    .line 48
    invoke-static {}, Lorg/holoeverywhere/ThemeManager;->makeNewFlag()I

    move-result v0

    iput v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mThemeFlag:I

    .line 49
    invoke-static {p0}, Lorg/holoeverywhere/ThemeManager;->registerThemeSetter(Lorg/holoeverywhere/ThemeManager$ThemeSetter;)V

    .line 50
    return-void
.end method

.method static synthetic access$000(Lorg/holoeverywhere/addon/IAddonThemes;)I
    .locals 1
    .param p0, "x0"    # Lorg/holoeverywhere/addon/IAddonThemes;

    .prologue
    .line 13
    iget v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mThemeFlag:I

    return v0
.end method

# virtual methods
.method public context(Landroid/content/Context;)Landroid/content/Context;
    .locals 1
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 53
    sget v0, Lorg/holoeverywhere/ThemeManager;->DARK:I

    invoke-virtual {p0, p1, v0}, Lorg/holoeverywhere/addon/IAddonThemes;->context(Landroid/content/Context;I)Landroid/content/Context;

    move-result-object v0

    return-object v0
.end method

.method public context(Landroid/content/Context;I)Landroid/content/Context;
    .locals 1
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "invalidTheme"    # I

    .prologue
    .line 57
    iget-object v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mDefaultThemeResolver:Lorg/holoeverywhere/addon/IAddonThemes$ThemeResolver;

    invoke-virtual {p0, p1, p2, v0}, Lorg/holoeverywhere/addon/IAddonThemes;->context(Landroid/content/Context;ILorg/holoeverywhere/addon/IAddonThemes$ThemeResolver;)Landroid/content/Context;

    move-result-object v0

    return-object v0
.end method

.method public context(Landroid/content/Context;ILorg/holoeverywhere/addon/IAddonThemes$ThemeResolver;)Landroid/content/Context;
    .locals 3
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "invalidTheme"    # I
    .param p3, "themeResolver"    # Lorg/holoeverywhere/addon/IAddonThemes$ThemeResolver;

    .prologue
    .line 61
    instance-of v2, p1, Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;

    if-eqz v2, :cond_0

    .line 79
    .end local p1    # "context":Landroid/content/Context;
    :goto_0
    return-object p1

    .line 64
    .restart local p1    # "context":Landroid/content/Context;
    :cond_0
    const/4 v1, 0x0

    .line 65
    .local v1, "wrapper":Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;
    iget-object v2, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mContexts:Ljava/util/Map;

    if-eqz v2, :cond_1

    .line 66
    iget-object v2, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mContexts:Ljava/util/Map;

    invoke-interface {v2, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    .end local v1    # "wrapper":Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;
    check-cast v1, Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;

    .line 68
    .restart local v1    # "wrapper":Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;
    :cond_1
    if-nez v1, :cond_4

    .line 69
    invoke-interface {p3, p1, p2}, Lorg/holoeverywhere/addon/IAddonThemes$ThemeResolver;->resolveThemeForContext(Landroid/content/Context;I)I

    move-result v0

    .line 70
    .local v0, "theme":I
    if-gtz v0, :cond_2

    .line 71
    const/4 p1, 0x0

    goto :goto_0

    .line 73
    :cond_2
    new-instance v1, Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;

    .end local v1    # "wrapper":Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;
    invoke-direct {v1, p1, v0}, Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;-><init>(Landroid/content/Context;I)V

    .line 74
    .restart local v1    # "wrapper":Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;
    iget-object v2, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mContexts:Ljava/util/Map;

    if-nez v2, :cond_3

    .line 75
    new-instance v2, Lorg/holoeverywhere/util/WeaklyMap;

    invoke-direct {v2}, Lorg/holoeverywhere/util/WeaklyMap;-><init>()V

    iput-object v2, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mContexts:Ljava/util/Map;

    .line 77
    :cond_3
    iget-object v2, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mContexts:Ljava/util/Map;

    invoke-interface {v2, p1, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .end local v0    # "theme":I
    :cond_4
    move-object p1, v1

    .line 79
    goto :goto_0
.end method

.method public getDarkTheme()I
    .locals 1

    .prologue
    .line 83
    iget v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mDarkTheme:I

    return v0
.end method

.method public getLightTheme()I
    .locals 1

    .prologue
    .line 87
    iget v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mLightTheme:I

    return v0
.end method

.method public getMixedTheme()I
    .locals 1

    .prologue
    .line 91
    iget v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mMixedTheme:I

    return v0
.end method

.method public getThemeFlag()I
    .locals 1

    .prologue
    .line 95
    iget v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mThemeFlag:I

    return v0
.end method

.method public map(III)V
    .locals 0
    .param p1, "darkTheme"    # I
    .param p2, "lightTheme"    # I
    .param p3, "mixedTheme"    # I

    .prologue
    .line 99
    iput p1, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mDarkTheme:I

    .line 100
    iput p2, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mLightTheme:I

    .line 101
    iput p3, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mMixedTheme:I

    .line 102
    invoke-virtual {p0}, Lorg/holoeverywhere/addon/IAddonThemes;->setupThemes()V

    .line 103
    return-void
.end method

.method public setDarkTheme(I)V
    .locals 0
    .param p1, "darkTheme"    # I

    .prologue
    .line 106
    iput p1, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mDarkTheme:I

    .line 107
    invoke-virtual {p0}, Lorg/holoeverywhere/addon/IAddonThemes;->setupThemes()V

    .line 108
    return-void
.end method

.method public setLightTheme(I)V
    .locals 0
    .param p1, "lightTheme"    # I

    .prologue
    .line 111
    iput p1, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mLightTheme:I

    .line 112
    invoke-virtual {p0}, Lorg/holoeverywhere/addon/IAddonThemes;->setupThemes()V

    .line 113
    return-void
.end method

.method public setMixedTheme(I)V
    .locals 0
    .param p1, "mixedTheme"    # I

    .prologue
    .line 116
    iput p1, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mMixedTheme:I

    .line 117
    invoke-virtual {p0}, Lorg/holoeverywhere/addon/IAddonThemes;->setupThemes()V

    .line 118
    return-void
.end method

.method public setupThemes()V
    .locals 2

    .prologue
    .line 122
    iget v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mThemeFlag:I

    sget v1, Lorg/holoeverywhere/ThemeManager;->DARK:I

    or-int/2addr v0, v1

    iget v1, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mDarkTheme:I

    invoke-static {v0, v1}, Lorg/holoeverywhere/ThemeManager;->map(II)V

    .line 123
    iget v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mThemeFlag:I

    sget v1, Lorg/holoeverywhere/ThemeManager;->LIGHT:I

    or-int/2addr v0, v1

    iget v1, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mLightTheme:I

    invoke-static {v0, v1}, Lorg/holoeverywhere/ThemeManager;->map(II)V

    .line 124
    iget v0, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mThemeFlag:I

    sget v1, Lorg/holoeverywhere/ThemeManager;->MIXED:I

    or-int/2addr v0, v1

    iget v1, p0, Lorg/holoeverywhere/addon/IAddonThemes;->mMixedTheme:I

    invoke-static {v0, v1}, Lorg/holoeverywhere/ThemeManager;->map(II)V

    .line 125
    return-void
.end method

.method public unwrap(Landroid/content/Context;)Landroid/content/Context;
    .locals 1
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 128
    if-nez p1, :cond_0

    .line 129
    const/4 v0, 0x0

    .line 134
    :goto_0
    return-object v0

    .line 131
    :cond_0
    :goto_1
    instance-of v0, p1, Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;

    if-eqz v0, :cond_1

    .line 132
    check-cast p1, Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;

    .end local p1    # "context":Landroid/content/Context;
    invoke-virtual {p1}, Lorg/holoeverywhere/addon/IAddonThemes$AddonThemeWrapper;->getBaseContext()Landroid/content/Context;

    move-result-object p1

    .restart local p1    # "context":Landroid/content/Context;
    goto :goto_1

    :cond_1
    move-object v0, p1

    .line 134
    goto :goto_0
.end method


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Sora | Rules</title>

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

    <link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <link href="css/pages/page.css" rel="stylesheet">

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>
          Rules

Home

Rules

Challenge

Join

Leaders and E4

Frontier

Champions

A-Team

Badges

Formats

Hall of Fame

Rules

General rules and conducts that apply to the whole server.

General Rules and Code of Conduct

Keep the Lobby and other chatrooms a positive place for chatting and discussion.

Sora has zero tolerance for sexism, racism, pornography, sexual harassment, and bullying.

If you have evidence of power abuse, contact an Administrator (~) as soon as you can.

As we are not an American based server, the First Amendment does not apply.

Please, no Johns.

Tournament Rules

Changing or amending teams in the middle of battles is prohibited.

Counterteaming in a tournament is prohibited.

Failure to follow these rules will result in the disqualification of the abuser.

Staff Rules

Be respectful to everyone, staff and users alike.

Abuse of power is absolutely not tolerated.

Do not 'test' commands on others, unless given the green light beforehand.

Gym Leaders who do not participate in the monthly Elite Four Promotional Tournament

			will be kicked out of their position. Additionally, no Gym Leader will be eligible for

			Elite 4 promotion unless a certain amount of tournament battles are completed during the month.

Inactivity Clause

Should the league face large amounts of inactivity from the Gym Leaders' front, Frontiers are drafted

			into Gym Leader positions. While drafted into Gym Leaders under the Inactivity Clause, Frontiers have to use

			their Gym Leader accounts, but still keep their position as Frontier, and the rank they held before.

			Frontiers resume their full-time Frontier duties when a new member of the league takes the position they temporarily hold.


text:
const SEED = 999
const NROWS = 128
const N_IDX_TESTS = 16

Random.seed!(SEED)

randdate() = Date(rand(0:4000), rand(1:12), rand(1:27))
randtime() = Dates.Time(rand(0:23), rand(0:59), rand(0:59))
randdatetime() = randdate() + randtime()

randstrings() = String[[randstring(rand(0:20)) for i ∈ 1:(NROWS-1)]; "a"]
function randstrings(::Missing)
    Union{String,Missing}[[rand(Bool) ? missing : randstring(rand(0:20)) for i ∈ 1:(NROWS-1)]; "a"]
end

convstring(str::AbstractString) = String(str)
convstring(::Missing) = missing

io = IOBuffer()

@testset "ArrowTests" begin
df = DataFrame(ints=rand(Int32,NROWS),
               floats=rand(Float64,NROWS),
               dates=Date[randdate() for i ∈ 1:NROWS],
               datetimes=DateTime[randdatetime() for i ∈ 1:NROWS],
               times=Dates.Time[randtime() for i ∈ 1:NROWS],
               missingints=Union{Int64,Missing}[rand(Bool) ? missing : rand(Int64) for i ∈ 1:NROWS],
               strings=randstrings(),
               missingstrings=randstrings(missing),
               catstrings=categorical(randstrings()),
               catstringsmissing=categorical(randstrings(missing))
              )

Feather.write(io, df)

ndf = Feather.read(io)

@test typeof(ndf.ints) == Primitive{Int32}
@test typeof(ndf.floats) == Primitive{Float64}
@test typeof(ndf.dates) == Primitive{Arrow.Datestamp}
@test typeof(ndf.datetimes) == Primitive{Arrow.Timestamp{Dates.Millisecond}}
@test typeof(ndf.times) == Primitive{Arrow.TimeOfDay{Dates.Nanosecond,Int64}}
@test typeof(ndf.missingints) == NullablePrimitive{Int64}
@test typeof(ndf.strings) == List{String,Arrow.DefaultOffset,Primitive{UInt8}}
@test typeof(ndf.missingstrings) == NullableList{String,Arrow.DefaultOffset,Primitive{UInt8}}
@test typeof(ndf.catstrings) == DictEncoding{String,Primitive{Int32},
                                               List{String,Arrow.DefaultOffset,Primitive{UInt8}}}
@test typeof(ndf.catstringsmissing) ==
        DictEncoding{Union{String,Missing},NullablePrimitive{Int32},List{String,Arrow.DefaultOffset,
                                                                         Primitive{UInt8}}}

for j ∈ 1:N_IDX_TESTS
    i = rand(1:NROWS)
    @test df[i, :ints] == ndf[i, :ints]
    @test df[i, :floats] == ndf[i, :floats]
    @test df[i, :dates] == convert(Date, ndf[i, :dates])
    @test df[i, :datetimes] == convert(DateTime, ndf[i, :datetimes])
    @test df[i, :times] == convert(Dates.Time, ndf[i, :times])
    @test df[i, :missingints] ≅ ndf[i, :missingints]
    @test df[i, :strings] == ndf[i, :strings]
    @test df[i, :missingstrings] ≅ ndf[i, :missingstrings]
    @test df[i, :catstrings] == String(ndf[i, :catstrings])
    @test df[i, :catstringsmissing] ≅ convstring(ndf[i, :catstringsmissing])
end
for j ∈ 1:N_IDX_TESTS
    a, b = extrema(rand(1:NROWS, 2))
    i = a:b
    @test df[i, :ints] == ndf[i, :ints]
    @test df[i, :floats] == ndf[i, :floats]
    @test df[i, :dates] == convert.(Date, ndf[i, :dates])
    @test df[i, :datetimes] == convert.(DateTime, ndf[i, :datetimes])
    @test df[i, :times] == convert.(Dates.Time, ndf[i, :times])
    @test df[i, :missingints] ≅ ndf[i, :missingints]
    @test df[i, :strings] == ndf[i, :strings]
    @test df[i, :missingstrings] ≅ ndf[i, :missingstrings]
    @test df[i, :catstrings] == String.(ndf[i, :catstrings])
    @test df[i, :catstringsmissing] ≅ convstring.(ndf[i, :catstringsmissing])
end
for j ∈ 1:N_IDX_TESTS
    i = rand(1:NROWS, rand(1:4))
    @test df[i, :ints] == ndf[i, :ints]
    @test df[i, :floats] == ndf[i, :floats]
    @test df[i, :dates] == convert.(Date, ndf[i, :dates])
    @test df[i, :datetimes] == convert.(DateTime, ndf[i, :datetimes])
    @test df[i, :times] == convert.(Dates.Time, ndf[i, :times])
    @test df[i, :missingints] ≅ ndf[i, :missingints]
    @test df[i, :strings] == ndf[i, :strings]
    @test df[i, :missingstrings] ≅ ndf[i, :missingstrings]
    @test df[i, :catstrings] == String.(ndf[i, :catstrings])
    @test df[i, :catstringsmissing] ≅ convstring.(ndf[i, :catstringsmissing])
end
end

ndf = nothing;
GC.gc()


text:
/*
 * BothFansFromFanBState.hpp
 *
 *  Created on: 23 Sep 2012
 *      Author: rjs
 */

#ifndef BOTHFANSFROMFANB_HPP_
#define BOTHFANSFROMFANB_HPP_

#include <state/bothfansstate.hpp>

class BothFansFromFanBState : public BothFansState {
public:
    BothFansFromFanBState(Controller* ctxt);
    ~BothFansFromFanBState();

	virtual State* transitionHigher();
	virtual State* transitionLower();
	virtual const char* name();
};

#endif /* BOTHFANSFROMFANB_HPP_ */


text:
package org.apache.hyracks.algebricks.rewriter.util;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

import org.apache.commons.lang3.mutable.Mutable;

import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator;
import org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext;
import org.apache.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
import org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable;
import org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.BroadcastExpressionAnnotation;
import org.apache.hyracks.algebricks.core.algebra.expressions.BroadcastExpressionAnnotation.BroadcastSide;
import org.apache.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
import org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
import org.apache.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
import org.apache.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions.ComparisonKind;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractBinaryJoinOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.visitors.LogicalPropertiesVisitor;
import org.apache.hyracks.algebricks.core.algebra.operators.physical.AbstractJoinPOperator.JoinPartitioningType;
import org.apache.hyracks.algebricks.core.algebra.operators.physical.HybridHashJoinPOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.physical.InMemoryHashJoinPOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.physical.NLJoinPOperator;
import org.apache.hyracks.algebricks.core.algebra.properties.ILogicalPropertiesVector;
import org.apache.hyracks.algebricks.core.config.AlgebricksConfig;

public class JoinUtils {

    public static void setJoinAlgorithmAndExchangeAlgo(AbstractBinaryJoinOperator op, IOptimizationContext context)
            throws AlgebricksException {
        List<LogicalVariable> sideLeft = new LinkedList<LogicalVariable>();
        List<LogicalVariable> sideRight = new LinkedList<LogicalVariable>();
        List<LogicalVariable> varsLeft = op.getInputs().get(0).getValue().getSchema();
        List<LogicalVariable> varsRight = op.getInputs().get(1).getValue().getSchema();
        if (isHashJoinCondition(op.getCondition().getValue(), varsLeft, varsRight, sideLeft, sideRight)) {
            BroadcastSide side = getBroadcastJoinSide(op.getCondition().getValue(), varsLeft, varsRight);
            if (side == null) {
                setHashJoinOp(op, JoinPartitioningType.PAIRWISE, sideLeft, sideRight, context);
            } else {
                switch (side) {
                    case RIGHT:
                        setHashJoinOp(op, JoinPartitioningType.BROADCAST, sideLeft, sideRight, context);
                        break;
                    case LEFT:
                        Mutable<ILogicalOperator> opRef0 = op.getInputs().get(0);
                        Mutable<ILogicalOperator> opRef1 = op.getInputs().get(1);
                        ILogicalOperator tmp = opRef0.getValue();
                        opRef0.setValue(opRef1.getValue());
                        opRef1.setValue(tmp);
                        setHashJoinOp(op, JoinPartitioningType.BROADCAST, sideRight, sideLeft, context);
                        break;
                    default:
                        setHashJoinOp(op, JoinPartitioningType.PAIRWISE, sideLeft, sideRight, context);
                }
            }
        } else {
            setNLJoinOp(op, context);
        }
    }

    private static void setNLJoinOp(AbstractBinaryJoinOperator op, IOptimizationContext context) {
        op.setPhysicalOperator(new NLJoinPOperator(op.getJoinKind(), JoinPartitioningType.BROADCAST, context
                .getPhysicalOptimizationConfig().getMaxRecordsPerFrame()));
    }

    private static void setHashJoinOp(AbstractBinaryJoinOperator op, JoinPartitioningType partitioningType,
            List<LogicalVariable> sideLeft, List<LogicalVariable> sideRight, IOptimizationContext context)
            throws AlgebricksException {
        op.setPhysicalOperator(new HybridHashJoinPOperator(op.getJoinKind(), partitioningType, sideLeft, sideRight,
                context.getPhysicalOptimizationConfig().getMaxFramesHybridHash(), context
                        .getPhysicalOptimizationConfig().getMaxFramesLeftInputHybridHash(), context
                        .getPhysicalOptimizationConfig().getMaxRecordsPerFrame(), context
                        .getPhysicalOptimizationConfig().getFudgeFactor()));
        if (partitioningType == JoinPartitioningType.BROADCAST) {
            hybridToInMemHashJoin(op, context);
        }
        // op.setPhysicalOperator(new
        // InMemoryHashJoinPOperator(op.getJoinKind(), partitioningType,
        // sideLeft, sideRight,
        // 1024 * 512));
    }

    private static void hybridToInMemHashJoin(AbstractBinaryJoinOperator op, IOptimizationContext context)
            throws AlgebricksException {
        ILogicalOperator opBuild = op.getInputs().get(1).getValue();
        LogicalPropertiesVisitor.computeLogicalPropertiesDFS(opBuild, context);
        ILogicalPropertiesVector v = context.getLogicalPropertiesVector(opBuild);
        AlgebricksConfig.ALGEBRICKS_LOGGER.fine("// HybridHashJoin inner branch -- Logical properties for " + opBuild
                + ": " + v + "\n");
        if (v != null) {
            int size2 = v.getMaxOutputFrames();
            HybridHashJoinPOperator hhj = (HybridHashJoinPOperator) op.getPhysicalOperator();
            if (size2 > 0 && size2 * hhj.getFudgeFactor() <= hhj.getMemSizeInFrames()) {
                AlgebricksConfig.ALGEBRICKS_LOGGER.fine("// HybridHashJoin inner branch " + opBuild
                        + " fits in memory\n");
                // maintains the local properties on the probe side
                op.setPhysicalOperator(new InMemoryHashJoinPOperator(hhj.getKind(), hhj.getPartitioningType(), hhj
                        .getKeysLeftBranch(), hhj.getKeysRightBranch(), v.getNumberOfTuples() * 2));
            }
        }

    }

    private static boolean isHashJoinCondition(ILogicalExpression e, Collection<LogicalVariable> inLeftAll,
            Collection<LogicalVariable> inRightAll, Collection<LogicalVariable> outLeftFields,
            Collection<LogicalVariable> outRightFields) {
        switch (e.getExpressionTag()) {
            case FUNCTION_CALL: {
                AbstractFunctionCallExpression fexp = (AbstractFunctionCallExpression) e;
                FunctionIdentifier fi = fexp.getFunctionIdentifier();
                if (fi.equals(AlgebricksBuiltinFunctions.AND)) {
                    for (Mutable<ILogicalExpression> a : fexp.getArguments()) {
                        if (!isHashJoinCondition(a.getValue(), inLeftAll, inRightAll, outLeftFields,
                                outRightFields)) {
                            return false;
                        }
                    }
                    return true;
                } else {
                    ComparisonKind ck = AlgebricksBuiltinFunctions.getComparisonType(fi);
                    if (ck != ComparisonKind.EQ) {
                        return false;
                    }
                    ILogicalExpression opLeft = fexp.getArguments().get(0).getValue();
                    ILogicalExpression opRight = fexp.getArguments().get(1).getValue();
                    if (opLeft.getExpressionTag() != LogicalExpressionTag.VARIABLE
                            || opRight.getExpressionTag() != LogicalExpressionTag.VARIABLE) {
                        return false;
                    }
                    LogicalVariable var1 = ((VariableReferenceExpression) opLeft).getVariableReference();
                    if (inLeftAll.contains(var1) && !outLeftFields.contains(var1)) {
                        outLeftFields.add(var1);
                    } else if (inRightAll.contains(var1) && !outRightFields.contains(var1)) {
                        outRightFields.add(var1);
                    } else {
                        return false;
                    }
                    LogicalVariable var2 = ((VariableReferenceExpression) opRight).getVariableReference();
                    if (inLeftAll.contains(var2) && !outLeftFields.contains(var2)) {
                        outLeftFields.add(var2);
                    } else if (inRightAll.contains(var2) && !outRightFields.contains(var2)) {
                        outRightFields.add(var2);
                    } else {
                        return false;
                    }
                    return true;
                }
            }
            default: {
                return false;
            }
        }
    }

    private static BroadcastSide getBroadcastJoinSide(ILogicalExpression e, List<LogicalVariable> varsLeft,
            List<LogicalVariable> varsRight) {
        if (e.getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) {
            return null;
        }
        AbstractFunctionCallExpression fexp = (AbstractFunctionCallExpression) e;
        IExpressionAnnotation ann = fexp.getAnnotations().get(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY);
        if (ann == null) {
            return null;
        }
        BroadcastSide side = (BroadcastSide) ann.getObject();
        if (side == null) {
            return null;
        }
        int i;
        switch (side) {
            case LEFT:
                i = 0;
                break;
            case RIGHT:
                i = 1;
                break;
            default:
                return null;
        }
        ArrayList<LogicalVariable> vars = new ArrayList<LogicalVariable>();
        fexp.getArguments().get(i).getValue().getUsedVariables(vars);
        if (varsLeft.containsAll(vars)) {
            return BroadcastSide.LEFT;
        } else if (varsRight.containsAll(vars)) {
            return BroadcastSide.RIGHT;
        } else {
            return null;
        }
    }
}