text:
$ModuleName = 'PSCodeHealth'
Import-Module "$PSScriptRoot\..\..\$ModuleName\$($ModuleName).psd1" -Force
$CodePath = "$PSScriptRoot\..\TestData\coveralls"

Describe 'Test-PSCodeHealthCompliance' {

    $CoverallsHealthReport = Invoke-PSCodeHealth -Path $CodePath

    Context 'Given code in coveralls module, it returns the expected compliance results' {

        $Result = $CoverallsHealthReport | Test-PSCodeHealthCompliance
        $LinesOfCode = $Result.Where({$_.MetricName -eq 'LinesOfCode'})
        $ScriptAnalyzerFindings = $Result.Where({$_.MetricName -eq 'ScriptAnalyzerFindings'})
        $TestCoverage = $Result.Where({$_.MetricName -eq 'TestCoverage'})
        $CommandsMissed = $Result.Where({$_.MetricName -eq 'CommandsMissed'})
        $Complexity = $Result.Where({$_.MetricName -eq 'Complexity'})
        $MaximumNestingDepth = $Result.Where({$_.MetricName -eq 'MaximumNestingDepth'})
        $LinesOfCodeTotal = $Result.Where({$_.MetricName -eq 'LinesOfCodeTotal'})
        $LinesOfCodeAverage = $Result.Where({$_.MetricName -eq 'LinesOfCodeAverage'})
        $ScriptAnalyzerFindingsTotal = $Result.Where({$_.MetricName -eq 'ScriptAnalyzerFindingsTotal'})
        $NumberOfFailedTests = $Result.Where({$_.MetricName -eq 'NumberOfFailedTests'})
        $TestsPassRate = $Result.Where({$_.MetricName -eq 'TestsPassRate'})
        $CommandsMissedTotal = $Result.Where({$_.MetricName -eq 'CommandsMissedTotal'})
        $ComplexityAverage = $Result.Where({$_.MetricName -eq 'ComplexityAverage'})
        $ComplexityHighest = $Result.Where({$_.MetricName -eq 'ComplexityHighest'})
        $NestingDepthAverage = $Result.Where({$_.MetricName -eq 'NestingDepthAverage'})
        $NestingDepthHighest = $Result.Where({$_.MetricName -eq 'NestingDepthHighest'})

        It 'Should return correct value for the metric : LinesOfCode' {
            $LinesOfCode.Value | Should Be 39
        }
        It 'Should return correct compliance result for the metric : LinesOfCode' {
            $LinesOfCode.Result | Should Be 'Warning'
        }
        It 'Should return correct value for the metric : ScriptAnalyzerFindings' {
            $ScriptAnalyzerFindings.Value | Should Be 2
        }
        It 'Should return correct compliance result for the metric : ScriptAnalyzerFindings' {
            $ScriptAnalyzerFindings.Result | Should Be 'Pass'
        }
        It 'Should return correct value for the metric : TestCoverage' {
            ($TestCoverage | Where-Object SettingsGroup -eq 'PerFunctionMetrics').Value |
            Should Be 0
        }
        It 'Should return correct compliance result for the metric : TestCoverage' {
            ($TestCoverage | Where-Object SettingsGroup -eq 'PerFunctionMetrics').Result |
            Should Be 'Fail'
        }
        It 'Should return correct value for the metric : CommandsMissed' {
            $CommandsMissed.Value | Should Be 20
        }
        It 'Should return correct compliance result for the metric : CommandsMissed' {
            $CommandsMissed.Result | Should Be 'Fail'
        }
        It 'Should return correct value for the metric : Complexity' {
            $Complexity.Value | Should Be 5
        }
        It 'Should return correct compliance result for the metric : Complexity' {
            $Complexity.Result | Should Be 'Pass'
        }
        It 'Should return correct value for the metric : MaximumNestingDepth' {
            $MaximumNestingDepth.Value | Should Be 3
        }
        It 'Should return correct compliance result for the metric : MaximumNestingDepth' {
            $MaximumNestingDepth.Result | Should Be 'Pass'
        }
        It 'Should return correct value for the metric : LinesOfCodeTotal' {
            $LinesOfCodeTotal.Value | Should Be 204
        }
        It 'Should return correct compliance result for the metric : LinesOfCodeTotal' {
            $LinesOfCodeTotal.Result | Should Be 'Pass'
        }
        It 'Should return correct value for the metric : LinesOfCodeAverage' {
            $LinesOfCodeAverage.Value | Should Be 22.67
        }
        It 'Should return correct compliance result for the metric : LinesOfCodeAverage' {
            $LinesOfCodeAverage.Result | Should Be 'Pass'
        }
        It 'Should return correct value for the metric : ScriptAnalyzerFindingsTotal' {
            $ScriptAnalyzerFindingsTotal.Value | Should Be 4
        }
        It 'Should return correct compliance result for the metric : ScriptAnalyzerFindingsTotal' {
            $ScriptAnalyzerFindingsTotal.Result | Should Be 'Pass'
        }
        It 'Should return correct value for the metric : NumberOfFailedTests' {
            $NumberOfFailedTests.Value | Should Be 2
        }
        It 'Should return correct compliance result for the metric : NumberOfFailedTests' {
            $NumberOfFailedTests.Result | Should Be 'Warning'
        }
        It 'Should return correct value for the metric : TestsPassRate' {
            $TestsPassRate.Value | Should Be 84.62
        }
        It 'Should return correct compliance result for the metric : TestsPassRate' {
            $TestsPassRate.Result | Should Be 'Fail'
        }
        It 'Should return correct value for the metric : TestCoverage' {
            ($TestCoverage | Where-Object SettingsGroup -eq 'OverallMetrics').Value |
            Should Be 39.6
        }
        It 'Should return correct compliance result for the metric : TestCoverage' {
            ($TestCoverage | Where-Object SettingsGroup -eq 'OverallMetrics').Result |
            Should Be 'Fail'
        }
        It 'Should return correct value for the metric : CommandsMissedTotal' {
            $CommandsMissedTotal.Value | Should Be 61
        }
        It 'Should return correct compliance result for the metric : CommandsMissedTotal' {
            $CommandsMissedTotal.Result | Should Be 'Pass'
        }
        It 'Should return correct value for the metric : ComplexityAverage' {
            $ComplexityAverage.Value | Should Be 2
        }
        It 'Should return correct compliance result for the metric : ComplexityAverage' {
            $ComplexityAverage.Result | Should Be 'Pass'
        }
        It 'Should return correct value for the metric : ComplexityHighest' {
            $ComplexityHighest.Value | Should Be 5
        }
        It 'Should return correct compliance result for the metric : ComplexityHighest' {
            $ComplexityHighest.Result | Should Be 'Pass'
        }
        It 'Should return correct value for the metric : NestingDepthAverage' {
            $NestingDepthAverage.Value | Should Be 1.11
        }
        It 'Should return correct compliance result for the metric : NestingDepthAverage' {
            $NestingDepthAverage.Result | Should Be 'Pass'
        }
        It 'Should return correct value for the metric : NestingDepthHighest' {
            $NestingDepthHighest.Value | Should Be 3
        }
        It 'Should return correct compliance result for the metric : NestingDepthHighest' {
            $NestingDepthHighest.Result | Should Be 'Pass'
        }
    }
    Context 'Given code in coveralls module, it returns the expected compliance summary result' {

        $Result = $CoverallsHealthReport | Test-PSCodeHealthCompliance -Summary

        It 'Should return "Fail"' {
            $Result | Should Be 'Fail'
        }
    }
    Context 'Given code in coveralls module and specific metric names, it returns the expected compliance summary result' {

        $Result = $CoverallsHealthReport | Test-PSCodeHealthCompliance -MetricName Complexity,ComplexityAverage,NestingDepthAverage -Summary

        It 'Should return "Pass"' {
            $Result | Should Be 'Pass'
        }
    }
}


