text:
package uk.gov.dvsa.journey;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import uk.gov.dvsa.domain.api.response.Vehicle;
import uk.gov.dvsa.domain.model.User;
import uk.gov.dvsa.domain.model.mot.OdometerUnit;
import uk.gov.dvsa.domain.navigation.PageNavigator;
import uk.gov.dvsa.ui.pages.VehicleSearchPage;
import uk.gov.dvsa.ui.pages.mot.*;
import uk.gov.dvsa.ui.pages.mot.retest.ConfirmVehicleRetestPage;
import uk.gov.dvsa.ui.pages.mot.retest.ReTestCompletePage;
import uk.gov.dvsa.ui.pages.mot.retest.ReTestSummaryPage;

import java.io.IOException;
import java.net.URISyntaxException;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalToIgnoringCase;

public class Contingency {

    PageNavigator pageNavigator = null;
    private ContingencyTestEntryPage contingencyPage;
    private boolean successful = false;
    private boolean declarationStatement = false;
    private TestSummaryPage testSummaryPage;

    private static final String DECLARATION_STATEMENT = "I confirm that this MOT transaction has been conducted in accordance with " +
            "the conditions of authorisation which includes compliance with the MOT testing guide, the requirements for " +
            "authorisation, the appropriate MOT Inspection Manual and any other instructions issued by DVSA.";

    private static final String TWOFA_DECLARATION_STATEMENT = "By saving this test result you confirm that you have carried out this " +
            "MOT test in line with DVSA conditions for MOT testing.";

    public Contingency(PageNavigator pageNavigator)
    {
        this.pageNavigator = pageNavigator;
    }

    public ContingencyTestEntryPage testPage(User user) throws IOException, URISyntaxException {
        return contingencyPage = pageNavigator.gotoContingencyTestEntryPage(user);
    }

    public void recordTest(String code, DateTime datetime, Vehicle vehicle) {
        VehicleSearchPage vehicleSearchPage =
                contingencyPage.fillContingencyTestFormAndConfirm(code, datetime.toDateTime(DateTimeZone.UTC));

        StartTestConfirmationPage startTestConfirmationPage =
                vehicleSearchPage.searchVehicle(vehicle).selectVehicle(StartTestConfirmationPage.class);

        TestResultsEntryNewPage testResultsEntryPage =
                startTestConfirmationPage.clickStartMotTestWhenConductingContingencyTest(TestResultsEntryNewPage.class);

        testResultsEntryPage = testResultsEntryPage.clickAddReadingButton().addOdometerReading(99999, OdometerUnit.MILES, true);
        testSummaryPage = testResultsEntryPage.completeBrakeTestWithPassValues(false).clickReviewTestButton();

        if (testSummaryPage.isDeclarationTextDisplayed()) {
            assertThat(testSummaryPage.getDeclarationText(), equalToIgnoringCase(TWOFA_DECLARATION_STATEMENT));
            declarationStatement = true;
        }

        TestCompletePage testCompletePage = testSummaryPage.clickFinishButton(TestCompletePage.class);
        successful = testCompletePage.isReturnToHomepageLinkDisplayed();
    }

    public void recordReTest(String code, DateTime datetime, Vehicle vehicle) throws IOException, URISyntaxException {
        VehicleSearchPage vehicleSearchPage = contingencyPage.fillContingencyTestFormAndConfirm(code, datetime);

        ConfirmVehicleRetestPage retestPage =
                vehicleSearchPage.searchVehicle(vehicle).selectVehicle(ConfirmVehicleRetestPage.class);

        TestResultsEntryNewPage resultsEntryPage = retestPage.startContingencyRetest(TestResultsEntryNewPage.class);
        resultsEntryPage.completeTestDetailsWithPassValues(true);
        ReTestSummaryPage summaryPage = resultsEntryPage.clickReviewTestButton(true);

        if (summaryPage.isDeclarationTextDisplayed()) {
            assertThat(summaryPage.getDeclarationText(), equalToIgnoringCase(TWOFA_DECLARATION_STATEMENT));
            declarationStatement = true;
        }

        ReTestCompletePage testCompletePage = summaryPage.finishTest();
        successful = testCompletePage.verifyBackToHomeDisplayed();
    }

    public boolean isDeclarationStatementDisplayed() {
        return declarationStatement;
    }

    public boolean isTestSaveSuccessful() {
        return successful;
    }

    public void startTest() {
        contingencyPage.clickConfirmContingencyTestDetailsButton();
    }

    public String getValidationMessage(String elementPrefix){
        return contingencyPage.getValidationText(elementPrefix);
    }

    public int getValidationListSize() {
        return contingencyPage.getValidationList().size();
    }
}


text:
/*
 * libc/exit/assert.c
 */

#include <stdio.h>
#include <assert.h>
#include <xboot/module.h>

void __assert_fail(const char * expr, const char * file, int line, const char * func)
{
	fprintf(stderr, "Assertion failed: %s (%s: %s: %d)\r\n", expr, file, func, line);
}
EXPORT_SYMBOL(__assert_fail);

redpajama_set_name: RedPajamaGithub


text:
require "pty"

module RSpecLive
  class ConcurrentProcess
    def initialize(command)
      @command = command
      @output = ""
    end

    def running?
      @running
    end

    def start
      @started_at = Time.now
      @stdout, @stdin, @pid = PTY.spawn @command
      @running = true
    end

    def each_line
      read_characters if running?
      shift_completed_lines.each_line { |line| yield line }
    end

    private

    def shift_completed_lines
      lines = ""
      while index = @output.index("\n")
        lines << @output.slice(0, index + 1)
        @output = @output.slice(index + 1, @output.length - index - 1)
      end
      lines
    end

    def read_characters
      while char = @stdout.read_nonblock(100000)
        @output << char
      end
    rescue IO::WaitReadable
    rescue Errno::EIO
      @stdout.close
      @stdin.close
      @running = false
      @duration = Time.now - @started_at
    end
  end
end


