text:
package eu.monnetproject.coal.translation;

import eu.monnetproject.lang.Language;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.Collection;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author jmccrae
 */
public class CoalTranslatorService extends HttpServlet {

    private CoalTranslator translator;

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        final ServletContext context = config.getServletContext();
        try {
            translator = new CoalTranslator(new Logger() {
                @Override
                public void log(String message) {
                    context.log(message);
                }

                @Override
                public void log(String message, Throwable t) {
                    context.log(message, t);
                }
            });
        } catch (SQLException x) {
            throw new ServletException(x);
        }
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        final String srcLang = req.getParameter("src");
        final String trgLang = req.getParameter("trg");
        final String label = req.getParameter("label");
        if (srcLang == null || trgLang == null || label == null) {
            resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Required parameters are 'src', 'trg', 'label'");
            return;
        }
        final Collection<TranslationImpl> translations = translator.translate(label, Language.get(srcLang), Language.get(trgLang));
        if (translations.isEmpty()) {
            resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "No translations!");
        } else {
            resp.setContentType("text/plain");
            resp.setCharacterEncoding("UTF-8");
            final PrintWriter out = resp.getWriter();
            for (TranslationImpl translation : translations) {
                out.println(translation.getLabel());
            }
            out.flush();
            out.close();
        }
    }
}


text:
package org.jboss.resteasy.test.cdi.basic;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.resteasy.test.cdi.basic.resource.SingletonLocalIF;
import org.jboss.resteasy.test.cdi.basic.resource.SingletonRootResource;
import org.jboss.resteasy.test.cdi.basic.resource.SingletonSubResource;
import org.jboss.resteasy.test.cdi.basic.resource.SingletonTestBean;
import org.jboss.resteasy.util.HttpResponseCodes;
import org.jboss.resteasy.utils.PortProviderUtil;
import org.jboss.resteasy.utils.TestUtil;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;

/**
 * @tpSubChapter CDI
 * @tpChapter Integration tests
 * @tpTestCaseDetails Test for Singleton beans
 * @tpSince RESTEasy 3.0.16
 */
@RunWith(Arquillian.class)
@RunAsClient
public class SingletonTest {
    static Client client;
    protected static final Logger logger = LogManager.getLogger(SingletonTest.class.getName());

    @BeforeClass
    public static void setup() {
        client = ClientBuilder.newClient();
    }

    @AfterClass
    public static void close() {
        client.close();
    }

    @Deployment
    public static Archive<?> deploy() {
        WebArchive war = TestUtil.prepareArchive(SingletonTest.class.getSimpleName());
        war.addClasses(SingletonLocalIF.class, SingletonSubResource.class,
                SingletonTestBean.class);
        return TestUtil.finishContainerPrepare(war, null, SingletonRootResource.class);
    }

    private String generateURL(String path) {
        return PortProviderUtil.generateURL(path, SingletonTest.class.getSimpleName());
    }

    /**
     * @tpTestDetails Three requests for singleton bean
     * @tpSince RESTEasy 3.0.16
     */
    @Test
    public void testSingleton() throws Exception {
        WebTarget base = client.target(generateURL("/root"));
        String value = base.path("sub").request().get(String.class);
        Assert.assertEquals("Wrong content of response", "hello", value);
        value = base.path("injected").request().get(String.class);
        Assert.assertEquals("Wrong content of response", "true", value);
        value = base.path("intfsub").request().get(String.class);
        logger.info(value);
        Response response = base.path("exception").request().get();
        Assert.assertEquals(HttpResponseCodes.SC_CREATED, response.getStatus());
    }

}

redpajama_set_name: RedPajamaGithub


text:
class QrcodeManager
  attr_reader :token_manager, :photo_name, :url, :height, :width, :size, :level

  # Level can be l, m, q, h
  # Size must be 4..10
  HEIGHT, WIDTH, SIZE, LEVEL = 300, 300, 10, :h

  def initialize( token_manager, photo_name, dimensions='' )
    @token_manager = token_manager
    @photo_name = photo_name

    dimensions = dimensions.to_s.split( ',' )
    @height = ( dimensions[0] || HEIGHT ).to_i
    @width  = ( dimensions[1] || WIDTH ).to_i
    @size   = ( dimensions[2] || SIZE ).to_i
    @level  = ( dimensions[3] || LEVEL ).to_sym

    @url = "#{Rails.configuration.token_url}/#{self.token}"
  end

  def dimensions
    "#{self.height},#{self.width},#{self.size},#{self.level}"
  end

  def self.qrcode_by_token( token )
    raise ArgumentError, 'Token is missing' if token.blank?

    Asset.where( token: token ).first!
  end

  def token
    @token ||= begin
      if @asset = Asset.where( photo_name: self.photo_name ).first
        if self.dimensions == @asset.qrcode_dimensions
          @qrcode_image = @asset.qrcode.data
        end
        self.token_manager.token = @token = @asset.token
      else
        @token = self.token_manager.token
      end
    end
  end

  def qrcode_image
    @qrcode_image ||= begin
      qrcode_image = RQRCode::QRCode.new( self.url, size: self.size, level: self.level ).to_img
      qrcode_image.resize( self.height, self.width )
    end
  end