text: require './config/environment'

redpajama_set_name: RedPajamaGithub


text:
test_description='git svn authors prog tests'

. ./lib-git-svn.sh

write_script svn-authors-prog "$PERL_PATH" <<-\EOF
	$_ = shift;
	if (s/-hermit//) {
		print "$_ <>\n";
	} elsif (s/-sub$//)  {
		print "$_ <$_\@sub.example.com>\n";
	} else {
		print "$_ <$_\@example.com>\n";
	}
EOF

test_expect_success 'svn-authors setup' '
	cat >svn-authors <<-\EOF
	ff = FFFFFFF FFFFFFF <fFf@other.example.com>
	EOF
'

test_expect_success 'setup svnrepo' '
	for i in aa bb cc-sub dd-sub ee-foo ff
	do
		svn mkdir -m $i --username $i "$svnrepo"/$i
	done
'

test_expect_success 'import authors with prog and file' '
	git svn clone --authors-prog=./svn-authors-prog \
	    --authors-file=svn-authors "$svnrepo" x
'

test_expect_success 'imported 6 revisions successfully' '
	(
		cd x &&
		git rev-list refs/remotes/git-svn >actual &&
		test_line_count = 6 actual
	)
'

test_expect_success 'authors-prog ran correctly' '
	(
		cd x &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&
		grep "^author ee-foo <ee-foo@example\.com> " actual &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~2 >actual &&
		grep "^author dd <dd@sub\.example\.com> " actual &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~3 >actual &&
		grep "^author cc <cc@sub\.example\.com> " actual &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~4 >actual &&
		grep "^author bb <bb@example\.com> " actual &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~5 >actual &&
		grep "^author aa <aa@example\.com> " actual
	)
'

test_expect_success 'authors-file overrode authors-prog' '
	(
		cd x &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&
		grep "^author FFFFFFF FFFFFFF <fFf@other\.example\.com> " actual
	)
'

git --git-dir=x/.git config --unset svn.authorsfile
git --git-dir=x/.git config --unset svn.authorsprog

test_expect_success 'authors-prog imported user without email' '
	svn mkdir -m gg --username gg-hermit "$svnrepo"/gg &&
	(
		cd x &&
		git svn fetch --authors-prog=../svn-authors-prog &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn | \
		  grep "^author gg <> "
	)
'

test_expect_success 'imported without authors-prog and authors-file' '
	svn mkdir -m hh --username hh "$svnrepo"/hh &&
	(
		uuid=$(svn info "$svnrepo" |
			sed -n "s/^Repository UUID: //p") &&
		cd x &&
		git svn fetch &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn | \
		  grep "^author hh <hh@$uuid> "
	)
'

test_expect_success 'authors-prog handled special characters in username' '
	svn mkdir -m bad --username "xyz; touch evil" "$svnrepo"/bad &&
	(
		cd x &&
		git svn --authors-prog=../svn-authors-prog fetch &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&
		grep "^author xyz; touch evil <xyz; touch evil@example\.com> " actual &&
		! test -f evil
	)
'