text:
exports._jsonParser = function(fail, succ, s) {
    try {
        return succ(JSON.parse(s));
    }
    catch(e) {
        return fail(e.message);
    }
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="urn:com:att:xacml:policy:id:94378f81-6810-408f-a072-a1a8a7585a24" Version="1" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable">
	<Description>Sample policy that demonstrates use of Configurable LDAP Resolver with sample data.

The PEP Request should provide the following attributes:
action-id=board
subject-id-qualifer=uid|mail
subject-id=hnelson|hnelson@royalnavy.mod.uk
resource-id=HMS Lydia|HMS Victory|HMS Bounty
	</Description>
        <Target>
            <AnyOf>
                <AllOf>
                    <Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case">
                        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">board</AttributeValue>
                        <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
                    </Match>
                </AllOf>
            </AnyOf>
        </Target>
        <Rule RuleId="urn:com:att:xacml:rule:id:bf241671-54de-404c-ac59-bb17b919783f" Effect="Permit">
            <Description>This sailor is a member of the crew for the ship.</Description>
            <Target/>
            <Condition>
                <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
                    <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
                        <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="com:att:research:xacml:test:ldap:subject:ship" DataType="http://www.w3.org/2001/XMLSchema#string" Issuer="com:att:research:xacml:test:ldap" MustBePresent="false"/>
                    </Apply>
                    <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
                        <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
                    </Apply>
                </Apply>
            </Condition>
        </Rule>
        <Rule RuleId="urn:com:att:xacml:rule:id:490228ea-98ee-48d8-84c9-da07334726fd" Effect="Deny">
            <Description>Default is to DENY.</Description>
            <Target/>
        </Rule>
</Policy>


text:
import { Provider } from "cerebral";

function getPopupSize() {
  return {
    width: 1024,
    height: 618,
  }
}
function getPopupOffset({ width, height }) {
  const wLeft = window.screenLeft ? window.screenLeft : window.screenX;
  const wTop = window.screenTop ? window.screenTop : window.screenY;
  const left = wLeft + window.innerWidth / 2 - width / 2;
  const top = wTop + window.innerHeight / 2 - height / 2;
  return { top, left };
}
function getPopupDimensions() {
  const { width, height } = getPopupSize();
  const { top, left } = getPopupOffset({ width, height });
  return `width=${width},height=${height},top=${top},left=${left}`;
}

export default Provider({
  setTitle(title) {
    document.title = title;
  },
  openWindow(url) {
    window.open(url, '_blank');
  },
  openPopup(url, name) {
    const popup = window.open(
      url,
      name,
      `scrollbars=no,toolbar=no,location=no,titlebar=no,directories=no,status=no,menubar=no, ${getPopupDimensions()}`
    );
    return {
      close: () => popup.close(),
    };
  },
  waitForMessage(type) {
    return new Promise(resolve => {
      window.addEventListener('message', function onMessage(event) {
        if(event.data.type === type) {
          window.removeEventListener('message', onMessage);
          resolve(event.data.data);
        }
      });
    })
  }
});


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<title>TActlEjectMedia</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">

TActlEjectMedia

main |
structures |
ActlEjectMedia

The <dfn>ActlEjectMedia</dfn> stucture for Delphi:

TActlEjectMedia = packed record
  Letter: DWORD;
  Flags: DWORD;
end;
PActlEjectMedia = ^TActlEjectMedia;


text:
/* Includes ------------------------------------------------------------------*/
#include "lwip_demo.h"
#include "lwip/init.h"
#include "lwip/netif.h"

void _Error_Handler(char * file, int line)
{
  while(1);
}

/* Variables Initialization */
struct netif gnetif;
ip4_addr_t ipaddr;
ip4_addr_t netmask;
ip4_addr_t gw;
uint8_t IP_ADDRESS[4];
uint8_t NETMASK_ADDRESS[4];
uint8_t GATEWAY_ADDRESS[4];

/**
  * LwIP initialization function
  */
void MX_LWIP_Init(void)
{
  /* IP addresses initialization */
  IP_ADDRESS[0] = 192;
  IP_ADDRESS[1] = 168;
  IP_ADDRESS[2] = 0;
  IP_ADDRESS[3] = 9;
  NETMASK_ADDRESS[0] = 255;
  NETMASK_ADDRESS[1] = 255;
  NETMASK_ADDRESS[2] = 255;
  NETMASK_ADDRESS[3] = 0;
  GATEWAY_ADDRESS[0] = 0;
  GATEWAY_ADDRESS[1] = 0;
  GATEWAY_ADDRESS[2] = 0;
  GATEWAY_ADDRESS[3] = 0;

  /* Initilialize the LwIP stack without RTOS */
  lwip_init();

  /* IP addresses initialization without DHCP (IPv4) */
  IP4_ADDR(&ipaddr, IP_ADDRESS[0], IP_ADDRESS[1], IP_ADDRESS[2], IP_ADDRESS[3]);
  IP4_ADDR(&netmask, NETMASK_ADDRESS[0], NETMASK_ADDRESS[1] , NETMASK_ADDRESS[2], NETMASK_ADDRESS[3]);
  IP4_ADDR(&gw, GATEWAY_ADDRESS[0], GATEWAY_ADDRESS[1], GATEWAY_ADDRESS[2], GATEWAY_ADDRESS[3]);

  /* add the network interface (IPv4/IPv6) without RTOS */
  netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &ethernet_input);

  /* Registers the default network interface */
  netif_set_default(&gnetif);

  if (netif_is_link_up(&gnetif))
  {
    /* When the netif is fully configured this function must be called */
    netif_set_up(&gnetif);
  }
  else
  {
    /* When the netif link is down this function must be called */
    netif_set_down(&gnetif);
  }
}

/**
 * ----------------------------------------------------------------------
 * Function given to help user to continue LwIP Initialization
 * Up to user to complete or change this function ...
 * Up to user to call this function in main.c in while (1) of main(void)
 *-----------------------------------------------------------------------
 * Read a received packet from the Ethernet buffers
 * Send it to the lwIP stack for handling
 * Handle timeouts if LWIP_TIMERS is set and without RTOS
 * Handle the llink status if LWIP_NETIF_LINK_CALLBACK is set and without RTOS
 */
void MX_LWIP_Process(void)
{
  ethernetif_input(&gnetif);
  /* Handle timeouts */
  sys_check_timeouts();
}

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
<?php

namespace GingerPayments\Payment\Order\Transaction;

use GingerPayments\Payment\Common\ChoiceBasedValueObject;

final class Status
{
    use ChoiceBasedValueObject;

    /**
     * Possible transaction statuses
     */
    const BRAND_NEW = 'new';
    const PENDING = 'pending';
    const PROCESSING = 'processing';
    const ERROR = 'error';
    const COMPLETED = 'completed';
    const CANCELLED = 'cancelled';
    const EXPIRED = 'expired';
    const ACCEPTED = 'accepted';
    const CAPTURED = 'captured';
    const DECLINED = 'declined';

    /**
     * @return array
     */
    public function possibleValues()
    {
        return [
            self::BRAND_NEW,
            self::PENDING,
            self::PROCESSING,
            self::ERROR,
            self::COMPLETED,
            self::CANCELLED,
            self::EXPIRED,
            self::ACCEPTED,
            self::CAPTURED,
            self::DECLINED
        ];
    }

    /**
     * @return bool
     */
    public function isNew()
    {
        return $this->value === self::BRAND_NEW;
    }

    /**
     * @return bool
     */
    public function isPending()
    {
        return $this->value === self::PENDING;
    }

    /**
     * @return bool
     */
    public function isProcessing()
    {
        return $this->value === self::PROCESSING;
    }

    /**
     * @return bool
     */
    public function isError()
    {
        return $this->value === self::ERROR;
    }

    /**
     * @return bool
     */
    public function isCompleted()
    {
        return $this->value === self::COMPLETED;
    }

    /**
     * @return bool
     */
    public function isCancelled()
    {
        return $this->value === self::CANCELLED;
    }

    /**
     * @return bool
     */
    public function isExpired()
    {
        return $this->value === self::EXPIRED;
    }

    /**
     * @return bool
     */
    public function isAccepted()
    {
        return $this->value === self::ACCEPTED;
    }

    /**
     * @return bool
     */
    public function isCaptured()
    {
        return $this->value === self::CAPTURED;
    }

    /**
     * @return bool
     */
    public function isDeclined()
    {
        return $this->value === self::DECLINED;
    }
}


text:
<?php

namespace SiteBDE\UserSystemBundle\Repository;

/**
 * SchoolsRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class SchoolsRepository extends \Doctrine\ORM\EntityRepository
{
}


text:
package org.apache.beam.sdk.io.snowflake.test;

import static org.apache.beam.sdk.io.snowflake.test.TestUtils.SnowflakeIOITPipelineOptions;
import static org.apache.beam.sdk.io.snowflake.test.TestUtils.getTestRowDataMapper;
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists.newArrayList;
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Sets.newHashSet;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInAnyOrder;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import org.apache.beam.sdk.PipelineResult;
import org.apache.beam.sdk.coders.SerializableCoder;
import org.apache.beam.sdk.io.common.TestRow;
import org.apache.beam.sdk.io.snowflake.SnowflakeIO;
import org.apache.beam.sdk.io.snowflake.enums.StreamingLogLevel;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.TestStream;
import org.joda.time.Duration;
import org.joda.time.Instant;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;

/**
 * The test for streaming writing to SnowflakeIO. Because of using {@code TestStream} it has to be
 * run with DirectRunner. The test requires a Snowflake's snowpipe name with the copy into
 * STREAMING_IOIT table statement.
 *
 *
Example run:
 *
 *

 * ./gradlew --info -p sdks/java/io/snowflake integrationTest -DintegrationTestPipelineOptions='[
 * "--serverName=<YOUR SNOWFLAKE SERVER NAME>",
 * "--username=<USERNAME>",
 * "--privateKeyPath=<PATH TO PRIVATE KEY>",
 * "--privateKeyPassphrase=<KEY PASSPHRASE>",
 * "--database=<DATABASE NAME>",
 * "--schema=<SCHEMA NAME>",
 * "--stagingBucketName=<BUCKET NAME>",
 * "--storageIntegrationName=<STORAGE INTEGRATION NAME>",
 * "--snowPipe=<SNOWPIPE NAME>",
 * "--numberOfRecords=<INTEGER>",
 * "--runner=DirectRunner"]'
 * --tests org.apache.beam.sdk.io.snowflake.test.SnowflakeStreamingIOIT.writeStreamThenRead
 * -DintegrationTestRunner=direct
 *

 */
public class StreamingSnowflakeIOIT {
  private static final int TIMEOUT = 900000;
  private static final int INTERVAL = 30000;
  private static final String TABLE = "STREAMING_IOIT";

  private static final List<TestRow> testRows = newArrayList();

  @Rule public final transient TestPipeline pipeline = TestPipeline.create();

  private static SnowflakeIOITPipelineOptions options;
  private static SnowflakeIO.DataSourceConfiguration dc;
  private static String stagingBucketName;
  private static String storageIntegrationName;

