text:
<#
Copyright 2016 ASOS.com Limited

Licensed 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.
#>

<#
.NAME
	Get-ScriptValidationTestsPath.Tests

.SYNOPSIS
	Pester tests for Get-ScriptValidationPath.
#>
Set-StrictMode -Version Latest

$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
. "$here\$sut"

Describe "Get-ScriptValidationTestsPath" {
	Set-Content "TestDrive:\TestModule.psm1" ". `"$here\$sut`""
	Get-Module TestModule | Remove-Module
	Import-Module "TestDrive:\TestModule.psm1"

	InModuleScope TestModule {
		It "Should return the location of the Script Validation Tests" {
			New-Item -Path "TestDrive:\ScriptValidationTests" -ItemType Directory | Out-Null

			Get-ScriptValidationTestsPath | Should Match "ScriptValidationTests"
		}
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../nom/trait.AsBytes.html">

Redirecting to ../../nom/trait.AsBytes.html...

redpajama_set_name: RedPajamaGithub


text:
package org.springframework.context;

public interface MessageSourceResolvable
{
    String[] getCodes();
    default Object[] getArguments(){ return null; }
    default String getDefaultMessage(){ return null; }
}


text:
import unittest
import paddle
import paddle.fluid.layers as layers
from paddle.fluid.executor import Executor
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid.backward import append_backward
import numpy
from paddle.fluid import compiler, Program, program_guard

paddle.enable_static()

class TestWhileOp(unittest.TestCase):
    def simple_net(self):
        d0 = layers.data(
            "d0", shape=[10], append_batch_size=False, dtype='float32'
        )
        d1 = layers.data(
            "d1", shape=[10], append_batch_size=False, dtype='float32'
        )
        d2 = layers.data(
            "d2", shape=[10], append_batch_size=False, dtype='float32'
        )
        # fill_constant npu op doesn't support int64
        i = layers.zeros(shape=[1], dtype='int32')
        i = layers.cast(i, 'int64')
        i.stop_gradient = True
        init = layers.zeros(shape=[10], dtype='float32')
        mem_array = layers.array_write(x=init, i=i)
        data_array = layers.array_write(x=d0, i=i)
        i = layers.increment(i)
        layers.array_write(d1, i, array=data_array)
        i = layers.increment(i)
        layers.array_write(d2, i, array=data_array)
        i = layers.zeros(shape=[1], dtype='int32')
        i = layers.cast(i, 'int64')
        i.stop_gradient = True
        array_len = layers.fill_constant(shape=[1], dtype='int32', value=5)
        array_len = layers.cast(array_len, 'int64')
        array_len.stop_gradient = True
        cond = layers.ones(shape=[1], dtype='int32')
        cond = layers.cast(cond, 'bool')
        j = layers.fill_constant(shape=[1], dtype='int32', value=1)
        j = layers.cast(j, 'int64')
        j.stop_gradient = True
        array_len2 = layers.fill_constant(shape=[1], dtype='int32', value=3)
        array_len2 = layers.cast(array_len2, 'int64')
        array_len2.stop_gradient = True
        cond2 = paddle.logical_or(x=j, y=array_len2)
        cond2 = layers.ones(shape=[1], dtype='int32')
        cond2 = layers.cast(cond2, 'bool')
        while_op = layers.While(cond=cond)
        while_op2 = layers.While(cond=cond2)
        with while_op.block():
            d = layers.array_read(array=data_array, i=i)
            prev = layers.array_read(array=mem_array, i=i)
            result = layers.sums(input=[d, prev])

            i = layers.increment(x=i, in_place=True)
            layers.array_write(result, i=i, array=mem_array)
            layers.less_than(x=i, y=array_len, cond=cond)

            with while_op2.block():
                d2 = layers.array_read(array=data_array, i=j)
                prev2 = layers.array_read(array=mem_array, i=j)
                result2 = layers.sums(input=[d2, prev2])

                j = layers.increment(x=j, in_place=True)
                layers.array_write(result2, i=j, array=mem_array)
                layers.less_than(x=j, y=array_len2, cond=cond2)
        sum_result = layers.array_read(array=mem_array, i=j)
        loss = paddle.mean(sum_result)
        return loss, sum_result

    def test_simple_net(self):
        paddle.enable_static()
        main_program = fluid.Program()
        startup_program = fluid.Program()
        with fluid.program_guard(main_program, startup_program):
            loss, sum_result = self.simple_net()

            append_backward(loss)

            npu_place = paddle.NPUPlace(0)
            exe = Executor(npu_place)
            d = []

            for i in range(3):
                d.append(numpy.random.random(size=[10]).astype('float32'))

            outs = exe.run(
                feed={'d0': d[0], 'd1': d[1], 'd2': d[2]},
                fetch_list=[sum_result],
            )
            self.assertAlmostEqual(numpy.sum(d), numpy.sum(outs[0]), delta=0.01)

    def test_simple_net_forward(self):
        paddle.enable_static()
        main_program = fluid.Program()
        startup_program = fluid.Program()
        with fluid.program_guard(main_program, startup_program):
            self.simple_net()

            npu_place = paddle.NPUPlace(0)
            exe = Executor(npu_place)
            d = []

            for i in range(3):
                d.append(numpy.random.random(size=[10]).astype('float32'))

            for _ in range(2):
                exe.run(main_program, feed={'d0': d[0], 'd1': d[1], 'd2': d[2]})

if __name__ == '__main__':
    unittest.main()


text:
package org.hippoecm.repository.decorating.remote;

import java.io.Serializable;
import java.rmi.Remote;
import java.rmi.RemoteException;

import javax.jcr.InvalidItemStateException;
import javax.jcr.RepositoryException;

import org.apache.jackrabbit.rmi.remote.RemoteItem;
import org.apache.jackrabbit.rmi.remote.RemoteNode;

public interface RemoteHierarchyResolver extends Remote {

    public class RemoteHierarchyResult implements Serializable {
        public RemoteItem item;
        public RemoteNode node;
        public String relPath;
    }

    public RemoteHierarchyResult getItem(String ancestor, String path, boolean isProperty)
        throws InvalidItemStateException, RepositoryException, RemoteException;
}


text:
({
	iframeEditTitle: 'область редактирования',  // primary title for editable IFRAME, for screen readers
	iframeFocusTitle: 'фрейм области редактирования'  // secondary title for editable IFRAME when focus is on outer container
									 //  to let user know that focus has moved out of editing area and to the
									 //  parent element of the editing area
})


text:
""" 'editor' hooks for common editors that work well with ipython

They should honor the line number argument, at least.

Contributions are *very* welcome.
"""
from __future__ import print_function

import os
import pipes
import shlex
import subprocess
import sys

from IPython import get_ipython
from IPython.core.error import TryNext
from IPython.utils import py3compat

def install_editor(template, wait=False):
    """Installs the editor that is called by IPython for the %edit magic.

    This overrides the default editor, which is generally set by your EDITOR
    environment variable or is notepad (windows) or vi (linux). By supplying a
    template string `run_template`, you can control how the editor is invoked
    by IPython -- (e.g. the format in which it accepts command line options)

    Parameters
    ----------
    template : basestring
        run_template acts as a template for how your editor is invoked by
        the shell. It should contain '{filename}', which will be replaced on
        invokation with the file name, and '{line}', $line by line number
        (or 0) to invoke the file with.
    wait : bool
        If `wait` is true, wait until the user presses enter before returning,
        to facilitate non-blocking editors that exit immediately after
        the call.
    """

    # not all editors support $line, so we'll leave out this check
    # for substitution in ['$file', '$line']:
    #    if not substitution in run_template:
    #        raise ValueError(('run_template should contain %s'
    #        ' for string substitution. You supplied "%s"' % (substitution,
    #            run_template)))

    def call_editor(self, filename, line=0):
        if line is None:
            line = 0
        cmd = template.format(filename=pipes.quote(filename), line=line)
        print(">", cmd)
        # pipes.quote doesn't work right on Windows, but it does after splitting
        if sys.platform.startswith('win'):
            cmd = shlex.split(cmd)
        proc = subprocess.Popen(cmd, shell=True)
        if proc.wait() != 0:
            raise TryNext()
        if wait:
            py3compat.input("Press Enter when done editing:")

    get_ipython().set_hook('editor', call_editor)
    get_ipython().editor = template

# in these, exe is always the path/name of the executable. Useful
# if you don't have the editor directory in your path
def komodo(exe=u'komodo'):
    """ Activestate Komodo [Edit] """
    install_editor(exe + u' -l {line} {filename}', wait=True)

def scite(exe=u"scite"):
    """ SciTE or Sc1 """
    install_editor(exe + u' {filename} -goto:{line}')

def notepadplusplus(exe=u'notepad++'):
    """ Notepad++ http://notepad-plus.sourceforge.net """
    install_editor(exe + u' -n{line} {filename}')

def jed(exe=u'jed'):
    """ JED, the lightweight emacsish editor """
    install_editor(exe + u' +{line} {filename}')

def idle(exe=u'idle'):
    """ Idle, the editor bundled with python

    Parameters
    ----------
    exe : str, None
        If none, should be pretty smart about finding the executable.
    """
    if exe is None:
        import idlelib
        p = os.path.dirname(idlelib.__filename__)
        # i'm not sure if this actually works. Is this idle.py script
        # guarenteed to be executable?
        exe = os.path.join(p, 'idle.py')
    install_editor(exe + u' {filename}')

def mate(exe=u'mate'):
    """ TextMate, the missing editor"""
    # wait=True is not required since we're using the -w flag to mate
    install_editor(exe + u' -w -l {line} {filename}')

# ##########################################
# these are untested, report any problems
# ##########################################

def emacs(exe=u'emacs'):
    install_editor(exe + u' +{line} {filename}')

def gnuclient(exe=u'gnuclient'):
    install_editor(exe + u' -nw +{line} {filename}')

def crimson_editor(exe=u'cedt.exe'):
    install_editor(exe + u' /L:{line} {filename}')

def kate(exe=u'kate'):
    install_editor(exe + u' -u -l {line} {filename}')


text:
package cn.binarywang.wx.miniapp.bean.product;

import java.io.Serializable;
import lombok.Data;

/**
 * @author leiin
 * created on  2022/6/20 4:36 下午
 */
@Data
public class WxMinishopSpuGet implements Serializable {

  private static final long serialVersionUID = -957810527714924409L;

  private WxMinishopSpu spu;
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Amicale Gil</title>

    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link href="bootstrap-sass-3.3.6/stylesheets/styles.css" rel="stylesheet">

            <button class="navbar-brand hamburger">

            </button>

            AGIL

                             Profil

                         Paramètre de profil

                         Déconnexion

Navigation

                    Accueil

                    Annonces

                    Hall

                    Salon

                    Agenda

Liens utiles

Ent

Webmail

                        Changer ma photo

Jean Neige

                            Informations générales

Adresse mail : jeanneige@lycos.fr

                                    <form method="POST" action="#">

                                            Modifier l'adresse email :

@

                                                <input type="email" class="form-control" name="email" id="email">

                                        <input type="submit" class="btn btn-primary" value="Validez">
                                    </form>

Pseudo : jndu76

                                    <form method="POST" action="#">

                                            Modifier le pseudo :

                                                <input class="form-control" type="text" name="pseudo" id="pseudo">

                                        <input type="submit" class="btn btn-primary" value="Validez">
                                    </form>

CV : lien du cv

                                    <form method="POST" action="#">

                                            Modifier le cv :

                                                <input class="form-control" type="text" name="cv" id="cv" placeholder="lien vers cv">

                                        <input type="submit" class="btn btn-primary" value="Validez">
                                    </form>

                            Compétences

                    PHP
                    JAVA
                    SYMFONY
                    PHPSTORM
                    (Ajouter, modier ou supprimer)

                    Copyright université de rouen. Site développé par sept étudiants de l'université de rouen
                    dans le cadre d'un projet universitaire.


text:
package testhelpers

import (
	"github.com/getcarina/carina/common"
	"github.com/stretchr/testify/mock"
)

type MockClusterService struct {
	common.ClusterService
	mock.Mock
}

func (mock *MockClusterService) ListClusterTemplates() ([]common.ClusterTemplate, error) {
	args := mock.Called()
	return args.Get(0).([]common.ClusterTemplate), nil
}

type StubClusterTemplate struct {
	Name     string
	COE      string
	HostType string
}

func (stub *StubClusterTemplate) GetName() string {
	return stub.Name
}

func (stub *StubClusterTemplate) GetCOE() string {
	return stub.COE
}

func (stub *StubClusterTemplate) GetHostType() string {
	return stub.HostType
}


text:
module Canary
  module Mutations
    class UnselectProgram < Canary::Mutations::Base
      argument :work_id, ID, required: true

      field :library_entry, Canary::Types::Objects::LibraryEntryType, null: true

      def resolve(work_id:)
        raise Annict::Errors::InvalidAPITokenScopeError unless context[:writable]

        viewer = context[:viewer]
        work = Canary::AnnictSchema.object_from_id(work_id)

        library_entry = viewer.library_entries.find_by(work_id: work.id)

        unless library_entry
          return {}
        end

        library_entry.update!(program_id: nil)

        {
          library_entry: library_entry
        }
      end
    end
  end
end


text:
layout: activity
name:  "Texas Rowing Center"
address: 1541 W Cesar Chavez St, Austin, TX 78703
website: http://www.texasrowingcenter.com/
downtown_walkable: no
lat: 30.2722664
lng: -97.76889089999997
---

If you want to row, kayak, paddleboard, canoe, or any other water activity— this is the place to go.


text:
using System.Net;
using FluentAssertions;
using JetBrains.Annotations;

namespace TestBuildingBlocks;

[PublicAPI]
public static class HttpResponseMessageExtensions
{
    public static void ShouldHaveStatusCode(this HttpResponseMessage source, HttpStatusCode statusCode)
    {
        // In contrast to the built-in assertion method, this one dumps the response body on mismatch.
        // See https://github.com/fluentassertions/fluentassertions/issues/1811.

        if (source.StatusCode != statusCode)
        {
            string responseText = source.Content.ReadAsStringAsync().Result;
            source.StatusCode.Should().Be(statusCode, string.IsNullOrEmpty(responseText) ? null : $"response body returned was:\n{responseText}");
        }
    }
}


text:
<?php

namespace LidskaSila\Glow\EventStore;

use LidskaSila\Glow\DomainEvent;
use PHPUnit\Framework\TestCase;
use Ramsey\Uuid\Uuid;

class EventStreamTest extends TestCase
{

	/**
	 * @test
	 */
	public function it_requires_uuid()
	{
		$uuid   = Uuid::uuid4();
		$stream = new EventStream('stdClass', $uuid);

		self::assertSame($uuid, $stream->getUuid());
	}

	/**
	 * @test
	 */
	public function it_allows_adding_events()
	{
		$event = \Mockery::mock(DomainEvent::class);

		$uuid   = Uuid::uuid4();
		$stream = new EventStream('stdClass', $uuid);
		$stream->addEvent($event);

		$actualEvents = iterator_to_array($stream);

		self::assertSame($event, $actualEvents[0]);
	}

	/**
	 * @test
	 */
	public function it_keeps_new_events_seperate_from_known_events()
	{
		$oldEvent = \Mockery::mock(DomainEvent::class);
		$newEvent = \Mockery::mock(DomainEvent::class);

		$uuid   = Uuid::uuid4();
		$stream = new EventStream('stdClass', $uuid, [ $oldEvent ]);
		$stream->addEvent($newEvent);

		$actualEvents = iterator_to_array($stream);

		self::assertSame($oldEvent, $actualEvents[0]);
		self::assertSame($newEvent, $actualEvents[1]);

		$actualNewEvents = $stream->newEvents();

		self::assertEquals(1, count($actualNewEvents));
	}

	/**
	 * @test
	 */
	public function it_can_mark_new_events_as_processed()
	{
		$newEvent = \Mockery::mock(DomainEvent::class);

		$uuid   = Uuid::uuid4();
		$stream = new EventStream('stdClass', $uuid, []);
		$stream->addEvent($newEvent);

		$stream->markNewEventsProcessed();

		self::assertEquals(0, count($stream->newEvents()));
	}
}


text:
var data = require('../data.json');

exports.view = function(req, res) {
	//controller code goes here
	res.render('eventsummary', data);
};


text:
/**
 *
 */
package org.sword.ocean.common.utils;

import java.sql.Connection;
import java.sql.SQLException;

import javax.annotation.Resource;
import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.sword.ocean.common.enumType.DataSourceEnum;

/**
 * DB适配器
 * @author ChengNing
 * @date   2015年3月23日
 */
@Service
public class DBAdapter {

	@Resource
    private DataSource dataSource;//
	@Resource
	private DataSource oceanDataSource;
	@Resource
	private JdbcTemplate jdbcTemplate;

	public DBAdapter() {
	}

	public Connection getConnection(DataSourceEnum ds) throws SQLException {
//		this.datasource = jdbcTemplate.getDataSource();
		Connection conn = null;
		if(ds == null)
			return this.dataSource.getConnection();
		switch (ds) {
			case OCEAN:{
				conn=this.oceanDataSource.getConnection();
				break;
			}
			default:
				conn=this.dataSource.getConnection();;
				break;
		}
		return conn;
	}

}


text:
@(user: models.admin.RichUser, ticket: models.entities.TicketDocument)
@import helper._
@import models.CurrencyFormat

@orderRow(user: models.entities.User, ticketOrder: models.entities.TicketOrderDetail)= {
@showName(ticketOrder.show)

    @defining(ticketOrder.ticketSeatOrders.map(_.ticketSeatOrder.seat.name).sorted.grouped(5).map(_.mkString(", ")).toSeq) { groupedSeats =>
    @groupedSeats.tail.foldLeft(Html(groupedSeats.head)) { (result, seat) =>
    @result
@seat
    }
    }

@ticketOrder.ticketSeatOrders.length
@CurrencyFormat.format(ticketOrder.price)
}

Beste @user.name,

In bijlage vind je de e-tickets van je bestelling.

Factuurgegevens

            @ticket.order.order.billingName

            @newlines(ticket.order.billingAddressLines)

Bestelling

                Datum
                Voorstelling
                Plaatsen
                Aantal
                Prijs

            @defining(ticket.order.ticketOrders match { case head :: tail => (Some(head), tail); case _ => (None, Nil) }) { tuple =>
            @defining(tuple._1) { first =>
            @defining(tuple._2) { tail =>
            @first match {
            case Some(first) => {

                @HumanDateTime.formatDateCompact(ticket.order.order.date)
                @orderRow(ticket.order.user, first)

            }
            case None => { }
            }
            @tail.map { ticketOrder =>

                @orderRow(ticket.order.user, ticketOrder)

            }
            }
            }
            }

Deze tickets gelden als toegangsbewijs. Je dient ze af te drukken en mee te brengen naar de voorstelling.

Tot binnenkort,

        @emailFooter()


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="Catalog" table="catalog">
    <id name="id" type="integer" column="id">
      <generator strategy="IDENTITY"/>
    </id>
    <field name="name" type="string" column="name" length="100" nullable="false"/>
    <field name="descr" type="string" column="descr" length="1024" nullable="false"/>
    <field name="price" type="integer" column="price" nullable="false"/>
    <field name="category" type="integer" column="category" nullable="false"/>
    <field name="parent" type="integer" column="parent" nullable="false"/>
  </entity>
</doctrine-mapping>


text:
namespace System.IdentityModel.Tokens
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;

    /// <summary>
    /// Represents the AudienceRestriction element specified in [Saml2Core, 2.5.1.4].
    /// </summary>
    /// <remarks>
    /// If the Audiences collection is empty, an InvalidOperationException will be
    /// thrown during serialization.
    /// </remarks>
    public class Saml2AudienceRestriction
    {
        private Collection<Uri> audiences = new Collection<Uri>();

        /// <summary>
        /// Creates an instance of Saml2AudienceRestriction.
        /// </summary>
        public Saml2AudienceRestriction()
        {
        }

        /// <summary>
        /// Creates an instance of Saml2AudienceRestriction.
        /// </summary>
        /// <param name="audience">The audience element contained in this restriction.</param>
        public Saml2AudienceRestriction(Uri audience)
            : this(new Uri[] { audience })
        {
        }

        /// <summary>
        /// Creates an instance of Saml2AudienceRestriction.
        /// </summary>
        /// <param name="audiences">The collection of audience elements contained in this restriction.</param>
        public Saml2AudienceRestriction(IEnumerable<Uri> audiences)
        {
            if (null == audiences)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("audiences");
            }

            foreach (Uri audience in audiences)
            {
                if (null == audience)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("audiences");
                }

                this.audiences.Add(audience);
            }
        }

        /// <summary>
        /// Gets the audiences for which the assertion is addressed.
        /// </summary>
        public Collection<Uri> Audiences
        {
            get { return this.audiences; }
        }
    }
}