end


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>io.github.stevecrox</groupId>
    <artifactId>mirror-parent</artifactId>
    <version>0.0.2-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>Mirror Import  Tool</name>

    <properties>
        <!-- Maven Build Plug-in Versions, set as properties so they can be over ridden as required. -->
        <org.apache.maven.version>3.8.6</org.apache.maven.version>
        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
        <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
        <maven-site-plugin.version>4.0.0-M2</maven-site-plugin.version>

        <!-- Maven build Packaging plugins. -->
        <maven-ear-plugin.version>2.9</maven-ear-plugin.version>
        <maven-ejb-plugin.version>2.3</maven-ejb-plugin.version>
        <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
        <maven-rar-plugin.version>2.3</maven-rar-plugin.version>
        <maven-war-plugin.version>3.3.2</maven-war-plugin.version>
        <maven-shade-plugin.version>3.3.0</maven-shade-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
        <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>3.0.0-M7</maven-failsafe-plugin.version>
        <maven-release-plugin.version>3.0.0-M6</maven-release-plugin.version>

        <!-- Maven Code Analysis -->
        <maven-changelog-plugin.version>2.3</maven-changelog-plugin.version>
        <maven-checkstyle-plugin.version>2.15</maven-checkstyle-plugin.version>
        <maven-dependency-plugin.version>2.10</maven-dependency-plugin.version>
        <maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
        <maven-jxr-plugin.version>3.2.0</maven-jxr-plugin.version>
        <maven-pmd-plugin.version>3.17.0</maven-pmd-plugin.version>
        <maven-project-info-reports-plugin.version>3.3.0</maven-project-info-reports-plugin.version>
        <maven-surefire-report-plugin.version>3.0.0-M7</maven-surefire-report-plugin.version>
        <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
        <findbugs-maven-plugin.version>3.0.5</findbugs-maven-plugin.version>
        <javancss-maven-plugin.version>2.1</javancss-maven-plugin.version>
        <checksum-maven-plugin.version>1.11</checksum-maven-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>

        <!-- Compiler settings, lets you tweak what JDK you are using as needed. -->
        <project.build.sourceVersion>1.8</project.build.sourceVersion>
        <project.build.targetVersion>1.8</project.build.targetVersion>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.targetEncoding>ISO-8859-1</project.build.targetEncoding>

        <!-- Gives Ability to skip specific plugins and stages. -->
        <project.build.skip.maven-site-plugin>false</project.build.skip.maven-site-plugin>
        <project.build.skip.deploy.maven-site-plugin>false</project.build.skip.deploy.maven-site-plugin>
        <project.build.skip.maven-source-plugin>false</project.build.skip.maven-source-plugin>

        <!-- Maven Site directory settings. -->
        <project.build.site.directory>${project.basedir}/src/site</project.build.site.directory>
        <!-- Should we fail if an error is detected. -->
        <project.analyse.fail.on.error>false</project.analyse.fail.on.error>
        <project.analyse.fail.on.error.maven-changelog-plugin>${project.analyse.fail.on.error}</project.analyse.fail.on.error.maven-changelog-plugin>
        <project.analyse.fail.on.error.maven-checkstyle-plugin>${project.analyse.fail.on.error}</project.analyse.fail.on.error.maven-checkstyle-plugin>
        <project.analyse.fail.on.error.maven-javadoc-plugin>${project.analyse.fail.on.error}</project.analyse.fail.on.error.maven-javadoc-plugin>
        <project.analyse.fail.on.error.findbugs-maven-plugin>${project.analyse.fail.on.error}</project.analyse.fail.on.error.findbugs-maven-plugin>

        <!-- Gives Ability to skip specific plugins and stages. -->
        <project.analyse.skip>false</project.analyse.skip>
        <maven.analysis.include.tests>false</maven.analysis.include.tests>
        <project.analyse.skip.maven-changelog-plugin>${project.analyse.skip}</project.analyse.skip.maven-changelog-plugin>
        <project.analyse.skip.maven-checkstyle-plugin>${project.analyse.skip}</project.analyse.skip.maven-checkstyle-plugin>
        <project.analyse.skip.maven-javadoc-plugin>${project.analyse.skip}</project.analyse.skip.maven-javadoc-plugin>
        <project.analyse.skip.maven-pmd-plugin>${project.analyse.skip}</project.analyse.skip.maven-pmd-plugin>
        <project.analyse.skip.maven-jxr-plugin>${project.analyse.skip}</project.analyse.skip.maven-jxr-plugin>
        <project.analyse.skip.maven-project-info-reports-plugin>${project.analyse.skip}</project.analyse.skip.maven-project-info-reports-plugin>
        <project.analyse.skip.maven-surefire-report-plugin>${project.analyse.skip}</project.analyse.skip.maven-surefire-report-plugin>
        <project.analyse.skip.findbugs-maven-plugin>${project.analyse.skip}</project.analyse.skip.findbugs-maven-plugin>

        <!-- Dependency Management -->
        <commons-io.version>2.11.0</commons-io.version>
        <org.apache.activemq.version>5.16.5</org.apache.activemq.version>
        <org.apache.camel.version>3.17.0</org.apache.camel.version>
        <org.slf4j.version>2.0.0-alpha7</org.slf4j.version>
    </properties>

    <developers>
        <developer>
            <name>Stephen Crocker</name>
            <email>stevecrox@hotmail.com</email>
            <organization>Crox</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>
    <organization>
        <name>Crox</name>
    </organization>

    <scm>
        <connection>scm:git:https://github.com/stevecrox/maven_mirror_tool.git</connection>
        <developerConnection>scm:git:https://github.com/stevecrox/maven_mirror_tool.git</developerConnection>
        <url>https://github.com/stevecrox/maven_mirror_tool</url>
      <tag>HEAD</tag>
  </scm>

    <build>
        <pluginManagement>
            <plugins>
                <!-- ********************************************************************************************* Maven Core Plugins ********************************************************************************************* -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${project.build.sourceVersion}</source>
                        <target>${project.build.targetVersion}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <!-- Added so CI's like Jenkins can scan the console for warnings. -->
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <!-- Added to stop the compiler from including build artifacts/project data. -->
                        <excludes>
                            <exclude>**/bin/**/*.*</exclude>
                            <exclude>**/.settings/**/*.*</exclude>
                            <exclude>**/target/**/*.*</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${project.build.sourceVersion}</source>
                        <target>${project.build.targetVersion}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <!-- Added so CI's like Jenkins can scan the console for warnings. -->
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <!-- Added to stop the compiler from including build artifacts/project data. -->
                        <excludes>
                            <exclude>**/bin/**/*.*</exclude>
                            <exclude>**/.settings/**/*.*</exclude>
                            <exclude>**/target/**/*.*</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin.version}</version>
                    <configuration>
                        <!-- Set to improve performance. -->
                        <followSymLinks>true</followSymLinks>
                    </configuration>
                </plugin>
                 <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-failsafe-plugin.version}</version>
                    <configuration>
                        <forkCount>1.5C</forkCount>
                        <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
                        <reuseForks>false</reuseForks>
                        <includes>
                            <include>**/*IntegrationTest*</include>
                            <include>**/*TestIntegration*</include>
                        </includes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <forkCount>1.5C</forkCount>
                        <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
                        <reuseForks>false</reuseForks>
                        <excludes>
                            <exclude>**/*Integration*</exclude>
                        </excludes>
                        <includes>
                            <include>**/*Test*</include>
                            <include>**/*Test*</include>
                        </includes>
                    </configuration>
                </plugin>
                <!-- ********************************************************************************************* Maven Packaing Plugins ********************************************************************************************* -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                    <configuration>
                        <skipIfEmpty>true</skipIfEmpty>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>${maven-war-plugin.version}</version>
                    <configuration>
                        <!-- Matches the EAR default location. -->
                        <warSourceDirectory>${project.basedir}/src/main/application</warSourceDirectory>
                        <includeEmptyDirectories>true</includeEmptyDirectories>
                        <webXml>${project.basedir}/src/main/application/WEB-INF/web.xml</webXml>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin.version}</version>
                    <configuration>
                        <createDependencyReducedPom>true</createDependencyReducedPom>
                        <createSourcesJar>true</createSourcesJar>
                        <shadedArtifactAttached>true</shadedArtifactAttached>
                        <shadeTestJar>true</shadeTestJar>
                        <shadedClassifierName>shade</shadedClassifierName>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                    <configuration>
                        <attach>true</attach>
                        <includePom>true</includePom>
                        <skipSource>${project.build.skip.maven-source-plugin}</skipSource>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                    <configuration>

                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <configuration>
                        <gpgArguments>
                            <arg>--pinentry-mode</arg>
                            <arg>loopback</arg>
                        </gpgArguments>
                    </configuration>
                </plugin>
                <!-- ********************************************************************************************* Maven Analysis Plugins ********************************************************************************************* -->
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>${findbugs-maven-plugin.version}</version>
                    <configuration>
                        <skip>${project.analyse.skip.findbugs-maven-plugin}</skip>
                        <failOnError>${project.analyse.fail.on.error.findbugs-maven-plugin}</failOnError>
                        <effort>Max</effort>
                        <formats>
                            <format>html</format>
                            <format>xml</format>
                        </formats>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-changelog-plugin</artifactId>
                    <version>${maven-changelog-plugin.version}</version>
                    <configuration>
                        <skip>${project.analyse.skip.maven-changelog-plugin}</skip>
                        <outputEncoding>${project.build.targetEncoding}</outputEncoding>
                        <connectionType>developerConnection</connectionType>
                        <scmUrl>${project.scm.developerConnection}</scmUrl>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <skip>${project.analyse.skip.maven-javadoc-plugin}</skip>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <serialwarn>true</serialwarn>
                        <source>${project.build.targetVersion}</source>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jxr-plugin</artifactId>
                    <version>${maven-jxr-plugin.version}</version>
                    <configuration>
                        <skip>${project.analyse.skip.maven-jxr-plugin}</skip>
                        <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
                        <outputEncoding>${project.build.targetEncoding}</outputEncoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>${maven-pmd-plugin.version}</version>
                    <configuration>
                        <skip>${project.analyse.skip.maven-pmd-plugin}</skip>
                        <aggregate>true</aggregate>
                        <format>xml</format>
                        <minimumPriority>1</minimumPriority>
                        <outputEncoding>${project.build.targetEncoding}</outputEncoding>
                        <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
                        <targetJdk>${project.build.targetVersion}</targetJdk>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven-project-info-reports-plugin.version}</version>
                    <configuration>
                        <skip>${project.analyse.skip.maven-project-info-reports-plugin}</skip>
                        <anonymousConnection>${project.scm.connection}</anonymousConnection>
                        <developerConnection>${project.scm.developerConnection}</developerConnection>
                        <webAccessUrl>${project.scm.url}</webAccessUrl>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>${maven-surefire-report-plugin.version}</version>
                    <configuration>
                        <skipSurefireReport>${project.analyse.skip.maven-surefire-report-plugin}</skipSurefireReport>
                        <aggregate>true</aggregate>
                        <alwaysGenerateSurefireReport>true</alwaysGenerateSurefireReport>
                    </configuration>
                </plugin>
                <!-- ********************************************************************************************* Maven Site Plugin ********************************************************************************************* -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin.version}</version>
                    <configuration>
                        <attach>true</attach>
                        <chmod>true</chmod>
                        <generateSitemap>true</generateSitemap>
                        <generateProjectInfo>true</generateProjectInfo>
                        <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
                        <outputEncoding>${project.build.targetEncoding}</outputEncoding>
                        <pomPackagingOnly>false</pomPackagingOnly>
                        <siteDirectory>${project.build.site.directory}</siteDirectory>
                        <validate>false</validate>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
                            <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-changelog-plugin</artifactId>
                                <version>${maven-changelog-plugin.version}</version>
                            </plugin>
                            <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-javadoc-plugin</artifactId>
                                <version>${maven-javadoc-plugin.version}</version>
                            </plugin>
                            <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-jxr-plugin</artifactId>
                                <version>${maven-jxr-plugin.version}</version>
                            </plugin>
                            <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-pmd-plugin</artifactId>
                                <version>${maven-pmd-plugin.version}</version>
                            </plugin>
                            <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-project-info-reports-plugin</artifactId>
                                <version>${maven-project-info-reports-plugin.version}</version>
                            </plugin>
                            <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-surefire-report-plugin</artifactId>
                                <version>${maven-surefire-report-plugin.version}</version>
                            </plugin>
        </plugins>
    </reporting>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-camel</artifactId>
                <version>${org.apache.activemq.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-pool</artifactId>
                <version>${org.apache.activemq.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-core</artifactId>
                <version>${org.apache.camel.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-core-model</artifactId>
                <version>${org.apache.camel.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-main</artifactId>
                <version>${org.apache.camel.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-csv</artifactId>
                <version>${org.apache.camel.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-jms</artifactId>
                <version>${org.apache.camel.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>${org.apache.maven.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-model</artifactId>
                <version>${org.apache.maven.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-artifact</artifactId>
                <version>${org.apache.maven.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${org.slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${org.slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.1</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <distributionManagement>
        <snapshotRepository>
            <id>snapshots</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>main</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>fast</id>
            <properties>
                <project.build.skip.maven-source-plugin>true</project.build.skip.maven-source-plugin>
                <project.build.skip.maven-surefire-plugin>true</project.build.skip.maven-surefire-plugin>
            </properties>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.nicoulaj.maven.plugins</groupId>
                        <artifactId>checksum-maven-plugin</artifactId>
                        <version>${checksum-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>source-release-checksum</id>
                                <goals>
                                    <goal>artifacts</goal>
                                </goals>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <algorithms>
                                        <algorithm>SHA-512</algorithm>
                                    </algorithms>
                                    <includeClassifiers>source-release</includeClassifiers>
                                    <excludeMainArtifact>true</excludeMainArtifact>
                                    <csvSummary>false</csvSummary>
                                    <attachChecksums>true</attachChecksums>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <modules>
        <module>mirror-common</module>
        <module>mirror-processors-common</module>
        <module>mirror-maven-common</module>
        <module>mirror-processors-csv-ingest</module>
        <module>mirror-processors-download-artifact</module>
        <module>mirror-processors-generate-artifact</module>
        <module>mirror-processors-manifest-maven</module>
        <module>mirror-runnable-jar</module>

    </modules>
</project>


text:
module SpreeSermepa
  module Generators
    class InstallGenerator < Rails::Generators::Base

      def add_javascripts
        append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_sermepa\n"
        append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_sermepa\n"
      end

      def add_stylesheets
        inject_into_file 'app/assets/stylesheets/store/all.css', " *= require store/spree_sermepa\n", :before => /\*\//, :verbose => true
        inject_into_file 'app/assets/stylesheets/admin/all.css', " *= require admin/spree_sermepa\n", :before => /\*\//, :verbose => true
      end

      def add_migrations
        run 'bundle exec rake railties:install:migrations FROM=spree_sermepa'
      end

      def run_migrations
         res = ask 'Would you like to run the migrations now? [Y/n]'
         if res == '' || res.downcase == 'y'
           run 'bundle exec rake db:migrate'
         else
           puts 'Skipping rake db:migrate, don\'t forget to run it!'
         end
      end
    end
  end
end


text:
package com.wannabe.smartsearch.utils;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.FileIndexFacade;
import com.intellij.openapi.util.Computable;
import com.intellij.psi.PsiClass;
import com.intellij.psi.search.ProjectScopeImpl;

import java.util.Collection;
import java.util.Set;
import java.util.function.Supplier;

import static com.intellij.openapi.application.ApplicationManager.getApplication;
import static com.intellij.psi.search.searches.AllClassesSearch.search;
import static java.util.stream.Collectors.toSet;

/**
 * Created by wannabe on 10.02.16.
 */