  @BeforeClass
  public static void setupAll() throws SQLException {
    PipelineOptionsFactory.register(SnowflakeIOITPipelineOptions.class);
    options = TestPipeline.testingPipelineOptions().as(SnowflakeIOITPipelineOptions.class);

    dc =
        SnowflakeIO.DataSourceConfiguration.create()
            .withKeyPairPathAuth(
                options.getUsername(),
                options.getPrivateKeyPath(),
                options.getPrivateKeyPassphrase())
            .withServerName(options.getServerName())
            .withDatabase(options.getDatabase())
            .withRole(options.getRole())
            .withWarehouse(options.getWarehouse())
            .withSchema(options.getSchema());

    stagingBucketName = options.getStagingBucketName();
    storageIntegrationName = options.getStorageIntegrationName();

    for (int i = 0; i < options.getNumberOfRecords(); i++) {
      testRows.add(TestRow.create(i, String.format("TestRow%s:%s", i, UUID.randomUUID())));
    }

    TestUtils.runConnectionWithStatement(
        dc.buildDatasource(),
        String.format("CREATE OR REPLACE TABLE %s(id INTEGER, name STRING)", TABLE));
  }

  @AfterClass
  public static void cleanUp() throws Exception {
    String bucketNameAndPath = stagingBucketName.replaceAll(".+//", "");
    String[] parts = bucketNameAndPath.split("/", -1);
    String bucketName = parts[0];
    String directory = null;
    if (parts.length > 1) {
      directory = bucketNameAndPath.replace(bucketName + "/", "");
    }
    TestUtils.clearStagingBucket(bucketName, directory);

    TestUtils.runConnectionWithStatement(
        dc.buildDatasource(), String.format("DROP TABLE %s", TABLE));
  }

  @Test
  public void writeStreamThenRead() throws SQLException, InterruptedException {
    writeStreamToSnowflake();
    readStreamFromSnowflakeAndVerify();
  }

  private void writeStreamToSnowflake() {
    TestStream<TestRow> stringsStream =
        TestStream.create(SerializableCoder.of(TestRow.class))
            .advanceWatermarkTo(Instant.now())
            .addElements(
                testRows.get(0), testRows.subList(1, testRows.size()).toArray(new TestRow[0]))
            .advanceWatermarkToInfinity();

    pipeline
        .apply(stringsStream)
        .apply(
            "Write SnowflakeIO",
            SnowflakeIO.<TestRow>write()
                .withDataSourceConfiguration(dc)
                .withUserDataMapper(getTestRowDataMapper())
                .withSnowPipe(options.getSnowPipe())
                .withStorageIntegrationName(storageIntegrationName)
                .withStagingBucketName(stagingBucketName)
                .withFlushTimeLimit(Duration.millis(18000))
                .withFlushRowLimit(50000)
                .withDebugMode(StreamingLogLevel.ERROR));

    PipelineResult pipelineResult = pipeline.run(options);
    pipelineResult.waitUntilFinish();
  }

  private void readStreamFromSnowflakeAndVerify() throws SQLException, InterruptedException {
    int timeout = TIMEOUT;
    while (timeout > 0) {
      Set<TestRow> fetchedRows = readDataFromStream();
      if (fetchedRows.size() >= testRows.size()) {
        assertThat(fetchedRows, containsInAnyOrder(testRows.toArray(new TestRow[0])));
        return;
      }
      Thread.sleep(INTERVAL);
      timeout -= INTERVAL;
    }
    throw new RuntimeException("Could not read data from table");
  }

  private Set<TestRow> readDataFromStream() throws SQLException {
    Connection connection = dc.buildDatasource().getConnection();
    PreparedStatement statement =
        connection.prepareStatement(String.format("SELECT * FROM %s", TABLE));
    ResultSet resultSet = statement.executeQuery();

    Set<TestRow> testRows = resultSetToJavaSet(resultSet);

    resultSet.close();
    statement.close();
    connection.close();

    return testRows;
  }

  private Set<TestRow> resultSetToJavaSet(ResultSet resultSet) throws SQLException {
    Set<TestRow> testRows = newHashSet();
    while (resultSet.next()) {
      testRows.add(TestRow.create(resultSet.getInt(1), resultSet.getString(2).replace("'", "")));
    }
    return testRows;
  }
}


text:
        <button class="btn btn-xs btn-danger glyphicon glyphicon-remove pull-right" ng-click="clearError();"></button>

Error code:

{{title}}

            Id
            Name

            {{list._id}}
            {{list.title}}

        {{link.title}}


text:
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
  <Dependency>
    <ModuleName>Common</ModuleName>
    <VirtualPath>~/Core/Common</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Containers</ModuleName>
    <VirtualPath>~/Core/Containers</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Contents</ModuleName>
    <VirtualPath>~/Core/Contents</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Dashboard</ModuleName>
    <VirtualPath>~/Core/Dashboard</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Feeds</ModuleName>
    <VirtualPath>~/Core/Feeds</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Markdown</ModuleName>
    <VirtualPath>~/Modules/Markdown/Markdown.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>MarkdownSharp</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Markdown/bin/MarkdownSharp.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Navigation</ModuleName>
    <VirtualPath>~/Core/Navigation</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Alias</ModuleName>
    <VirtualPath>~/Modules/Orchard.Alias/bin/Orchard.Alias.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Tokens</ModuleName>
    <VirtualPath>~/Modules/Orchard.Tokens/bin/Orchard.Tokens.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Autoroute</ModuleName>
    <VirtualPath>~/Modules/Orchard.Autoroute/Orchard.Autoroute.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Alias</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Alias/bin/Orchard.Alias.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Tokens</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Tokens/bin/Orchard.Tokens.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Blogs</ModuleName>
    <VirtualPath>~/Modules/Orchard.Blogs/bin/Orchard.Blogs.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Comments</ModuleName>
    <VirtualPath>~/Modules/Orchard.Comments/bin/Orchard.Comments.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Joel.Net.Akismet</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Comments/bin/Joel.Net.Akismet.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.ContentTypes</ModuleName>
    <VirtualPath>~/Modules/Orchard.ContentTypes/bin/Orchard.ContentTypes.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Fields</ModuleName>
    <VirtualPath>~/Modules/Orchard.Fields/bin/Orchard.Fields.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Forms</ModuleName>
    <VirtualPath>~/Modules/Orchard.Forms/bin/Orchard.Forms.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.jQuery</ModuleName>
    <VirtualPath>~/Modules/Orchard.jQuery/bin/Orchard.jQuery.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Media</ModuleName>
    <VirtualPath>~/Modules/Orchard.Media/bin/Orchard.Media.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>ICSharpCode.SharpZipLib</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Media/bin/ICSharpCode.SharpZipLib.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.MediaPicker</ModuleName>
    <VirtualPath>~/Modules/Orchard.MediaPicker/bin/Orchard.MediaPicker.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>ICSharpCode.SharpZipLib</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Media/bin/ICSharpCode.SharpZipLib.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Media</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Media/bin/Orchard.Media.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Modules</ModuleName>
    <VirtualPath>~/Modules/Orchard.Modules/bin/Orchard.Modules.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Packaging</ModuleName>
    <VirtualPath>~/Modules/Orchard.Packaging/bin/Orchard.Packaging.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Modules</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Modules/bin/Orchard.Modules.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Pages</ModuleName>
    <VirtualPath>~/Modules/Orchard.Pages/bin/Orchard.Pages.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Projections</ModuleName>
    <VirtualPath>~/Modules/Orchard.Projections/Orchard.Projections.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Forms</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Forms/bin/Orchard.Forms.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Tokens</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Tokens/bin/Orchard.Tokens.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.PublishLater</ModuleName>
    <VirtualPath>~/Modules/Orchard.PublishLater/bin/Orchard.PublishLater.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Themes</ModuleName>
    <VirtualPath>~/Modules/Orchard.Themes/bin/Orchard.Themes.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Recipes</ModuleName>
    <VirtualPath>~/Modules/Orchard.Recipes/Orchard.Recipes.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Modules</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Modules/bin/Orchard.Modules.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Packaging</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Packaging/bin/Orchard.Packaging.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Themes</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Themes/bin/Orchard.Themes.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Roles</ModuleName>
    <VirtualPath>~/Modules/Orchard.Roles/bin/Orchard.Roles.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Scripting</ModuleName>
    <VirtualPath>~/Modules/Orchard.Scripting/bin/Orchard.Scripting.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Rules</ModuleName>
    <VirtualPath>~/Modules/Orchard.Rules/Orchard.Rules.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Forms</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Forms/bin/Orchard.Forms.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Scripting</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Scripting/bin/Orchard.Scripting.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Tokens</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Tokens/bin/Orchard.Tokens.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Setup</ModuleName>
    <VirtualPath>~/Modules/Orchard.Setup/Orchard.Setup.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Modules</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Modules/bin/Orchard.Modules.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Packaging</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Packaging/bin/Orchard.Packaging.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Recipes</Name>
        <LoaderName>DynamicExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Recipes/Orchard.Recipes.csproj</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Themes</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Themes/bin/Orchard.Themes.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Tags</ModuleName>
    <VirtualPath>~/Modules/Orchard.Tags/bin/Orchard.Tags.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Users</ModuleName>
    <VirtualPath>~/Modules/Orchard.Users/bin/Orchard.Users.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Warmup</ModuleName>
    <VirtualPath>~/Modules/Orchard.Warmup/bin/Orchard.Warmup.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Orchard.Widgets</ModuleName>
    <VirtualPath>~/Modules/Orchard.Widgets/bin/Orchard.Widgets.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Scripting</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Scripting/bin/Orchard.Scripting.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Themes</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Themes/bin/Orchard.Themes.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>Reports</ModuleName>
    <VirtualPath>~/Core/Reports</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>SafeMode</ModuleName>
    <VirtualPath>~/Theme/SafeMode</VirtualPath>
    <LoaderName>RawThemeExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Scheduling</ModuleName>
    <VirtualPath>~/Core/Scheduling</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Settings</ModuleName>
    <VirtualPath>~/Core/Settings</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Shapes</ModuleName>
    <VirtualPath>~/Core/Shapes</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>TheAdmin</ModuleName>
    <VirtualPath>~/Theme/TheAdmin</VirtualPath>
    <LoaderName>RawThemeExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>TheJournalist</ModuleName>
    <VirtualPath>~/Theme/TheJournalist</VirtualPath>
    <LoaderName>RawThemeExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>TheThemeMachine</ModuleName>
    <VirtualPath>~/Theme/TheThemeMachine</VirtualPath>
    <LoaderName>RawThemeExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>TinyMce</ModuleName>
    <VirtualPath>~/Modules/TinyMce/bin/TinyMce.dll</VirtualPath>
    <LoaderName>PrecompiledExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>Title</ModuleName>
    <VirtualPath>~/Core/Title</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
  <Dependency>
    <ModuleName>UpgradeTo14</ModuleName>
    <VirtualPath>~/Modules/UpgradeTo14/UpgradeTo14.csproj</VirtualPath>
    <LoaderName>DynamicExtensionLoader</LoaderName>
    <References>
      <Reference>
        <Name>Orchard.Alias</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Alias/bin/Orchard.Alias.dll</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Autoroute</Name>
        <LoaderName>DynamicExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Autoroute/Orchard.Autoroute.csproj</VirtualPath>
      </Reference>
      <Reference>
        <Name>Orchard.Tokens</Name>
        <LoaderName>PrecompiledExtensionLoader</LoaderName>
        <VirtualPath>~/Modules/Orchard.Tokens/bin/Orchard.Tokens.dll</VirtualPath>
      </Reference>
    </References>
  </Dependency>
  <Dependency>
    <ModuleName>XmlRpc</ModuleName>
    <VirtualPath>~/Core/XmlRpc</VirtualPath>
    <LoaderName>CoreExtensionLoader</LoaderName>
    <References />
  </Dependency>