test_done


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Handb. Allgem. mykol. (Stuttgart) 113 (1851)

#### Original name
Periconia pyriformis Bonord.

### Remarks
null


text:
package com.lzc.daliylife.entity.mob;

/**
 * Created by lzc on 2017/3/10.
 */

public class LaoHuangLiEntity {
    String msg;//返回信息
    String retCode;//返回码
    LaoHuangLiEntity.Result result;//返回结果集

    @Override
    public String toString() {
        return "LaoHuangliEntity{" +
                "msg='" + msg + '\'' +
                ", retCode='" + retCode + '\'' +
                ", result=" + result +
                '}';
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getRetCode() {
        return retCode;
    }

    public void setRetCode(String retCode) {
        this.retCode = retCode;
    }

    public LaoHuangLiEntity.Result getResult() {
        return result;
    }

    public void setResult(LaoHuangLiEntity.Result result) {
        this.result = result;
    }

    public class Result{
        String avoid;//不宜
        String date;//查询日期
        String jishen;//吉煞
        String lunar;//农历日期
        String suit;//宜
        String xiongshen;//凶煞

        @Override
        public String toString() {
            return "Result{" +
                    "avoid='" + avoid + '\'' +
                    ", date='" + date + '\'' +
                    ", jishen='" + jishen + '\'' +
                    ", lunar='" + lunar + '\'' +
                    ", suit='" + suit + '\'' +
                    ", xiongshen='" + xiongshen + '\'' +
                    '}';
        }

        public String getAvoid() {
            return avoid;
        }

        public void setAvoid(String avoid) {
            this.avoid = avoid;
        }

        public String getDate() {
            return date;
        }

        public void setDate(String date) {
            this.date = date;
        }

        public String getJishen() {
            return jishen;
        }

        public void setJishen(String jishen) {
            this.jishen = jishen;
        }

        public String getLunar() {
            return lunar;
        }

        public void setLunar(String lunar) {
            this.lunar = lunar;
        }

        public String getSuit() {
            return suit;
        }

        public void setSuit(String suit) {
            this.suit = suit;
        }

        public String getXiongshen() {
            return xiongshen;
        }

        public void setXiongshen(String xiongshen) {
            this.xiongshen = xiongshen;
        }
    }
}


text:
/*
 * File:   Robber.h
 * Author: brandon
 *
 * Created on May 3, 2011, 10:03 PM
 */

#ifndef ROBBER_H
#define	ROBBER_H
#include "GamePiece.h"
#include "Tile.h"

class Robber : public GamePiece{
public:
    Robber(Tile* tile);
    Robber(const Robber& orig);
    virtual ~Robber();

    void moveTo(Tile* tile);
    void Draw();
    bool Update();

private:
    void parabolicMove();
    Vector3f position;
    Vector3f target;
    Tile* currentTile;
};

#endif	/* ROBBER_H */


text:
package org.apache.maven.project;

import java.io.File;
import java.io.FileNotFoundException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Arrays;

import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.building.ModelBuildingException;
import org.apache.maven.model.building.ModelProblem;
import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.codehaus.plexus.testing.PlexusTest;
import org.codehaus.plexus.PlexusContainer;
import org.eclipse.aether.DefaultRepositoryCache;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.junit.jupiter.api.BeforeEach;

import javax.inject.Inject;

/**
 * @author Jason van Zyl
 */
@PlexusTest
public abstract class AbstractMavenProjectTestCase
{
    protected ProjectBuilder projectBuilder;

    @Inject
    protected RepositorySystem repositorySystem;

    @Inject
    protected PlexusContainer container;

    public PlexusContainer getContainer() {
        return container;
    }

    @BeforeEach
    public void setUp()
        throws Exception
    {
        if ( getContainer().hasComponent( ProjectBuilder.class, "test" ) )
        {
            projectBuilder = getContainer().lookup( ProjectBuilder.class, "test" );
        }
        else
        {
            // default over to the main project builder...
            projectBuilder = getContainer().lookup( ProjectBuilder.class );
        }
    }

    protected ProjectBuilder getProjectBuilder()
    {
        return projectBuilder;
    }

    // ----------------------------------------------------------------------
    // Local repository
    // ----------------------------------------------------------------------

    protected File getLocalRepositoryPath()
        throws FileNotFoundException, URISyntaxException
    {
        File markerFile = getFileForClasspathResource( "local-repo/marker.txt" );

        return markerFile.getAbsoluteFile().getParentFile();
    }

    protected static File getFileForClasspathResource( String resource )
        throws FileNotFoundException
    {
        ClassLoader cloader = Thread.currentThread().getContextClassLoader();

        URL resourceUrl = cloader.getResource( resource );

        if ( resourceUrl == null )
        {
            throw new FileNotFoundException( "Unable to find: " + resource );
        }

        return new File( URI.create( resourceUrl.toString().replaceAll( " ", "%20" ) ) );
    }

    protected ArtifactRepository getLocalRepository()
        throws Exception
    {
        return repositorySystem.createLocalRepository( getLocalRepositoryPath() );
    }

    // ----------------------------------------------------------------------
    // Project building
    // ----------------------------------------------------------------------