public class GetClassNamesFunction implements Supplier<Collection<String>> {

    private final Project project;

    public GetClassNamesFunction(Project project) {
        this.project = project;
    }

    @Override
    public Set<String> get() {
        return getApplication().runReadAction((Computable<Set<String>>) () ->
                search(new ProjectScopeImpl(project, FileIndexFacade.getInstance(project)), project)
                        .findAll()
                        .stream()
                        .map(PsiClass::getQualifiedName)
                        .collect(toSet()));
    }
}


text:
/**
 * $.rateLimit is a wrapper for a function to ensure the method is not
 * called more than every [rate]ms. No calls will be dropped, and a
 * $.Deferred is returned for the caller to hold on to requests.
 *
 * $.rateLimit plays nicely with $.ajax, allowing access to .abort()
 * and the actual xhr through .xhr
 *
 * Loosely based off of https://gist.github.com/1084831
 *
 * Parameters:
 *   func: function to rate limit
 *   rate: rate to limit at in ms
 *   opts: optional options:
 *         - async: whether to wait until the function is completed executing
 *                  before starting up the next one
 *         - abortedResopnse: object to return to failure handler on abort
 *
 * To use:
 *   // To call fn once every second:
 *   var fn = function () {};
 *   var rateLimitedFn = $.rateLimit(fn, 1000);
 *
 */