</Dependencies>


text:
package com.manage.kernel.jpa.entity;

import com.manage.base.database.enums.ApproveRole;
import com.manage.base.database.enums.Gender;
import com.manage.kernel.jpa.base.StatusBase;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.*;

@Entity
@Table(name = "ad_user")
@SequenceGenerator(name = "seq_ad_user", sequenceName = "seq_ad_user")
public class AdUser extends StatusBase {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_ad_user")
    private Long id;

    @Column(name = "account", nullable = false, length = 50)
    private String account;

    @Column(name = "name", length = 50)
    private String name;

    @Column(name = "password", length = 200)
    private String password;

    @Column(name = "gender")
    @Type(type = "com.manage.base.database.model.DBEnumType", parameters = {
            @Parameter(name = "enumClass", value = "com.manage.base.database.enums.Gender") })
    private Gender gender;

    @Column(name = "approve_role")
    @Type(type = "com.manage.base.database.model.VarDBEnumType", parameters = {
            @Parameter(name = "enumClass", value = "com.manage.base.database.enums.ApproveRole") })
    private ApproveRole approveRole;

    @Column(name = "telephone", length = 50)
    private String telephone;

    @Column(name = "mobile", length = 50)
    private String mobile;

    @Column(name = "email", length = 50)
    private String email;

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ad_user_permission", joinColumns = @JoinColumn(name = "user_id"), inverseJoinColumns = @JoinColumn(name = "permission_code"))
    private List<AdPermission> permissions = new ArrayList<AdPermission>();

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ad_user_role", joinColumns = @JoinColumn(name = "user_id"), inverseJoinColumns = @JoinColumn(name = "role_id"))
    private List<AdRole> roles = new ArrayList<AdRole>();

    @Column(name = "organ_code", insertable = false, updatable = false)
    private String organCode;

    @ManyToOne(optional = true, fetch = FetchType.LAZY)
    @JoinColumn(name = "organ_code")
    private AdOrganization organ;

    public AdUser() {

    }

    public AdUser(Long id) {
        this.id = id;
    }

    public AdUser(Long id, String account) {
        this.id = id;
        this.account = account;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public List<AdPermission> getPermissions() {
        return permissions;
    }

    public void setPermissions(List<AdPermission> permissions) {
        this.permissions = permissions;
    }

    public List<AdRole> getRoles() {
        return roles;
    }

    public void setRoles(List<AdRole> roles) {
        this.roles = roles;
    }

    public Gender getGender() {
        return gender;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    public ApproveRole getApproveRole() {
        return approveRole;
    }

    public void setApproveRole(ApproveRole approveRole) {
        this.approveRole = approveRole;
    }

    public String getOrganCode() {
        return organCode;
    }

    public void setOrganCode(String organCode) {
        this.organCode = organCode;
    }

    public AdOrganization getOrgan() {
        return organ;
    }

    public String getOrganName() {
        if (organ == null) {
            return null;
        }
        return organ.getName();
    }

    public void setOrgan(AdOrganization organ) {
        this.organ = organ;
    }

    public String actUserId() {
        return account;
    }
}


text:
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/app_list/search/files/file_search_provider.h"

#include <cctype>
#include <cmath>

#include "base/files/file_enumerator.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "chrome/browser/ash/file_manager/path_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/search/files/file_result.h"

namespace app_list {
namespace {

using chromeos::string_matching::TokenizedString;

constexpr char kFileSearchSchema[] = "file_search://";
constexpr int kMaxResults = 25;
constexpr int kSearchTimeoutMs = 100;

// Construct a case-insensitive fnmatch query from |query|. E.g. for abc123, the
// result would be *[aA][bB][cC]123*.
std::string CreateFnmatchQuery(const std::string& query) {
  std::vector<std::string> query_pieces = {"*"};
  size_t sequence_start = 0;
  for (size_t i = 0; i < query.size(); ++i) {
    if (isalpha(query[i])) {
      if (sequence_start != i) {
        query_pieces.push_back(
            query.substr(sequence_start, i - sequence_start));
      }
      std::string piece("[");
      piece.resize(4);
      piece[1] = tolower(query[i]);
      piece[2] = toupper(query[i]);
      piece[3] = ']';
      query_pieces.push_back(std::move(piece));
      sequence_start = i + 1;
    }
  }
  if (sequence_start != query.size()) {
    query_pieces.push_back(query.substr(sequence_start));
  }
  query_pieces.push_back("*");

  return base::StrCat(query_pieces);
}

// Returns a vector of matched filepaths and a bool indicating whether or not
// the path is a directory.
std::vector<FileSearchProvider::PathInfo> SearchFilesByPattern(
    const base::FilePath& root_path,
    const std::string& query,
    const base::TimeTicks& query_start_time) {
  base::FileEnumerator enumerator(
      root_path,
      /*recursive=*/true,
      base::FileEnumerator::DIRECTORIES | base::FileEnumerator::FILES,
      CreateFnmatchQuery(query), base::FileEnumerator::FolderSearchPolicy::ALL);

  const auto time_limit = base::Milliseconds(kSearchTimeoutMs);
  bool timed_out = false;
  std::vector<FileSearchProvider::PathInfo> matched_paths;
  for (base::FilePath path = enumerator.Next(); !path.empty();
       path = enumerator.Next()) {
    matched_paths.emplace_back(
        path, enumerator.GetInfo().IsDirectory(),
        base::Time::FromTimeT(enumerator.GetInfo().stat().st_atime));

    if (matched_paths.size() == kMaxResults) {
      break;
    } else if (base::TimeTicks::Now() - query_start_time > time_limit) {
      timed_out = true;
      break;
    }
  }
  UMA_HISTOGRAM_BOOLEAN("Apps.AppList.FileSearchProvider.TimedOut", timed_out);
  return matched_paths;
}

}  // namespace

FileSearchProvider::FileSearchProvider(Profile* profile)
    : profile_(profile),
      thumbnail_loader_(profile),
      root_path_(file_manager::util::GetMyFilesFolderForProfile(profile)) {
  DCHECK(profile_);
  DCHECK(!root_path_.empty());
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}

FileSearchProvider::~FileSearchProvider() = default;

ash::AppListSearchResultType FileSearchProvider::ResultType() {
  return ash::AppListSearchResultType::kFileSearch;
}

void FileSearchProvider::Start(const std::u16string& query) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  query_start_time_ = base::TimeTicks::Now();

  // Clear results and cancel any outgoing requests.
  ClearResultsSilently();
  weak_factory_.InvalidateWeakPtrs();

  // This provider does not handle zero-state.
  if (query.empty())
    return;

  last_query_ = query;
  last_tokenized_query_.emplace(query, TokenizedString::Mode::kWords);

  base::ThreadPool::PostTaskAndReplyWithResult(
      FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING},
      base::BindOnce(SearchFilesByPattern, root_path_, base::UTF16ToUTF8(query),
                     query_start_time_),
      base::BindOnce(&FileSearchProvider::OnSearchComplete,
                     weak_factory_.GetWeakPtr()));
}

void FileSearchProvider::OnSearchComplete(
    std::vector<FileSearchProvider::PathInfo> paths) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  // Sort paths by the time of last access.
  std::sort(paths.begin(), paths.end(),
            [](const FileSearchProvider::PathInfo& a,
               const FileSearchProvider::PathInfo& b) {
              return a.last_accessed < b.last_accessed;
            });