    protected MavenProject getProjectWithDependencies( File pom )
        throws Exception
    {
        ProjectBuildingRequest configuration = newBuildingRequest();
        configuration.setRemoteRepositories( Arrays.asList( new ArtifactRepository[] {} ) );
        configuration.setProcessPlugins( false );
        configuration.setResolveDependencies( true );

        try
        {
            return projectBuilder.build( pom, configuration ).getProject();
        }
        catch ( Exception e )
        {
            Throwable cause = e.getCause();
            if ( cause instanceof ModelBuildingException )
            {
                String message = "In: " + pom + "\n\n";
                for ( ModelProblem problem : ( (ModelBuildingException) cause ).getProblems() )
                {
                    message += problem + "\n";
                }
                System.out.println( message );
            }

            throw e;
        }
    }

    protected MavenProject getProject( File pom )
        throws Exception
    {
        ProjectBuildingRequest configuration = newBuildingRequest();

        return projectBuilder.build( pom, configuration ).getProject();
    }

    protected MavenProject getProjectFromRemoteRepository( final File pom )
        throws Exception
    {
        final ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
        configuration.setLocalRepository( this.getLocalRepository() );
        configuration.setRemoteRepositories( Arrays.asList( this.repositorySystem.createDefaultRemoteRepository() ) );
        initRepoSession( configuration );

        return projectBuilder.build( pom, configuration ).getProject();
    }

    protected ProjectBuildingRequest newBuildingRequest()
        throws Exception
    {
        ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
        configuration.setLocalRepository( getLocalRepository() );
        initRepoSession( configuration );
        return configuration;
    }

    protected void initRepoSession( ProjectBuildingRequest request )
    {
        File localRepo = new File( request.getLocalRepository().getBasedir() );
        DefaultRepositorySystemSession repoSession = MavenRepositorySystemUtils.newSession();
        repoSession.setCache( new DefaultRepositoryCache() );
        repoSession.setLocalRepositoryManager( new LegacyLocalRepositoryManager( localRepo ) );
        request.setRepositorySession( repoSession );
    }

}


text:
ContId=`docker inspect --format='{{.Id}}' $1`
echo system container id $ContId >>/tmp/system_clean.log

src=/var/lib/docker/containers/${ContId}/${ContId}-json.log
dest=/var/log/engines/raw/${ContId}-json.last

if test -f $dest
 then
 	rm $dest
 fi
echo mv $src $dest  &>>/tmp/system_clean.log
if test -f $src
 then
	cp $src $dest  &>>/tmp/system_clean.log
	rm $src
fi
if test -f /var/log/engines/system_services/system/system.log
 then
	mv /var/log/engines/system_services/system/system.log /var/log/engines/system_services/system/system.log.last
fi
#exit


text:
<!--
  Copyright (C) 2016 Electronic Arts Inc.  All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:

  1.  Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
  2.  Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
  3.  Neither the name of Electronic Arts, Inc. ("EA") nor the names of
      its contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY ELECTRONIC ARTS AND ITS CONTRIBUTORS "AS IS" AND ANY
  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  DISCLAIMED. IN NO EVENT SHALL ELECTRONIC ARTS OR ITS CONTRIBUTORS BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  -->
<!--
  Default stack using IP multicasting. It is similar to the "udp"
  stack in stacks.xml, but doesn't use streaming state transfer and flushing
  author: Bela Ban
-->

<config xmlns="urn:org:jgroups"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd">
    <UDP
            mcast_port="${jgroups.udp.mcast_port:45588}"
            ip_ttl="0"
            tos="8"
            ucast_recv_buf_size="5M"
            ucast_send_buf_size="5M"
            mcast_recv_buf_size="5M"
            mcast_send_buf_size="5M"
            max_bundle_size="64K"
            max_bundle_timeout="30"
            enable_diagnostics="true"
            thread_naming_pattern="cl"

            timer_type="new3"
            timer.min_threads="2"
            timer.max_threads="4"
            timer.keep_alive_time="3000"
            timer.queue_max_size="500"

            thread_pool.enabled="true"
            thread_pool.min_threads="2"
            thread_pool.max_threads="8"
            thread_pool.keep_alive_time="5000"
            thread_pool.queue_enabled="true"
            thread_pool.queue_max_size="10000"
            thread_pool.rejection_policy="discard"

            oob_thread_pool.enabled="true"
            oob_thread_pool.min_threads="1"
            oob_thread_pool.max_threads="8"
            oob_thread_pool.keep_alive_time="5000"
            oob_thread_pool.queue_enabled="false"
            oob_thread_pool.queue_max_size="100"
            oob_thread_pool.rejection_policy="discard"/>

    <PING />
    <MERGE3 max_interval="30000"
            min_interval="10000"/>
    <FD_SOCK/>
    <FD_ALL/>
    <VERIFY_SUSPECT timeout="1500"  />
    <BARRIER />
    <pbcast.NAKACK2 xmit_interval="500"
                    xmit_table_num_rows="100"
                    xmit_table_msgs_per_row="2000"
                    xmit_table_max_compaction_time="30000"
                    max_msg_batch_size="500"
                    use_mcast_xmit="false"
                    discard_delivered_msgs="true"/>
    <UNICAST3 xmit_interval="500"
              xmit_table_num_rows="100"
              xmit_table_msgs_per_row="2000"
              xmit_table_max_compaction_time="60000"
              conn_expiry_timeout="0"
              max_msg_batch_size="500"/>
    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
                   max_bytes="4M"/>
    <pbcast.GMS print_local_addr="true" join_timeout="2000"
                view_bundling="true"/>
    <UFC max_credits="2M"
         min_threshold="0.4"/>
    <MFC max_credits="2M"
         min_threshold="0.4"/>
    <FRAG2 frag_size="60K"  />
    <RSVP resend_interval="2000" timeout="10000"/>
    <pbcast.STATE_TRANSFER />
    <!-- pbcast.FLUSH  /-->
</config>


text:
<?php
namespace Chamilo\Core\Group\Table\GroupRelUser;

use Chamilo\Core\Group\Manager;
use Chamilo\Libraries\Format\Table\Extension\DataClassTable\DataClassTable;
use Chamilo\Libraries\Format\Table\FormAction\TableFormAction;
use Chamilo\Libraries\Format\Table\FormAction\TableFormActions;
use Chamilo\Libraries\Format\Table\Interfaces\TableFormActionsSupport;
use Chamilo\Libraries\Platform\Translation;

class GroupRelUserTable extends DataClassTable implements TableFormActionsSupport
{
    const TABLE_IDENTIFIER = Manager::PARAM_GROUP_REL_USER_ID;