$.rateLimit = function (func, rate, opts) {
  var queue = [];
  var currentlyEmptyingQueue = false;

  // default options
  opts = $.extend({
    async: false,
    abortedResponse: {
      statusText: 'abort'
    }
  }, opts);

  // execute an individual request
  var executeReq = function (req) {
    var r = req.fn.apply(req.scope, req.args);
    var proxy = req.promise;
    if (r.promise) {
      proxy.xhr = r;
      proxy.abort = r.abort;
      r.then(proxy.resolve, proxy.reject);
    } else {
      proxy.resolve(r);
    }
  };

  // handle next item in the queue
  var emptyQueue = function () {
    if (queue.length > 0) {
      // if queue has contents, check each request 1 by 1,
      // inserting a delay in between valid requests
      currentlyEmptyingQueue = true;
      var req = queue.shift();
      if (req.promise._aborted) {
        // if request is aborted, go to next one
        emptyQueue();
      } else {
        // otherwise, start up the request
        if (opts.async) {
          setTimeout(function () { executeReq(req); }, 0);
        } else {
          executeReq(req);
        }

        // wait rate limit before starting up the next one
        setTimeout(emptyQueue, rate);
      }
    } else {
      // if queue is empty, we're not emptying it
      currentlyEmptyingQueue = false;
    }
  };

  // abort/set aborted flag on request
  var abort = function () {
    this._aborted = true;
    this.reject(opts.abortedResponse);
  };

  return function () {
    // create deferred and setup promise
    var deferred = $.Deferred();
    deferred.abort = $.proxy(abort, deferred);

    // create request
    var req = {
      fn: func,
      scope: this,
      args: arguments,
      promise: deferred
    };

    // push request onto queue
    queue.push(req);

    // empty queue if we're not running already
    if (!currentlyEmptyingQueue) emptyQueue();

    // return promise
    return deferred;
  };
};