  constexpr double kScoreEps = 1.0e-5;
  SearchProvider::Results results;
  for (int i = 0; i < paths.size(); ++i) {
    double relevance =
        FileResult::CalculateRelevance(last_tokenized_query_, paths[i].path);
    // Slightly penalize scores for less recently accessed files, but don't let
    // the relevance go below zero.
    relevance = std::max(0.0, relevance - (paths.size() - i) * kScoreEps);
    DCHECK((relevance >= 0.0) && (relevance <= 1.0));
    results.emplace_back(MakeResult(paths[i], relevance));
  }

  SwapResults(&results);
  UMA_HISTOGRAM_TIMES("Apps.AppList.FileSearchProvider.Latency",
                      base::TimeTicks::Now() - query_start_time_);
}

std::unique_ptr<FileResult> FileSearchProvider::MakeResult(
    const FileSearchProvider::PathInfo& path,
    const double relevance) {
  const auto type = path.is_directory ? FileResult::Type::kDirectory
                                      : FileResult::Type::kFile;
  auto result = std::make_unique<FileResult>(
      kFileSearchSchema, path.path, ash::AppListSearchResultType::kFileSearch,
      last_query_, relevance, type, profile_);
  result->RequestThumbnail(&thumbnail_loader_);
  return result;
}

}  // namespace app_list


text:
<?php foreach($javascripts as $js): ?>

<?php endforeach; ?>
<? /*

 */ ?>


text:
package com.streamsets.pipeline.lib.parser.log;

import com.streamsets.pipeline.api.Field;
import com.streamsets.pipeline.api.ProtoConfigurableEntity;
import com.streamsets.pipeline.api.ext.io.OverrunReader;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.pool2.impl.GenericObjectPool;

import java.io.IOException;
import java.util.regex.Matcher;

public class LEEFParser extends ExtendedFormatParser {
  private static final char LEEF_DEFAULT_SEP = '\t';

  public LEEFParser(
      ProtoConfigurableEntity.Context context,
      String readerId,
      OverrunReader reader,
      long readerOffset,
      int maxObjectLen,
      boolean retainOriginalText,
      GenericObjectPool<StringBuilder> currentLineBuilderPool,
      GenericObjectPool<StringBuilder> previousLineBuilderPool
  ) throws IOException {
    super(context,
        readerId,
        reader,
        readerOffset,
        maxObjectLen,
        retainOriginalText,
        "LEEF",
        ExtendedFormatType.LEEF,
        currentLineBuilderPool,
        previousLineBuilderPool
    );
  }

  @Override
  public Field getExtFormatVersion(String val) {
    double leefVersion = Double.parseDouble(StringUtils.substringAfter(val, ":"));
    return Field.create(leefVersion);
  }

  @Override
  public int getNumHeaderFields(ExtendedFormatType formatType, Field formatVersion) {
    return 5;
  }

  @Override
  public String getHeaderFieldName(int index) {
    switch (index) {
      case 1:
        return "vendor";
      case 2:
        return "product";
      case 3:
        return "version";
      case 4:
        return "eventId";
    }
    throw new IllegalArgumentException("Invalid header index (" + index + ") while parsing record");
  }

  @Override
  protected char getExtensionAttrSeparator(Matcher m, int index, StringBuilder logLine) {
    char attrSep = LEEF_DEFAULT_SEP;
    if (m.find()) {
      String val = logLine.substring(index, m.start());
      if (val.length() == 1) {
        attrSep = val.charAt(0);
      } else {
        int hexStart = val.indexOf('x');
        if (hexStart == -1) {
          attrSep = (char)Integer.parseInt(val, 16);
        } else {
          attrSep = (char)Integer.parseInt(val.substring(hexStart+1), 16);
        }
      }
    }
    return attrSep;
  }
}


text:
package bio.terra.cloudres.azure.resourcemanager.msi;

import bio.terra.cloudres.common.CloudOperation;

/** {@link CloudOperation} for using Azure MsiManager API. */
public enum MsiManagerOperation implements CloudOperation {
  CREATE_USER_ASSIGNED_MANAGED_IDENTITY
}


text:
package org.sleuthkit.autopsy.timeline.filters;

import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ObservableBooleanValue;

/**
 * Base implementation of a {@link Filter}. Implements active property.
 *
 */
public abstract class AbstractFilter implements Filter {

    private final SimpleBooleanProperty selected = new SimpleBooleanProperty(true);
    private final SimpleBooleanProperty disabled = new SimpleBooleanProperty(false);
    private final BooleanBinding activeProperty = Bindings.and(selected, disabled.not());

    @Override
    public SimpleBooleanProperty selectedProperty() {
        return selected;
    }

    @Override
    public ObservableBooleanValue disabledProperty() {
        return disabled;
    }

    @Override
    public void setSelected(Boolean act) {
        selected.set(act);
    }

    @Override
    public boolean isSelected() {
        return selected.get();
    }

    @Override
    public void setDisabled(Boolean act) {
        disabled.set(act);
    }

    @Override
    public boolean isDisabled() {
        return disabledProperty().get();
    }

    @Override
    public boolean isActive() {
        return activeProperty().get();
    }

    @Override
    public BooleanBinding activeProperty() {
        return activeProperty;
    }
}


text:
require 'familysearch/gedcomx'

module FamilySearch
  module Middleware
    # Parse
    class GedcomxParser < Faraday::Response::Middleware
      def on_complete(env)
        content_type = env[:response_headers]['content-type']
        if ['application/x-gedcomx-atom+json','application/x-fs-v1+json'].include? content_type
          env[:body] = parse(env[:body], content_type) unless [204,304].index env[:status]
        end
      end

      # The method that has MultiJson parse the json string.
      def parse(body, content_type)
        case content_type
        when 'application/x-gedcomx-atom+json'
          FamilySearch::Gedcomx::AtomFeed.new body
        when 'application/x-fs-v1+json'
          FamilySearch::Gedcomx::FamilySearch.new body
        end
      end
    end
  end
end

Faraday::Response.register_middleware :response, :gedcomx_parser => FamilySearch::Middleware::GedcomxParser