    public function get_implemented_form_actions()
    {
        $actions = new TableFormActions(__NAMESPACE__, self::TABLE_IDENTIFIER);
        $actions->add_form_action(
            new TableFormAction(
                $this->get_component()->get_url(
                    array(Manager::PARAM_ACTION => Manager::ACTION_UNSUBSCRIBE_USER_FROM_GROUP)),
                Translation::get('UnsubscribeSelected'),
                false));
        return $actions;
    }
}


text:
package com.example.mypractice.canvas;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class PaintFlagsDrawFilterAct extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new MySample(this));
    }

    public static class MySample extends View {
        private Bitmap bitmap;
        private Matrix matrix;
        private Paint paint;
        private Matrix mCanvasMatrix;
        private Paint mTextPaint;

        public MySample(Context context) {
            super(context);
            try {
                bitmap = BitmapFactory.decodeStream(getResources().getAssets().open("resource_2.png"));
            } catch (Exception e) {
                e.printStackTrace();
            }
            mCanvasMatrix = new Matrix();
            matrix = new Matrix();
            paint = new Paint();
//            1)mPaint.setAntiAlias();//此函数是用来防止边缘的锯齿,
//            2)mPaint.setBitmapFilter(true)。//此函数是用来对位图进行滤波处理。
            paint.setAntiAlias(false);
            paint.setFilterBitmap(false);
            mTextPaint = new Paint();
            mTextPaint.setColor(Color.RED);
            mTextPaint.setTextSize(40);
//            paint.setStyle(Paint.Style.STROKE);
//            paint.setStrokeWidth(2);

        }

        /**
         * @param
         *
         */
        @Override
        protected void onDraw(Canvas canvas) {
            int root = canvas.save();
//            canvas.setMatrix(mCanvasMatrix);
            canvas.translate(100, 100);
            canvas.drawBitmap(bitmap, matrix, paint);
            matrix.postRotate(45);
            matrix.postTranslate(250, 0);
            matrix.postScale(1.5f, 1.5f);
            canvas.drawBitmap(bitmap, matrix, paint);
            canvas.translate(0, 300);
            int temp=canvas.save();
            canvas.drawText("圆", 0, 0, mTextPaint);
            canvas.rotate(90, 0, 0);
            canvas.drawText("圆", 0, -40, mTextPaint);
            canvas.restoreToCount(temp);
            temp=canvas.save();
            canvas.rotate(-90);
            canvas.drawText("圆", 30, 0, mTextPaint);
            canvas.restoreToCount(temp);
            canvas.translate(0, 300);

            canvas.restoreToCount(root);
        }
    }
}


text:
package org.knowm.xchange.btcturk.service;

/** @author mertguner */
public class BTCTurkDemoUtilsTest {

  public static final String BTCTURK_APIKEY = "";
  public static final String BTCTURK_SECRETKEY = "";
}


text:
package uk.co.real_logic.agrona.concurrent;

/**
 * Compose two agents into one so a thread can be shared.
 */
public class CompositeAgent implements Agent
{
    private final Agent firstAgent;
    private final Agent secondAgent;

    public CompositeAgent(final Agent firstAgent, final Agent secondAgent)
    {
        this.firstAgent = firstAgent;
        this.secondAgent = secondAgent;
    }

    public int doWork() throws Exception
    {
        return firstAgent.doWork() + secondAgent.doWork();
    }

    public void onClose()
    {
        firstAgent.onClose();
        secondAgent.onClose();
    }