text:
package vnmr.cryo;

public class CryoConstants {
    public static final String EXCEL_DATES = "excelDates";
    public static final String EXCEL_DATES_LOCAL = "excelDatesLocal";
    public static final String UNIX_DATES = "unixDates";
    public static final String STRING_DATES = "stringDates";
    public static final String STRING_DATES_LOCAL = "stringDatesLocal";

//    //Strings
//    private static final String CMD_START = "<READY>";
//    private static final String CMD_STOP = "<STOP>";
//    private static final String CMD_DETACH = "<REMOVE>";
//    private static final String CMD_CONNECT = "connect";
//    private static final String CMD_INFO = "info";
//
//    private static final String CMD_CRYOCON = "SEND_CRYOCON";
//    private static final String CMD_RABBIT = "SEND_RABBIT";
//    private static final String CMD_VACPURGE = "<V_PURGE>";
//    private static final String CMD_PUMPPROBE = "<V_PROBE>";
//    private static final String CMD_THERMCYCLE = "<THERMALCYCLE>";
//
//    private static final String CMD_VERN = "<VN>";
//    //private static final String CMD_CAL = "<C_CAL>";
//    private static final String PROBE_CONFIG = "probeConfig";
//    private static final String FW_CONFIG = "firmwareConfig";
//    private static final String CRYO_CONFIG = "cryobay";
//    private static final String TC_CONFIG = "temperaturecontroller";
//    private static final String ADVANCED = "advanced";
//    //private static final String ABOUT_CRYO = "<VN>";
//    private static final String ABOUT_COMP = "<GM_HOURS>";
//    private static final String ABOUT_CONT = "cryocontrols";
//    private static final String PANEL_VERN = "1.8";
//    private static final String CLOSE_COMMAND = "Close";
//    private static final String UPLOAD_FILE_NAME = "UploadPath";
//    private static final String UPLOAD_FILE_NAME_AUTO = "UploadAutoName";

}