text:
<?php

namespace Amadeus\Client\Struct\Fop;

use Amadeus\Client\RequestOptions\FopValidateFopOptions;
use Amadeus\Client\Struct\BaseWsMessage;

/**
 * ValidateFormOfPayment
 *
 * @package Amadeus\Client\Struct\Fop
 * @author Mike Hernas <mike@ahoy.io>
 */
class ValidateFormOfPayment extends BaseWsMessage
{
    /**
     * @var FopGroup[]
     */
    public $fopGroup = [];

    /**
     * FOP_ValidateFormOfPayment constructor.
     *
     * @param FopValidateFopOptions $options
     */
    public function __construct(FopValidateFopOptions $options)
    {
        foreach ($options->fopGroup as $group) {
            $this->fopGroup[] = new FopGroup($group);
        }
    }
}


text:
local Graph = {}
Graph.__index = Graph

-- Namespace

-- Imports
local Edge = require "pgf.gd.deprecated.Edge"

local lib = require "pgf.gd.lib"

--- Creates a new graph.
--
-- @param values  Values to override default graph settings.
--                The following parameters can be set:\par
--                |nodes|: The nodes of the graph.\par
--                |edges|: The edges of the graph.\par
--                |clusters|: The node clusters of the graph.\par
--                |options|: A table of node options passed over from \tikzname.
--                |events|: A sequence of events signaled during the graph specification.
--
-- @return A newly-allocated graph.
--
function Graph.new(values)
  local defaults = {
    nodes = {},
    edges = {},
    clusters = {},
    options = {},
    events = {},
  }
  setmetatable(defaults, Graph)
  if values then
    for k,v in pairs(values) do
      defaults[k] = v
    end
  end
  return defaults
end

--- Prepares a graph for an algorithm.
--
-- This method causes self, all its nodes, and all its edges to get
-- a new empty table for the key algorithm. This allows an algorithm to
-- store stuff with nodes and edges without them interfering with information
-- stored by other algorithms.
--
-- @param An algorithm object.

function Graph:registerAlgorithm(algorithm)
  self[algorithm] = self[algorithm] or {}

  -- Add an algorithm field to all nodes, all edges, and the graph:
  for _,n in pairs(self.nodes) do
    n[algorithm] = n[algorithm] or {}
  end
  for _,e in pairs(self.edges) do
    e[algorithm] = e[algorithm] or {}
  end
end

--- Sets the graph option \meta{name} to \meta{value}.
--
-- @param name Name of the option to be changed.
-- @param value New value for the graph option \meta{name}.
--
function Graph:setOption(name, value)
  self.options[name] = value
end

--- Returns the value of the graph option \meta{name}.
--
-- @param name Name of the option.
--
-- @return The value of the graph option \meta{name} or |nil|.
--
function Graph:getOption(name)
  return self.options[name]
end

--- Creates a shallow copy of a graph.
--
-- The nodes and edges of the original graph are not preserved in the copy.
--
-- @return A shallow copy of the graph.
--
function Graph:copy ()
   return Graph.new({options = self.options, events = self.events})
end

--- Adds a node to the graph.
--
-- @param node The node to be added.
--
function Graph:addNode(node)
   -- only add the node if it's not included in the graph yet
   if not self:findNode(node.name) then
      -- Does the node have an index, yet?
      if not node.index then
	 node.index = #self.nodes + 1
      end

      table.insert(self.nodes, node)
   end
end

--- If possible, removes a node from the graph and returns it.
--
-- @param node The node to remove.
--
-- @return The removed node or |nil| if it was not found in the graph.
--
function Graph:removeNode(node)
  local _, index = lib.find(self.nodes, function (other)
    return other.name == node.name
  end)
  if index then
    table.remove(self.nodes, index)
    return node
  else
    return nil
  end
end

--- If possible, looks up the node with the given name in the graph.
--
-- @param name Name of the node to look up.
--
-- @return The node with the given name or |nil| if it was not found in the graph.
--
function Graph:findNode(name)
  return self:findNodeIf(function (node) return node.name == name end)
end

--- Looks up the first node for which the function \meta{test} returns |true|.
--
-- @param test A function that takes one parameter (a |Node|) and returns
--             |true| or |false|.
--
-- @return The first node for which \meta{test} returns |true|.
--
function Graph:findNodeIf(test)
  return lib.find(self.nodes, test)
end

--- Like removeNode, but also deletes all adjacent edges of the removed node.
--
-- This function also removes the deleted adjacent edges from all neighbours
-- of the removed node.
--
-- @param node The node to be deleted together with its adjacent edges.
--
-- @return The removed node or |nil| if the node was not found in the graph.
--
function Graph:deleteNode(node)
  local node = self:removeNode(node)
  if node then
    for _,edge in ipairs(node.edges) do
      self:removeEdge(edge)
      for _,other_node in ipairs(edge.nodes) do
        if other_node.name ~= node.name then
          other_node:removeEdge(edge)
        end
      end
    end
    node.edges = {}
  end
  return node
end

-- Checks whether the edge already exists in the graph and returns it if possible.
--
-- @param edge Edge to search for.
--
-- @return The edge if it was found in the graph, |nil| otherwise.
--
function Graph:findEdge(edge)
  return lib.find(self.edges, function (other) return other == edge end)
end

--- Adds an edge to the graph.
--
-- @param edge The edge to be added.
--
function Graph:addEdge(edge)
   if not edge.index then
      edge.index = #self.edges + 1
   end

   table.insert(self.edges, edge)
end

--- If possible, removes an edge from the graph and returns it.
--
-- @param edge The edge to be removed.
--
-- @return The removed edge or |nil| if it was not found in the graph.
--
function Graph:removeEdge(edge)
  local _, index = lib.find(self.edges, function (other) return other == edge end)
  if index then
    table.remove(self.edges, index)
    return edge
  else
    return nil
  end
end

--- Like removeEdge, but also removes the edge from its adjacent nodes.
--
-- @param edge The edge to be deleted.
--
-- @return The removed edge or |nil| if it was not found in the graph.
--
function Graph:deleteEdge(edge)
  local edge = self:removeEdge(edge)
  if edge then
    for _,node in ipairs(edge.nodes) do
      node:removeEdge(edge)
    end
  end
  return edge
end

--- Removes an edge between two nodes and also removes it from these nodes.
--
-- @param from Start node of the edge.
-- @param to   End node of the edge.
--
-- @return The deleted edge.
--
function Graph:deleteEdgeBetweenNodes(from, to)
  -- try to find the edge
  local edge = lib.find(self.edges, function (edge)
    return edge.nodes[1] == from and edge.nodes[2] == to
  end)

  -- delete and return the edge
  if edge then
    return self:deleteEdge(edge)
  else
    return nil
  end
end

--- Creates and adds a new edge to the graph.
--
-- @param first_node   The first node of the new edge.
-- @param second_node  The second node of the new edge.
-- @param direction    The direction of the new edge. Possible values are
--                     \begin{itemize}
--                     \item |Edge.UNDIRECTED|,
--                     \item |Edge.LEFT|,
--                     \item |Edge.RIGHT|,
--                     \item |Edge.BOTH| and
--                     \item |Edge.NONE| (for invisible edges).
--                     \end{itemize}
-- @param edge_nodes   A string of \tikzname\ edge nodes that needs to be passed
--                     back to the \TeX layer unmodified.
-- @param options      The options of the new edge.
-- @param tikz_options A table of \tikzname\ options to be used by graph drawing
--                     algorithms to treat the edge in special ways.
--
-- @return The newly created edge.
--
function Graph:createEdge(first_node, second_node, direction, edge_nodes, options, tikz_options)
  local edge = Edge.new{
    direction = direction,
    edge_nodes = edge_nodes,
    options = options,
    tikz_options = tikz_options
  }
  edge:addNode(first_node)
  edge:addNode(second_node)
  self:addEdge(edge)
  return edge
end

--- Returns the cluster with the given name or |nil| if no such cluster exists.
--
-- @param name Name of the node cluster to look up.
--
-- @return The cluster with the given name or |nil| if no such cluster is defined.
--
function Graph:findClusterByName(name)
  return lib.find(self.clusters, function (cluster)
    return cluster.name == name
  end)
end