    public String roleName()
    {
        return firstAgent.roleName() + "+" + secondAgent.roleName();
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using SharpShell.Attributes;
using SharpShell.Diagnostics;
using SharpShell.Interop;

namespace SharpShell.SharpPropertySheet
{
    /// <summary>
    /// SharpPropertySheet is the base class for Shell Property Sheet Extensions supported
    /// by SharpShell.
    /// </summary>
    [ServerType(ServerType.ShellPropertySheet)]
    public abstract class SharpPropertySheet : ShellExtInitServer, IShellPropSheetExt
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SharpPropertySheet"/> class.
        /// </summary>
        protected SharpPropertySheet()
        {
            //  DebugLog the event.
            Log("Constructing property sheet.");

            //  The lazy property sheet pages will be created by the abstract
            //  create pages function.
            propertySheetPages = new Lazy<List<SharpPropertyPage>>( () => CreatePages().ToList());
        }

       #region Implementation of IShellPropSheetExt

        /// <summary>
        /// Adds the pages.
        /// </summary>
        /// <param name="pfnAddPage">The PFN add page.</param>
        /// <param name="lParam">The l param.</param>
        /// <returns></returns>
        int IShellPropSheetExt.AddPages(IntPtr pfnAddPage, IntPtr lParam)
        {
            //  DebugLog the event.
            Log("Adding Pages...");

            //  If we are not showing the sheet, we can end now.
            if (CanShowSheet() == false)
                return 0;

            //  Create the bridge.
            var bridge = new NativeBridge.NativeBridge();

            //  Initialise it.
            if(bridge.Initialise() == false)
            {
                Logging.DebugError("Failed to initialise the NativeBridge.", null);
                return 0;
            }

            //  Go through each page - that has a property page.
            foreach (var page in propertySheetPages.Value.Where(p => p.Handle != IntPtr.Zero))
            {
                //  Create a property page proxy for this page.
                var proxy = new PropertyPageProxy(this, page);

                //  Using the proxy, create the property page handle.
                proxy.CreatePropertyPageHandle(bridge);
                var propertyPageHandle = proxy.HostWindowHandle;

                //  Name the page, to aid with debugging.
                User32.SetWindowText(propertyPageHandle, "SharpShell Host for " + page.GetType().Name);

                //  DebugLog the event.
                Log("Created Page Proxy, handle is " + propertyPageHandle.ToString("x8"));

                //  Now that we have the page handle, add the page via the callback.
                bridge.CallAddPropSheetPage(pfnAddPage, propertyPageHandle, lParam);
            }

            //  Release the bridge.
            //bridge.Deinitialise();

            //  DebugLog the event.
            Log("Adding Pages (Done)");

            //  We've succeeded.
            return WinError.S_OK;
        }

        /// <summary>
        /// Replaces the page.
        /// </summary>
        /// <param name="uPageID">The u page ID.</param>
        /// <param name="lpfnReplacePage">The LPFN replace page.</param>
        /// <param name="lParam">The l param.</param>
        /// <returns></returns>
        int IShellPropSheetExt.ReplacePage(uint uPageID, AddPropertySheetPageDelegate lpfnReplacePage, IntPtr lParam)
        {
            return 0;
        }

        #endregion

        /// <summary>
        /// Determines whether this instance can show a shell property sheet, given the specified selected file list.
        /// </summary>
        /// <returns>
        ///   <c>true</c> if this instance should show a shell property sheet for the specified file list; otherwise, <c>false</c>.
        /// </returns>
        protected abstract bool CanShowSheet();

        /// <summary>
        /// Creates the pages.
        /// </summary>
        /// <returns>The property sheet pages.</returns>
        protected abstract IEnumerable<SharpPropertyPage> CreatePages();

        /// <summary>
        /// The lazy property sheet pages, only created when we actually need them.
        /// </summary>
        private readonly Lazy<List<SharpPropertyPage>> propertySheetPages;

        /// <summary>
        /// Gets the pages.
        /// </summary>
        public IEnumerable<SharpPropertyPage> Pages
        {
            get { return propertySheetPages.Value; }
        }
    }
}


text:
import { getSourceJsFileListFromPathList } from '@dr-js/dev/module/node/filePreset.js'
import { initOutput, packOutput, clearOutput, verifyNoGitignore, verifyGitStatusClean, verifyOutputBin, verifyPackageVersionStrict, publishPackage } from '@dr-js/dev/module/output.js'
import { getTerserOption, minifyFileListWithTerser } from '@dr-js/dev/module/minify.js'
import { processFileList, fileProcessorBabel } from '@dr-js/dev/module/fileProcessor.js'

import { withRetry } from 'source/common/function.js'
import { runKit, argvFlag } from 'source/node/kit.js'

const retryCount = (!process.env.IS_CI || process.platform === 'linux')
  ? 1 // one chance should be enough for linux CI
  : 3 // 3 more chance for win32/darwin CI, since some net/fs test is still flaky
const retryNpmRunTest = (kit, name) => withRetry((failed, maxRetry) => {
  try { return kit.RUN(`npm run ${name}`) } catch (error) {
    console.error(`##[warning] [retry|${name}|${failed}/${maxRetry}]`, error) // https://github.com/actions/runner/blob/v2.278.0/src/Runner.Worker/ExecutionContext.cs#L1021-L1028
    throw error // retry
  }
}, retryCount)

runKit(async (kit) => {
  const processOutput = async ({ kit }) => {
    const fileListFull = await getSourceJsFileListFromPathList([ 'module', 'library', 'bin' ], kit.fromOutput)
    const fileListNoBrowser = fileListFull.filter((path) => !path.endsWith('Dr.browser.js'))

    let sizeReduce = 0
    sizeReduce += await minifyFileListWithTerser({ fileList: fileListFull, option: getTerserOption({ isReadable: true }), kit })
    sizeReduce += await processFileList({ fileList: fileListNoBrowser, processor: fileProcessorBabel, kit })
    kit.padLog(`size reduce: ${sizeReduce}B`)
  }

  await verifyNoGitignore({ path: kit.fromRoot('source'), kit })
  await verifyNoGitignore({ path: kit.fromRoot('source-bin'), kit })
  const packageJSON = await initOutput({ kit })
  if (!argvFlag('pack')) return

  const isPublish = argvFlag('publish')
  isPublish && verifyPackageVersionStrict(packageJSON.version)
  kit.padLog('generate spec & index.js')
  kit.RUN('npm run script-generate-spec')
  kit.padLog('build library-webpack')
  kit.RUN('npm run build-library-webpack')
  kit.padLog('build library-babel')
  kit.RUN('npm run build-library-babel')
  kit.padLog('build module')
  kit.RUN('npm run build-module')
  kit.padLog('build bin')
  kit.RUN('npm run build-bin')

  await processOutput({ kit })
  const isTest = isPublish || argvFlag('test')
  isTest && kit.padLog('lint source')
  isTest && kit.RUN('npm run lint')
  isTest && kit.RUN('npm run type-check')
  isTest && await processOutput({ kit }) // once more
  isTest && kit.padLog('test output')
  isTest && await retryNpmRunTest(kit, 'test-output-library')
  isTest && await retryNpmRunTest(kit, 'test-output-module')
  isTest && await retryNpmRunTest(kit, 'test-output-bin')
  isTest && kit.padLog('test browser')
  isTest && await retryNpmRunTest(kit, 'test-browser')
  isTest && kit.padLog('test bin')
  isTest && kit.RUN('npm run test-bin')
  await clearOutput({ kit })
  await verifyOutputBin({ packageJSON, kit })
  isTest && await verifyGitStatusClean({ kit })
  const pathPackagePack = await packOutput({ kit })
  isPublish && await publishPackage({ packageJSON, pathPackagePack, kit })
})


text:
{% if errors %}