text:
[![Gem Version](https://badge.fury.io/rb/immobilienscout24.svg)](http://badge.fury.io/rb/immobilienscout24)
[![Build Status](https://travis-ci.org/converate-consulting-group/immobilienscout24.svg?branch=master)](https://travis-ci.org/converate-consulting-group/immobilienscout24)
[![Dependency Status](https://gemnasium.com/converate-consulting-group/immobilienscout24.svg)](https://gemnasium.com/converate-consulting-group/immobilienscout24)

A Ruby wrapper for the Immobilienscout24 REST API. This wrapper has all the important parts for the import and export of real estates from and to Immobilienscout24.

Complete API's:

* Attachment
* Contact
* Publish
* RealEstate
* User

Incomplete:

* Search
* Expose
* Geo Services
* Product Valuation Services
* Realtor
* Construction Financing Lead engine API

In the spirit of free software, everyone is encouraged to help improve this project.

## Quick start

Add this line to your application's Gemfile:

    gem 'immobilienscout24'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install immobilienscout24

API methods are available from the `Immobilienscout24.client`.

```ruby
# Provide authentication credentials
Immobilienscout24.configure do |config|
  config.consumer_key = 'your_consumer_key'
  config.consumer_secret = 'your_consumer_secret'
end

# Fetch your real estates
immoscout_client = Immobilienscout24.client(token: 'your_oauth_token', token_secret: 'your_oauth_token_secret')
immoscout_client.real_estates
```

For the oauth process you can use the excellent [omniauth-immobilienscout24][oauthgem] gem.

[oauthgem]: https://github.com/endil/omniauth-immobilienscout24

### Consuming resources

Most methods return a [Hashie::Mash][hashie] object which provides dot notation and `[]` access for fields returned in the API response.

[hashie]: https://github.com/intridea/hashie#mash

```ruby
# Fetch the real estates
real_estates = immoscout_client.real_estates

# Sorry, we haven't invented the Immobilienscout24 response...
real_estates = real_estates["realestates.realEstates"].realEstateList.realEstateElement

# Iterate over results
real_estates.each do |real_estate|
  puts real_estate.title
  # etc.
end
```

### Creating / Updating resources

The creation / modification of resources follows one simple rule: If you make JSON requests then the object that you send via the api has to respond to `to_json`. If you make XML requests then it has to respond to `to_xml`.

```ruby
# Wrapper class for our request
class ImmoscoutEstate

  def to_json
    # generates the json for
    # the real estate that you want to create / update
  end

end

immoscout_estate = ImmoscoutEstate.new

# `to_json` will be called on the immoscout_estate object
immoscout_client.create_real_estate(immoscout_estate)
```

### Configuration

For a basic configuration you just enter your `consumer_key` and `consumer_secret`.

```ruby
Immobilienscout24.configure do |config|
  config.consumer_key = 'your_consumer_key'
  config.consumer_secret = 'your_consumer_secret'
end

# If you want to use the sandbox
config.sandbox = true

# If you want to generate a log file
config.faraday_logger = [:logger, Logger.new('log/immobilienscout24.log')]

# If you want to use xml
config.request_strategy = Immobilienscout24::Api::Request::Xml
```

There are more advanced configuration options. Take a look at `Immobilienscout24::Configuration`.

### Rails integration

Take a look at the [wiki][wiki].

[wiki]: https://github.com/converate-consulting-group/immobilienscout24/wiki/Useful-notes

## Contributing

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

## TODO

* Extend API
* Write more tests


text:
<?php

namespace Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier;

use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
use Magento\Catalog\Model\Locator\LocatorInterface;
use Magento\Downloadable\Model\Product\Type;
use Magento\Downloadable\Model\Source\TypeUpload;
use Magento\Downloadable\Model\Source\Shareable;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\Stdlib\ArrayManager;
use Magento\Ui\Component\DynamicRows;
use Magento\Framework\UrlInterface;
use Magento\Ui\Component\Container;
use Magento\Ui\Component\Form;

/**
 * Class adds a grid with links
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 */
class Links extends AbstractModifier
{
    /**
     * @var LocatorInterface
     */
    protected $locator;

    /**
     * @var StoreManagerInterface
     */
    protected $storeManager;

    /**
     * @var ArrayManager
     */
    protected $arrayManager;

    /**
     * @var TypeUpload
     */
    protected $typeUpload;

    /**
     * @var Shareable
     */
    protected $shareable;

    /**
     * @var Data\Links
     */
    protected $linksData;

    /**
     * @var UrlInterface
     */
    protected $urlBuilder;

    /**
     * @param LocatorInterface $locator
     * @param StoreManagerInterface $storeManager
     * @param ArrayManager $arrayManager
     * @param UrlInterface $urlBuilder
     * @param TypeUpload $typeUpload
     * @param Shareable $shareable
     * @param Data\Links $linksData
     */
    public function __construct(
        LocatorInterface $locator,
        StoreManagerInterface $storeManager,
        ArrayManager $arrayManager,
        UrlInterface $urlBuilder,
        TypeUpload $typeUpload,
        Shareable $shareable,
        Data\Links $linksData
    ) {
        $this->locator = $locator;
        $this->storeManager = $storeManager;
        $this->arrayManager = $arrayManager;
        $this->urlBuilder = $urlBuilder;
        $this->typeUpload = $typeUpload;
        $this->shareable = $shareable;
        $this->linksData = $linksData;
    }

    /**
     * {@inheritdoc}
     */
    public function modifyData(array $data)
    {
        $model = $this->locator->getProduct();

        $data[$model->getId()][self::DATA_SOURCE_DEFAULT]['links_title'] = $this->linksData->getLinksTitle();
        $data[$model->getId()][self::DATA_SOURCE_DEFAULT]['links_purchased_separately']
            = $this->linksData->isProductLinksCanBePurchasedSeparately() ? '1' : '0';
        $data[$model->getId()]['downloadable']['link'] = $this->linksData->getLinksData();

        return $data;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function modifyMeta(array $meta)
    {
        $linksPath = Composite::CHILDREN_PATH . '/' . Composite::CONTAINER_LINKS;
        $linksContainer['arguments']['data']['config'] = [
            'componentType' => Form\Fieldset::NAME,
            'additionalClasses' => 'admin__fieldset-section',
            'label' => __('Links'),
            'dataScope' => '',
            'visible' => $this->locator->getProduct()->getTypeId() === Type::TYPE_DOWNLOADABLE,
            'sortOrder' => 30,
        ];
        $linksTitle['arguments']['data']['config'] = [
            'componentType' => Form\Field::NAME,
            'formElement' => Form\Element\Input::NAME,
            'dataType' => Form\Element\DataType\Text::NAME,
            'label' => __('Title'),
            'dataScope' => 'product.links_title',
            'scopeLabel' => $this->storeManager->isSingleStoreMode() ? '' : '[STORE VIEW]',
        ];
        $linksPurchasedSeparately['arguments']['data']['config'] = [
            'componentType' => Form\Field::NAME,
            'formElement' => Form\Element\Checkbox::NAME,
            'dataType' => Form\Element\DataType\Number::NAME,
            'description' => __('Links can be purchased separately'),
            'label' => ' ',
            'dataScope' => 'product.links_purchased_separately',
            'scopeLabel' => $this->storeManager->isSingleStoreMode() ? '' : '[GLOBAL]',
            'valueMap' => [
                'false' => '0',
                'true' => '1',
            ],
        ];
        // @codingStandardsIgnoreStart
        $informationLinks['arguments']['data']['config'] = [
            'componentType' => Container::NAME,
            'component' => 'Magento_Ui/js/form/components/html',
            'additionalClasses' => 'admin__fieldset-note',
            'content' => __('Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_\'.'),
        ];
        // @codingStandardsIgnoreEnd

        $linksContainer = $this->arrayManager->set(
            'children',
            $linksContainer,
            [
                'links_title' => $linksTitle,
                'links_purchased_separately' => $linksPurchasedSeparately,
                'link' => $this->getDynamicRows(),
                'information_links' => $informationLinks,
            ]
        );

        return $this->arrayManager->set($linksPath, $meta, $linksContainer);
    }

    /**
     * @return array
     */
    protected function getDynamicRows()
    {
        $dynamicRows['arguments']['data']['config'] = [
            'addButtonLabel' => __('Add Link'),
            'componentType' => DynamicRows::NAME,
            'itemTemplate' => 'record',
            'renderDefaultRecord' => false,
            'columnsHeader' => true,
            'additionalClasses' => 'admin__field-wide',
            'dataScope' => 'downloadable',
            'deleteProperty' => 'is_delete',
            'deleteValue' => '1',
        ];

        return $this->arrayManager->set('children/record', $dynamicRows, $this->getRecord());
    }

    /**
     * @return array
     */
    protected function getRecord()
    {
        $record['arguments']['data']['config'] = [
            'componentType' => Container::NAME,
            'isTemplate' => true,
            'is_collection' => true,
            'component' => 'Magento_Ui/js/dynamic-rows/record',
            'dataScope' => '',
        ];
        $recordPosition['arguments']['data']['config'] = [
            'componentType' => Form\Field::NAME,
            'formElement' => Form\Element\Input::NAME,
            'dataType' => Form\Element\DataType\Number::NAME,
            'dataScope' => 'sort_order',
            'visible' => false,
        ];
        $recordActionDelete['arguments']['data']['config'] = [
            'label' => null,
            'componentType' => 'actionDelete',
            'fit' => true,
        ];

        return $this->arrayManager->set(
            'children',
            $record,
            [
                'container_link_title' => $this->getTitleColumn(),
                'container_link_price' => $this->getPriceColumn(),
                'container_file' => $this->getFileColumn(),
                'container_sample' => $this->getSampleColumn(),
                'is_shareable' => $this->getShareableColumn(),
                'max_downloads' => $this->getMaxDownloadsColumn(),
                'position' => $recordPosition,
                'action_delete' => $recordActionDelete,
            ]
        );
    }

    /**
     * @return array
     */
    protected function getTitleColumn()
    {
        $titleContainer['arguments']['data']['config'] = [
            'componentType' => Container::NAME,
            'formElement' => Container::NAME,
            'component' => 'Magento_Ui/js/form/components/group',
            'label' => __('Title'),
            'dataScope' => '',
        ];
        $titleField['arguments']['data']['config'] = [
            'formElement' => Form\Element\Input::NAME,
            'componentType' => Form\Field::NAME,
            'dataType' => Form\Element\DataType\Text::NAME,
            'dataScope' => 'title',
            'validation' => [
                'required-entry' => true,
            ],
        ];

        return $this->arrayManager->set('children/link_title', $titleContainer, $titleField);
    }

    /**
     * @return array
     */
    protected function getPriceColumn()
    {
        $priceContainer['arguments']['data']['config'] = [
            'componentType' => Container::NAME,
            'formElement' => Container::NAME,
            'component' => 'Magento_Ui/js/form/components/group',
            'label' => __('Price'),
            'dataScope' => '',
        ];
        $priceField['arguments']['data']['config'] = [
            'formElement' => Form\Element\Input::NAME,
            'componentType' => Form\Field::NAME,
            'dataType' => Form\Element\DataType\Number::NAME,
            'component' => 'Magento_Downloadable/js/components/price-handler',
            'dataScope' => 'price',
            'addbefore' => $this->locator->getStore()->getBaseCurrency()
                ->getCurrencySymbol(),
            'validation' => [
                'validate-zero-or-greater' => true,
            ],
            'imports' => [
                'linksPurchasedSeparately' => '${$.provider}:data.product'
                    . '.links_purchased_separately',
                'useDefaultPrice' => '${$.parentName}.use_default_price:checked'
            ],
        ];

        return $this->arrayManager->set('children/link_price', $priceContainer, $priceField);
    }

    /**
     * @return array
     */
    protected function getFileColumn()
    {
        $fileContainer['arguments']['data']['config'] = [
            'componentType' => Container::NAME,
            'formElement' => Container::NAME,
            'component' => 'Magento_Ui/js/form/components/group',
            'label' => __('File'),
            'dataScope' => '',
        ];
        $fileTypeField['arguments']['data']['config'] = [
            'formElement' => Form\Element\Select::NAME,
            'componentType' => Form\Field::NAME,
            'component' => 'Magento_Downloadable/js/components/upload-type-handler',
            'dataType' => Form\Element\DataType\Text::NAME,
            'dataScope' => 'type',
            'options' => $this->typeUpload->toOptionArray(),
            'typeFile' => 'links_file',
            'typeUrl' => 'link_url',
        ];
        $fileLinkUrl['arguments']['data']['config'] = [
            'formElement' => Form\Element\Input::NAME,
            'componentType' => Form\Field::NAME,
            'dataType' => Form\Element\DataType\Text::NAME,
            'dataScope' => 'link_url',
            'placeholder' => 'URL',
            'validation' => [
                'required-entry' => true,
                'validate-url' => true,
            ],
        ];
        $fileUploader['arguments']['data']['config'] = [
            'formElement' => 'fileUploader',
            'componentType' => 'fileUploader',
            'component' => 'Magento_Downloadable/js/components/file-uploader',
            'elementTmpl' => 'Magento_Downloadable/components/file-uploader',
            'fileInputName' => 'links',
            'uploaderConfig' => [
                'url' => $this->urlBuilder->addSessionParam()->getUrl(
                    'adminhtml/downloadable_file/upload',
                    ['type' => 'links', '_secure' => true]
                ),
            ],
            'dataScope' => 'file',
            'validation' => [
                'required-entry' => true,
            ],
        ];

        return $this->arrayManager->set(
            'children',
            $fileContainer,
            [
                'type' => $fileTypeField,
                'link_url' => $fileLinkUrl,
                'links_file' => $fileUploader
            ]
        );
    }

    /**
     * @return array
     */
    protected function getSampleColumn()
    {
        $sampleContainer['arguments']['data']['config'] = [
            'componentType' => Container::NAME,
            'formElement' => Container::NAME,
            'component' => 'Magento_Ui/js/form/components/group',
            'label' => __('Sample'),
            'dataScope' => '',
        ];
        $sampleTypeField['arguments']['data']['config'] = [
            'formElement' => Form\Element\Select::NAME,
            'componentType' => Form\Field::NAME,
            'component' => 'Magento_Downloadable/js/components/upload-type-handler',
            'dataType' => Form\Element\DataType\Text::NAME,
            'dataScope' => 'sample.type',
            'options' => $this->typeUpload->toOptionArray(),
            'typeFile' => 'sample_file',
            'typeUrl' => 'sample_url',
        ];
        $sampleLinkUrl['arguments']['data']['config'] = [
            'formElement' => Form\Element\Input::NAME,
            'componentType' => Form\Field::NAME,
            'dataType' => Form\Element\DataType\Text::NAME,
            'dataScope' => 'sample.url',
            'placeholder' => 'URL',
            'validation' => [
                'validate-url' => true,
            ],
        ];
        $sampleUploader['arguments']['data']['config'] = [
            'formElement' => 'fileUploader',
            'componentType' => 'fileUploader',
            'component' => 'Magento_Downloadable/js/components/file-uploader',
            'elementTmpl' => 'Magento_Downloadable/components/file-uploader',
            'fileInputName' => 'link_samples',
            'uploaderConfig' => [
                'url' => $this->urlBuilder->addSessionParam()->getUrl(
                    'adminhtml/downloadable_file/upload',
                    ['type' => 'link_samples', '_secure' => true]
                ),
            ],
            'dataScope' => 'sample.file',
        ];

        return $this->arrayManager->set(
            'children',
            $sampleContainer,
            [
                'sample_type' => $sampleTypeField,
                'sample_url' => $sampleLinkUrl,
                'sample_file' => $sampleUploader,
            ]
        );
    }

    /**
     * @return array
     */
    protected function getShareableColumn()
    {
        $shareableField['arguments']['data']['config'] = [
            'label' => __('Shareable'),
            'formElement' => Form\Element\Select::NAME,
            'componentType' => Form\Field::NAME,
            'dataType' => Form\Element\DataType\Number::NAME,
            'dataScope' => 'is_shareable',
            'options' => $this->shareable->toOptionArray(),
        ];

        return $shareableField;
    }

    /**
     * @return array
     */
    protected function getMaxDownloadsColumn()
    {
        $maxDownloadsContainer['arguments']['data']['config'] = [
            'componentType' => Container::NAME,
            'formElement' => Container::NAME,
            'component' => 'Magento_Ui/js/form/components/group',
            'label' => __('Max. Downloads'),
            'dataScope' => '',
        ];
        $numberOfDownloadsField['arguments']['data']['config'] = [
            'formElement' => Form\Element\Input::NAME,
            'componentType' => Form\Field::NAME,
            'dataType' => Form\Element\DataType\Number::NAME,
            'dataScope' => 'number_of_downloads',
            'value' => 0,
            'validation' => [
                'validate-zero-or-greater' => true,
                'validate-number' => true,
            ],
        ];
        $isUnlimitedField['arguments']['data']['config'] = [
            'formElement' => Form\Element\Checkbox::NAME,
            'componentType' => Form\Field::NAME,
            'dataType' => Form\Element\DataType\Number::NAME,
            'dataScope' => 'is_unlimited',
            'description' => __('Unlimited'),
            'valueMap' => [
                'false' => '0',
                'true' => '1',
            ],
            'exports' => [
                'checked' => '${$.parentName}.number_of_downloads:disabled',
            ],
        ];

        return $this->arrayManager->set(
            'children',
            $maxDownloadsContainer,
            [
                'number_of_downloads' => $numberOfDownloadsField,
                'is_unlimited' => $isUnlimitedField,
            ]
        );
    }
}


text:
module OpenTelemetry
  module Instrumentation
    # The instrumentation Registry contains information about instrumentation
    # available and facilitates discovery, installation and
    # configuration. This functionality is primarily useful for SDK
    # implementors.
    class Registry
      def initialize
        @lock = Mutex.new
        @instrumentation = []
      end

      # @api private
      def register(instrumentation)
        @lock.synchronize do
          @instrumentation << instrumentation
        end
      end

      # Lookup an instrumentation definition by name. Returns nil if +instrumentation_name+
      # is not found.
      #
      # @param [String] instrumentation_name A stringified class name for an instrumentation
      # @return [Instrumentation]
      def lookup(instrumentation_name)
        @lock.synchronize do
          find_instrumentation(instrumentation_name)
        end
      end

      # Install the specified instrumentation with optionally specified configuration.
      #
      # @param [Array<String>] instrumentation_names An array of instrumentation names to
      #   install
      # @param [optional Hash<String, Hash>] instrumentation_config_map A map of
      #   instrumentation_name to config. This argument is optional and config can be
      #   passed for as many or as few instrumentations as desired.
      def install(instrumentation_names, instrumentation_config_map = {})
        @lock.synchronize do
          instrumentation_names.each do |instrumentation_name|
            instrumentation = find_instrumentation(instrumentation_name)
            if instrumentation.nil?
              OpenTelemetry.logger.warn "Could not install #{instrumentation_name} because it was not found"
            else
              install_instrumentation(instrumentation, instrumentation_config_map[instrumentation.name])
            end
          end
        end
      end

      # Install all instrumentation available and installable in this process.
      #
      # @param [optional Hash<String, Hash>] instrumentation_config_map A map of
      #   instrumentation_name to config. This argument is optional and config can be
      #   passed for as many or as few instrumentations as desired.
      def install_all(instrumentation_config_map = {})
        @lock.synchronize do
          @instrumentation.map(&:instance).each do |instrumentation|
            install_instrumentation(instrumentation, instrumentation_config_map[instrumentation.name])
          end
        end
      end

      private

      def find_instrumentation(instrumentation_name)
        @instrumentation.detect { |a| a.instance.name == instrumentation_name }
                   &.instance
      end

      def install_instrumentation(instrumentation, config)
        if instrumentation.install(config)
          OpenTelemetry.logger.info "Instrumentation: #{instrumentation.name} was successfully installed with the following options #{instrumentation.config}"
        else
          OpenTelemetry.logger.warn "Instrumentation: #{instrumentation.name} failed to install"
        end
      rescue => e # rubocop:disable Style/RescueStandardError
        OpenTelemetry.handle_error(exception: e, message: "Instrumentation: #{instrumentation.name} unhandled exception during install: #{e.backtrace}")
      end
    end
  end
end

require_relative './registry/version'