--- Tries to add a cluster to the graph. Returns whether or not this was successful.
--
-- Clusters are supposed to have unique names. This function will add the given
-- cluster only if there is no cluster with this name already. It returns |true|
-- if the cluster was added and |false| otherwise.
--
-- @param cluster Cluster to add to the graph.
--
-- @return |true| if the cluster was added successfully, |false| otherwise.
--
function Graph:addCluster(cluster)
  if not self:findClusterByName(cluster.name) then
    table.insert(self.clusters, cluster)
  end
end

--- Returns a string representation of this graph including all nodes and edges.
--
-- @ignore This should not appear in the documentation.
--
-- @return Graph as string.
--
function Graph:__tostring()
  local tmp = Graph.__tostring
  Graph.__tostring = nil
  local result = "Graph<" .. tostring(self) .. ">(("
  Graph.__tostring = tmp

  local first = true
  for _,node in ipairs(self.nodes) do
    if first then first = false else result = result .. ", " end
    result = result .. tostring(node)
  end
  result = result .. "), ("
  first = true
  for _,edge in ipairs(self.edges) do
    if first then first = false else result = result .. ", " end
    result = result .. tostring(edge)
  end

  return result .. "))"
end

-- Done

return Graph


text:
import { RACES } from './mocks';
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Race } from './race';
import 'rxjs/add/operator/map';

@Injectable()
export class RaceService {

  constructor(private http: Http){ }

  getRaces() {
    return this.http.get('app/races.json').map(response => <Race[]>response.json().racesData);
  }
}


text:
<?php

namespace Drupal\Core\Ajax;

/**
 * AJAX command for calling the jQuery remove() method.
 *
 * The 'remove' command instructs the client to use jQuery's remove() method
 * to remove each of elements matched by the given selector, and everything
 * within them.
 *
 * This command is implemented by Drupal.AjaxCommands.prototype.remove()
 * defined in misc/ajax.js.
 *
 * @see http://docs.jquery.com/Manipulation/remove#expr
 *
 * @ingroup ajax
 */
class RemoveCommand implements CommandInterface {

  /**
   * The CSS selector for the element(s) to be removed.
   *
   * @var string
   */
  protected $selector;

  /**
   * Constructs a RemoveCommand object.
   *
   * @param string $selector
   */
  public function __construct($selector) {
    $this->selector = $selector;
  }

  /**
   * Implements Drupal\Core\Ajax\CommandInterface:render().
   */
  public function render() {
    return [
      'command' => 'remove',
      'selector' => $this->selector,
    ];
  }

}


text:
from setuptools import setup

def scm_config():
    def scheme(version):
        if version.distance is None:
            version.distance = 0

        return version.format_with('{tag}.{distance}')

    return {'version_scheme': scheme,
            'write_to': "schedules_tools/version.py",
            'local_scheme': 'dirty-tag'
            }

setup(
    use_scm_version=scm_config
)


text:
module DecisionTree
  class FrequencyTable
    attr_reader :header_class_label,:header_target_attribute,:values

    def initialize(data_target,data_class_label)
      @data_target = data_target
      @data_class_label = data_class_label
      @header_class_label = parse_attr(data_class_label).keys # THis contains the posible options of the class_label
      @header_target_attribute = parse_attr(data_target).keys # contains the possible options of the target attribute
      @values = Array.new(@header_target_attribute.size) { Array.new(@header_class_label.size,0)}
      create_matrix
    end

    def pretty_print
      print "".ljust(5)
      @header_class_label.each {|key| print key.ljust(5)}
      print "\n"
      @values.each_with_index do |row, index|
        print @header_target_attribute[index].ljust(5)
        row.each {|value| print value.to_s.ljust(5)}
        print " | " + sum_target(@header_target_attribute[index]).to_s
        print "\n"
      end
      print "".ljust(5)
      @header_class_label.each {|key| print sum_class_label(key).to_s.ljust(5)}
    end

    def sum_target(option)
      index_target = @header_target_attribute.index(option)
      @values[index_target].inject(0) {|sum,x| sum + x }
    end

    def sum_class_label(option)
      index_class_label = @header_class_label.index(option)
      @values.inject(0) {|sum,x| sum + x[index_class_label]}
    end

    def leaf_class_label(target_attr)
      index = @header_target_attribute.index(target_attr)
      leaf_label = ""
      @values[index].each_with_index do |value, index|
        if value == sum_target(target_attr)
          # This node doesnt need to split
          leaf_label = @header_class_label[index]
        end
      end
      leaf_label
    end

    private

    def parse_attr(array)
      result = {}
      array.each do |key|
        if result.key?(key)
          result[key] += 1
        else
          result[key] = 1
        end
      end
      result
    end

    # Creating matrix
    #                 |   Class Label |
    #                 |    Y  |   N   | <- header_class_label
    #         |-------|:-----:|:-----:|
    # |Target |   Y   | 0     | 0     |
    # |Attr   |   N   | 0     | 0     |
    #            ^
    #            |
    #            |
    #     header_target_attribute
    def create_matrix
      @data_target.each_with_index do |target, index|
        index_target = @header_target_attribute.index(target)
        index_class_label = @header_class_label.index(@data_class_label[index])
        @values[index_target][index_class_label] += 1
      end
    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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-samples</artifactId>
        <version>4.7.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <groupId>org.ops4j.pax.exam.samples</groupId>
    <artifactId>exam-itest-sample-karaf</artifactId>
    <name>OPS4J Pax Exam Sample Karaf Container</name>

    <dependencies>
        <dependency>
            <groupId>org.ops4j.pax.exam.samples</groupId>
            <artifactId>pax-exam-sample8-ds</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>standard</artifactId>
            <version>${dependency.karaf.version}</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Dependencies for pax exam karaf container -->
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-container-karaf</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-junit4</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.url</groupId>
            <artifactId>pax-url-aether</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <!-- Needed if you use versionAsInProject() -->
            <plugin>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>depends-maven-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>generate-depends-file</id>
                        <goals>
                            <goal>generate-depends-file</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                   <systemPropertyVariables>
                       <pax.exam.karaf.version>${dependency.karaf.version}</pax.exam.karaf.version>
                   </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
package org.apache.spark.sql.execution.command.v2

import org.apache.spark.SparkConf
import org.apache.spark.sql.AnalysisException
import org.apache.spark.sql.connector.InMemoryTableCatalog
import org.apache.spark.sql.execution.command
import org.apache.spark.sql.test.SharedSparkSession

class ShowPartitionsSuite extends command.ShowPartitionsSuiteBase with SharedSparkSession {
  override def version: String = "V2"
  override def catalog: String = "test_catalog"
  override def defaultNamespace: Seq[String] = Nil
  override def defaultUsing: String = "USING _"

  override def sparkConf: SparkConf = super.sparkConf
    .set(s"spark.sql.catalog.$catalog", classOf[InMemoryTableCatalog].getName)

  // TODO(SPARK-33452): Create a V2 SHOW PARTITIONS execution node
  test("not supported SHOW PARTITIONS") {
    def testV1Command(sqlCommand: String, sqlParams: String): Unit = {
      val e = intercept[AnalysisException] {
        sql(s"$sqlCommand $sqlParams")
      }
      assert(e.message.contains(s"$sqlCommand is only supported with v1 tables"))
    }
    val t = s"$catalog.ns1.ns2.tbl"
    withTable(t) {
      sql(
        s"""
           |CREATE TABLE $t (id bigint, data string)
           |$defaultUsing
           |PARTITIONED BY (id)
         """.stripMargin)

      testV1Command("SHOW PARTITIONS", t)
      testV1Command("SHOW PARTITIONS", s"$t PARTITION(id='1')")
    }
  }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable enable

using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Diagnostics;

namespace Microsoft.CodeAnalysis
{
    internal partial class SolutionState
    {
        private abstract partial class CompilationAndGeneratorDriverTranslationAction
        {
            internal sealed class TouchDocumentAction : CompilationAndGeneratorDriverTranslationAction
            {
                private readonly DocumentState _oldState;
                private readonly DocumentState _newState;

                public TouchDocumentAction(DocumentState oldState, DocumentState newState)
                {
                    _oldState = oldState;
                    _newState = newState;
                }

                public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
                {
                    return UpdateDocumentInCompilationAsync(oldCompilation, _oldState, _newState, cancellationToken);
                }

                public DocumentId DocumentId => _newState.Attributes.Id;
            }

            internal sealed class RemoveDocumentsAction : CompilationAndGeneratorDriverTranslationAction
            {
                private readonly ImmutableArray<DocumentState> _documents;

                public RemoveDocumentsAction(ImmutableArray<DocumentState> documents)
                {
                    _documents = documents;
                }