    {{ errors }}
  {% if not fields %}
    {% for field in hidden_fields %}{{ field }}{% endfor %}
  {% endif %}

{% endif %}
{% for field, errors in fields %}

    {{ errors }}
    {% if field.label %}{{ field.label_tag() }}{% endif %}
    {{ field }}
    {% if field.help_text %}
      {{ field.help_text }}
    {% endif %}
    {% if loop.last %}
      {% for field in hidden_fields %}{{ field }}{% endfor %}
    {% endif %}

{% endfor %}
{% if not fields and not errors %}
  {% for field in hidden_fields %}{{ field }}{% endfor %}
{% endif %}


text:
<?php

namespace Dan\Services\ShortLinks;

use Dan\Contracts\ShortLinkContract;
use Dan\Support\Web;

class Links implements ShortLinkContract
{
    /**
     * Create the short link.
     *
     * @param $link
     *
     * @return mixed
     */
    public function create($link)
    {
        $data = Web::post('https://links.ml/add', ['url' => $link]);

        $json = json_decode($data, true);

        if ($json == false) {
            return $link;
        }

        if (!$json['success']) {
            return $link;
        }

        return $json['url'];
    }
}


text:
<05_prohorovka.xml>
 <name>#arenas:05_prohorovka/name</name>
 <description>#arenas:05_prohorovka/description</description>
 <geometry>spaces/05_prohorovka</geometry>
 <boundingBox>
  <bottomLeft>-500.0 -500.0</bottomLeft>
  <upperRight>500.0 500.0</upperRight>
 </boundingBox>
 <roundLength>900</roundLength>
 <minimap>spaces/05_prohorovka/mmap.dds</minimap>
 <vehicleCamouflageKind>summer</vehicleCamouflageKind>
 <umbraEnabled>1</umbraEnabled>
 <batchingEnabled>0</batchingEnabled>
 <defaultGroundEffect>ground</defaultGroundEffect>
 <loadingMusic>/music/intro/rus_village</loadingMusic>
 <wwloadingMusic>music_rus_vilage</wwloadingMusic>
 <ambientSound>/wind/wind/wind_autumn_01</ambientSound>
 <wwambientSound>ambient_wind_autumn_01</wwambientSound>
 <water>
  <texScale>0</texScale>
  <freqX>0</freqX>
  <freqZ>0</freqZ>
 </water>
 <gameplayTypes>
  <ctf>
   <teamBasePositions>
    <team1>
     <position1>-125.100000 448.300100</position1>
    </team1>
    <team2>
     <position1>51.599990 -447.000000</position1>
    </team2>
   </teamBasePositions>
  </ctf>
  <domination>
   <teamSpawnPoints>
    <team1>
     <position>-37.348 393.967</position>
     <position>-229.021 417.866</position>
    </team1>
    <team2>
     <position>10.414 -410.010</position>
     <position>-331.576 -428.692</position>
    </team2>
   </teamSpawnPoints>
   <teamBasePositions>
    <team1>
    </team1>
    <team2>
    </team2>
   </teamBasePositions>
   <controlPoint>171.058400 16.351450</controlPoint>
   <radius>100</radius>
  </domination>
  <assault2>
   <winnerIfTimeout>1</winnerIfTimeout>
   <winnerIfExtermination>1</winnerIfExtermination>
   <teamSpawnPoints>
    <team1>
     <position>-122.312 425.031</position>
    </team1>
    <team2>
     <position>48.913 -435.870</position>
    </team2>
   </teamSpawnPoints>
   <teamBasePositions>
    <team1>
     <position1>-163.430 256.265</position1>
     <position2>154.715 150.255</position2>
    </team1>
    <team2>
    </team2>
   </teamBasePositions>
  </assault2>
 </gameplayTypes>
</05_prohorovka.xml>


text:
/*
 * Project: B52 reader (https://github.com/FreekDB/b52-reader).
 * License: Apache version 2 (https://www.apache.org/licenses/LICENSE-2.0).
 */

/**
 * Classes and interfaces responsible for creating and launching the application.
 */
package nl.xs4all.home.freekdb.b52reader.main;


text:
// Copyright 2007-2018 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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.
namespace MassTransit.ActiveMqTransport.Transport
{
    using System.Threading.Tasks;
    using Apache.NMS;
    using GreenPipes;
    using Transports;

    public class ActiveMqDeadLetterTransport :
        ActiveMqMoveTransport,
        IDeadLetterTransport
    {
        public ActiveMqDeadLetterTransport(string destination, IFilter<SessionContext> topologyFilter)
            : base(destination, topologyFilter)
        {
        }

        public Task Send(ReceiveContext context, string reason)
        {
            void PreSend(IMessage message, SendHeaders headers)
            {
                headers.Set(MessageHeaders.Reason, reason ?? "Unspecified");
            }

            return Move(context, PreSend);
        }
    }
}


text:
"testADOdbapiConfig.py v 2.4.3"

import platform
import sys

import is64bit
import setuptestframework
if sys.version_info >= (3,0):
    import tryconnection3 as tryconnection
else:
    import tryconnection2 as tryconnection

print(sys.version)
node = platform.node()
print('node=%s: is64bit.os()= %s, is64bit.Python()= %s' % (node, is64bit.os(), is64bit.Python()))

testfolder = setuptestframework.maketemp()

if '--package' in sys.argv:
    pth = setuptestframework.makeadopackage(testfolder)
    if pth not in sys.path:
        sys.path.insert(1,pth)
# function to clean up the temporary folder -- calling program must run this function before exit.
cleanup = setuptestframework.getcleanupfunction()

import adodbapi
# testADOdbapi.py will import this same version when we return

try:
    print(adodbapi.version) # show version
except:
    print('"adodbapi.version" not present or not working.')
print(__doc__)

doAllTests = '--all' in sys.argv
doAccessTest = node != 'novelt2' or doAllTests
doSqlServerTest = node == 'novelt2' or doAllTests
doMySqlTest = '--mysql' in sys.argv or doAllTests
doPostgresTest =  '--pg' in sys.argv or doAllTests
iterateOverTimeTests = '--time' in sys.argv or doAllTests

try: #If mx extensions are installed, use mxDateTime
    import mx.DateTime
    doMxDateTimeTest=True
except:
    doMxDateTimeTest=False #Requires eGenixMXExtensions

doTimeTest = True # obsolete python time format

if doAccessTest:
    c = {'dsn': setuptestframework.makemdb(testfolder)}
    if is64bit.Python():
        c['driver'] = "Microsoft.ACE.OLEDB.12.0"
    else:
        c['driver'] = "Microsoft.Jet.OLEDB.4.0"
    connStrAccess = "Provider=%(driver)s;Data Source=%(dsn)s" % c
    doAccessTest = tryconnection.try_connection(connStrAccess)

if doSqlServerTest:
    _computername = "192.168.100.101" # name of computer with SQL Server
    _databasename = "vernon" #or something else
    #_username="guest"
    #_password="12345678"
    #if is64bit:
    #    connStrSQLServer = "Provider=SQLNCLI11;Data Source=tcp:o9our2opzq.database.windows.net;Database=ADOtest;User ID=vernondcole@o9our2opzq;Password=Az0456xxx;Encrypt=True;"
    #else:
    #    connStrSQLServer = "Provider=SQLOLEDB.1; Data Source=tcp:o9our2opzq.database.windows.net;Database=ADOtest;User ID=vernondcole@o9our2opzq;Password=Az0456xxx;"
    connStrSQLServer = r"Provider=SQLOLEDB.1; Integrated Security=SSPI; Initial Catalog=%s;Data Source=%s" %(_databasename, _computername)
    #connStrSQLServer = r"Provider=SQLOLEDB.1; User ID=%s; Password=%s; Initial Catalog=%s;Data Source=%s" %(_username,_password,_databasename, _computername)
    print('    ...Testing MS-SQL login...')
    doSqlServerTest = tryconnection.try_connection(connStrSQLServer)

if doMySqlTest:
    # import socket
    _computername = "25.116.170.194" ## socket.gethostbyname('kf7xm.ham-radio-op.net')
    _databasename='test'
    _username = 'adotest'
    _password = '12345678'
    _provider = ''
    if is64bit.Python():
        _provider = 'Provider=MSDASQL;'
        _driver="MySQL ODBC 5.2a Driver"    # or _driver="MySQL ODBC 3.51 Driver"
    else:
        _driver="MySQL ODBC 5.2a Driver"
    connStrMySql = '%sDriver={%s};Server=%s;Port=3306;Database=%s;user=%s;password=%s;Option=3;' % \
                   (_provider,_driver,_computername,_databasename,_username,_password)
    print('    ...Testing MySql login...')
    doMySqlTest = tryconnection.try_connection(connStrMySql)

if doPostgresTest:
    _computername = "25.223.161.222"
    _databasename='adotest'
    _username = 'adotestuser'
    _password = '12345678'
    _driver="PostgreSQL Unicode"
    _provider = ''
    if is64bit.Python():
        _driver += '(x64)'
        _provider = 'Provider=MSDASQL;'

# get driver from http://www.postgresql.org/ftp/odbc/versions/
    connStrPostgres = '%sDriver={%s};Server=%s;Database=%s;uid=%s;pwd=%s;' % \
                   (_provider,_driver,_computername,_databasename,_username,_password)
    print('    ...Testing PostgreSQL login...')
    doPostgresTest = tryconnection.try_connection(connStrPostgres)

assert doAccessTest or doSqlServerTest or doMySqlTest or doPostgresTest, 'No database engine found for testing'


text:
package org.thingsboard.server.common.data;

import lombok.Data;

/**
 * Created by ashvayka on 25.09.18.
 */
@Data
public class TbProperty {

    private String key;
    private String value;
}