                public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
                {
                    var syntaxTrees = new List<SyntaxTree>(_documents.Length);
                    foreach (var document in _documents)
                    {
                        cancellationToken.ThrowIfCancellationRequested();
                        syntaxTrees.Add(await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false));
                    }

                    return oldCompilation.RemoveSyntaxTrees(syntaxTrees);
                }
            }

            internal sealed class AddDocumentsAction : CompilationAndGeneratorDriverTranslationAction
            {
                private readonly ImmutableArray<DocumentState> _documents;

                public AddDocumentsAction(ImmutableArray<DocumentState> documents)
                {
                    _documents = documents;
                }

                public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
                {
                    var syntaxTrees = new List<SyntaxTree>(capacity: _documents.Length);
                    foreach (var document in _documents)
                    {
                        cancellationToken.ThrowIfCancellationRequested();
                        syntaxTrees.Add(await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false));
                    }

                    return oldCompilation.AddSyntaxTrees(syntaxTrees);
                }
            }

            internal sealed class ReplaceAllSyntaxTreesAction : CompilationAndGeneratorDriverTranslationAction
            {
                private readonly ProjectState _state;

                public ReplaceAllSyntaxTreesAction(ProjectState state)
                {
                    _state = state;
                }

                public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
                {
                    var syntaxTrees = new List<SyntaxTree>(capacity: _state.DocumentIds.Count);

                    foreach (var documentState in _state.OrderedDocumentStates)
                    {
                        cancellationToken.ThrowIfCancellationRequested();
                        syntaxTrees.Add(await documentState.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false));
                    }

                    return oldCompilation.RemoveAllSyntaxTrees().AddSyntaxTrees(syntaxTrees);
                }
            }

            internal sealed class ProjectCompilationOptionsAction : CompilationAndGeneratorDriverTranslationAction
            {
                private readonly CompilationOptions _options;

                public ProjectCompilationOptionsAction(CompilationOptions options)
                {
                    _options = options;
                }

                public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
                {
                    return Task.FromResult(oldCompilation.WithOptions(_options));
                }
            }

            internal sealed class ProjectAssemblyNameAction : CompilationAndGeneratorDriverTranslationAction
            {
                private readonly string _assemblyName;

                public ProjectAssemblyNameAction(string assemblyName)
                {
                    _assemblyName = assemblyName;
                }

                public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
                {
                    return Task.FromResult(oldCompilation.WithAssemblyName(_assemblyName));
                }
            }

            internal sealed class AddAnalyzerReferencesAction : CompilationAndGeneratorDriverTranslationAction
            {
                private readonly ImmutableArray<AnalyzerReference> _analyzerReferences;

                public AddAnalyzerReferencesAction(ImmutableArray<AnalyzerReference> analyzerReferences)
                {
                    _analyzerReferences = analyzerReferences;
                }

                public override TrackedGeneratorDriver TransformGeneratorDriver(TrackedGeneratorDriver generatorDriver)
                {
                    var generators = _analyzerReferences.SelectMany(a => a.GetGenerators()).ToImmutableArray();
                    return new TrackedGeneratorDriver(generatorDriver.GeneratorDriver?.AddGenerators(generators));
                }
            }

            internal sealed class RemoveAnalyzerReferencesAction : CompilationAndGeneratorDriverTranslationAction
            {
                private readonly ImmutableArray<AnalyzerReference> _analyzerReferences;

                public RemoveAnalyzerReferencesAction(ImmutableArray<AnalyzerReference> analyzerReferences)
                {
                    _analyzerReferences = analyzerReferences;
                }

                public override TrackedGeneratorDriver TransformGeneratorDriver(TrackedGeneratorDriver generatorDriver)
                {
                    var generators = _analyzerReferences.SelectMany(a => a.GetGenerators()).ToImmutableArray();
                    return new TrackedGeneratorDriver(generatorDriver.GeneratorDriver?.RemoveGenerators(generators));
                }
            }

            internal sealed class AddAdditionalDocumentsAction : CompilationAndGeneratorDriverTranslationAction
            {
#pragma warning disable IDE0052 // Remove unread private members
                // PROTOTYPE: right now there is no way to tell a GeneratorDriver that an additional file has been added
                private readonly ImmutableArray<TextDocumentState> _additionalDocuments;
#pragma warning restore IDE0052 // Remove unread private members

                public AddAdditionalDocumentsAction(ImmutableArray<TextDocumentState> additionalDocuments)
                {
                    _additionalDocuments = additionalDocuments;
                }

                public override TrackedGeneratorDriver TransformGeneratorDriver(TrackedGeneratorDriver generatorDriver)
                {
                    // PROTOTYPE: right now there is no way to tell a GeneratorDriver that an additional file has been added
                    // to allow for incremental updates: our only option is to recreate the generator driver from scratch.
                    // return generatorDriver.WithPendingEdits(_additionalDocuments.SelectAsArray(a => (PendingEdit)new AdditionalFileAddedEdit(new AdditionalTextWithState(a))));
                    return new TrackedGeneratorDriver(generatorDriver: null);
                }
            }

            internal sealed class RemoveAdditionalDocumentsAction : CompilationAndGeneratorDriverTranslationAction
            {
#pragma warning disable IDE0052 // Remove unread private members
                // PROTOTYPE: right now there is no way to tell a GeneratorDriver that an additional file has been added
                private readonly ImmutableArray<TextDocumentState> _additionalDocuments;
#pragma warning restore IDE0052 // Remove unread private members

                public RemoveAdditionalDocumentsAction(ImmutableArray<TextDocumentState> additionalDocuments)
                {
                    _additionalDocuments = additionalDocuments;
                }

                public override TrackedGeneratorDriver TransformGeneratorDriver(TrackedGeneratorDriver generatorDriver)
                {
                    // PROTOTYPE: right now there is no way to tell a GeneratorDriver that an additional file has been removed
                    // to allow for incremental updates: our only option is to recreate the generator driver from scratch.
                    // return generatorDriver.WithPendingEdits(_additionalDocuments.SelectAsArray(a => (PendingEdit)new AdditionalFileRemovedEdit(...)));
                    return new TrackedGeneratorDriver(generatorDriver: null);
                }
            }
        }
    }
}


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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.novaordis.playground.jee.ear.war-and-ejb</groupId>
        <artifactId>root</artifactId>
        <version>1</version>
    </parent>

    <artifactId>ear</artifactId>
    <packaging>ear</packaging>

    <build>

        <finalName>war-and-ejb</finalName>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <version>2.10.1</version>
                <configuration>
                    <applicationXml>${basedir}/src/main/resources/META-INF/application.xml</applicationXml>
                    <modules>
                        <ejbModule>
                            <groupId>io.novaordis.playground.jee.ear.war-and-ejb</groupId>
                            <artifactId>ejb</artifactId>
                            <bundleFileName>ejb.jar</bundleFileName>
                        </ejbModule>
                        <webModule>
                            <groupId>io.novaordis.playground.jee.ear.war-and-ejb</groupId>
                            <artifactId>servlet</artifactId>
                            <bundleFileName>servlet.war</bundleFileName>
                        </webModule>
                    </modules>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>io.novaordis.playground.jee.ear.war-and-ejb</groupId>
            <artifactId>ejb</artifactId>
            <type>ejb</type>
            <version>1</version>
        </dependency>
        <dependency>
            <groupId>io.novaordis.playground.jee.ear.war-and-ejb</groupId>
            <artifactId>servlet</artifactId>
            <type>war</type>
            <version>1</version>
        </dependency>
    </dependencies>

</project>


text:
require 'sketchup.rb'

module PolygonCollector
  def collect_model_polygons(model)
    return collect_from_entities(model.entities, Geom::Transformation.new)
  end

  def collect_from_entities(entities, transformation)
    polygons = []
    entities.each do |e|
      collect_from_entity(e).each do |polygon|
        polygons.push polygon.collect { |p| p.transform(transformation) }
      end
    end
    return polygons
  end

  def collect_from_entity(entity)
    return [] if entity.hidden?
    case entity
      when Sketchup::Group
        return [] if entity.attribute_dictionary('solar_integration')
        return collect_from_entities(entity.entities, entity.transformation)
      when Sketchup::ComponentInstance
        return collect_from_entities(entity.definition.entities, entity.transformation)
      when Sketchup::Face
        return collect_from_face(entity)
      else
        return []
    end
  end

  def collect_from_face(face)
    mesh = face.mesh(0)
    return (1..mesh.count_polygons).collect { |i| mesh.polygon_points_at(i) }
  end
end