text:
<?php

namespace Classroom\RepositoryBundle;

use Classroom\ProjectBundle\DataDir;
use Classroom\RepositoryBundle\Entity\RepositoryConfig;
use Classroom\RepositoryBundle\VersionStrategy\VersionStrategyInterface;
use Symfony\Component\Process\ProcessBuilder;
use Symfony\Component\Process\Process;

class GitRepository implements RepositoryInterface
{
    /**
     * @var RepositoryConfig
     */
    private $repositoryConfig;

    /**
     * @var DataDir
     */
    private $dataDir;

    /**
     * @var string
     */
    private $workDir;

    /**
     * @param RepositoryConfig $repositoryConfig
     * @param DataDir          $dataDir
     */
    public function __construct(RepositoryConfig $repositoryConfig, DataDir $dataDir)
    {
        $this->repositoryConfig = $repositoryConfig;
        $this->dataDir = $dataDir;

        $this->workDir = $this->dataDir->getBaseDirectory() . '/git';
    }

    /**
     * @inheritDoc
     */
    public function getSourceDirectory()
    {
        return $this->gitClone();
    }

    /**
     * @inheritDoc
     */
    public function determineVersion()
    {
        return $this->gitRevParse();
    }

    /**
     * @inheritDoc
     */
    public function determineBranch()
    {
        return $this->gitBranch();
    }

    /**
     * @return string
     */
    private function gitClone()
    {
        $processBuilder = new ProcessBuilder();
        $processBuilder
            ->add('git')
            ->add('clone')
            ->add('--depth')->add('0')
            ->add($this->repositoryConfig->getUrl())
            ->add($this->workDir);

        $process = $processBuilder->getProcess();

        echo $process->getCommandLine().PHP_EOL;
        $process->run();
        echo $process->getOutput().PHP_EOL;
        echo $process->getErrorOutput().PHP_EOL;

        return $this->workDir;
    }

    /**
     * @return string
     */
    private function gitBranch()
    {
        \chdir($this->workDir);

        $processBuilder = new ProcessBuilder();
        $processBuilder
            ->add('git')
            ->add('branch');

        $process = $processBuilder->getProcess();

        echo $process->getCommandLine().PHP_EOL;
        $process->run();
        echo $process->getOutput().PHP_EOL;
        echo $process->getErrorOutput().PHP_EOL;

        $branch = trim($process->getOutput());
        echo 'Branch: '.$branch.PHP_EOL;

        return $branch;
    }

    /**
     * @return string
     */
    private function gitRevParse()
    {
        \chdir($this->workDir);

        $processBuilder = new ProcessBuilder();
        $processBuilder->add('git')->add('rev-parse')->add('HEAD');

        $process = $processBuilder->getProcess();

        echo $process->getCommandLine().PHP_EOL;
        $process->run();
        echo $process->getOutput().PHP_EOL;
        echo $process->getErrorOutput().PHP_EOL;

        $commit = trim($process->getOutput());
        echo 'Commit ID: '.$commit.PHP_EOL;

        return $commit;
    }
}


text:
namespace service_manager {

Manifest::Manifest() = default;
Manifest::Manifest(const Manifest&) = default;
Manifest::Manifest(Manifest&&) = default;
Manifest::~Manifest() = default;
Manifest& Manifest::operator=(const Manifest&) = default;
Manifest& Manifest::operator=(Manifest&&) = default;

Manifest::Options::Options() = default;
Manifest::Options::Options(const Options&) = default;
Manifest::Options::Options(Options&&) = default;
Manifest::Options::~Options() = default;
Manifest::Options& Manifest::Options::operator=(Options&&) = default;
Manifest::Options& Manifest::Options::operator=(const Options&) = default;

Manifest& Manifest::Amend(Manifest other) {
  for (const auto& capability_entry : other.exposed_capabilities) {
    const auto& capability_name = capability_entry.first;
    const auto& interface_names = capability_entry.second;
    for (const auto& interface_name : interface_names)
      exposed_capabilities[capability_name].insert(interface_name);
  }

  for (const auto& filter_entry : other.exposed_interface_filter_capabilities) {
    const auto& filter_name = filter_entry.first;
    const auto& capabilities_map = filter_entry.second;
    for (const auto& capability_entry : capabilities_map) {
      const auto& capability_name = capability_entry.first;
      const auto& interface_names = capability_entry.second;
      auto& exposed_capability =
          exposed_interface_filter_capabilities[filter_name][capability_name];
      for (const auto& interface_name : interface_names)
        exposed_capability.insert(interface_name);
    }
  }

  for (const auto& capability_entry : other.required_capabilities) {
    const auto& service_name = capability_entry.first;
    const auto& capability_names = capability_entry.second;
    for (const auto& capability_name : capability_names)
      required_capabilities[service_name].insert(capability_name);
  }

  for (const auto& filter_entry :
       other.required_interface_filter_capabilities) {
    const auto& filter_name = filter_entry.first;
    const auto& capability_maps = filter_entry.second;
    for (const auto& capability_entry : capability_maps) {
      const auto& service_name = capability_entry.first;
      const auto& capability_names = capability_entry.second;
      auto& required_capabilities =
          required_interface_filter_capabilities[filter_name][service_name];
      for (const auto& capability_name : capability_names)
        required_capabilities.insert(capability_name);
    }
  }

  for (auto& manifest : other.packaged_services)
    packaged_services.emplace_back(std::move(manifest));
  for (auto& file_info : other.preloaded_files)
    preloaded_files.emplace_back(std::move(file_info));

  return *this;
}

}  // namespace service_manager

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Piwik - free/libre analytics platform
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 */
namespace Piwik\Db;

use Piwik\Db;

/**
 * Schema abstraction
 *
 * Note: no relation to the ZF proposals for Zend_Db_Schema_Manager
 *
 * @method static \Piwik\Db\Schema getInstance()
 */
class Settings
{
    public function getEngine()
    {
        return $this->getDbSetting('type');
    }

    public function getTablePrefix()
    {
        return $this->getDbSetting('tables_prefix');
    }

    public function getDbName()
    {
        return $this->getDbSetting('dbname');
    }

    private function getDbSetting($key)
    {
        $dbInfos = Db::getDatabaseConfig();
        $engine  = $dbInfos[$key];

        return $engine;
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Fitopatología 24: 302 (1899)

#### Original name
Uncinula australiana McAlpine, 1899

### Remarks
null


text:
/*
 * Author: petermchale
 *
 * Created on June 18, 2012, 3:57 PM
 */

#ifndef DERIVED_CLASSES_H
#define	DERIVED_CLASSES_H

#include <mutation_accumulation/utility/data_traits.h> // data_types::continuous_type

#include <limits> // std::numeric_limits
#include <cassert> // assert

#include "parameter_base.h"

/*************************************************************************/

/* consider moving implementation of implicitly inlined constructors to implementation file
 * (Item 30) */

namespace parameters {

    namespace ranges {

        /* allowable parameter ranges */
        const double symmetry_min = 0.0;
        const double symmetry_max = 1.0;

        const double symmetric_renewal_min = 0.0;
        const double symmetric_renewal_max = 1.0;

        const int number_pop_min = 0;
        const int number_pop_max = 100;

        const int change_pop_size_min = std::numeric_limits<int>::min();
        const int change_pop_size_max = std::numeric_limits<int>::max();

        const int number_spe_min = 0;
        const int number_spe_max = 100;

        const int number_sampled_times_min = 0;
        const int number_sampled_times_max = static_cast<int>(1e5);

        /**
         * check that model parameter value lies in allowable range
         */
        inline void check_value(const int &value__, const int &value_min__, const int &value_max__) {

            assert(value__ >= value_min__);
            assert(value__ <= value_max__);

        }

        /**
         * check that model parameter value lies in allowable range
         */
        inline void check_value(const double &value__, const double &value_min__, const double &value_max__) {

            assert(value__ > value_min__ - 1e-8);
            assert(value__ < value_max__ + 1e-8);

        }

    }

    /**
     * symmetry parameter
     */
    class Symmetry : public Parameter_base<double> {
    public:
        typedef data_types::continuous_type category;

    public:

        /**
         * ctor
         */
        explicit Symmetry(const double &value__) : Parameter_base<double>(value__, ranges::symmetry_min, ranges::symmetry_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

        /**
         * must declare default constructor: \n
         * compiler provides default constructor only if no custom constructors exist.
         */
        explicit Symmetry() : Parameter_base<double>(0.0, ranges::symmetry_min, ranges::symmetry_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

    };

    /**
     * symmetry parameter
     */
    class SymmetricRenewal : public Parameter_base<double> {
    public:

        /**
         * ctor
         */
        explicit SymmetricRenewal(const double &value__) : Parameter_base<double>(value__, ranges::symmetric_renewal_min, ranges::symmetric_renewal_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

        /**
         * must declare default constructor: \n
         * compiler provides default constructor only if no custom constructors exist.
         */
        explicit SymmetricRenewal() : Parameter_base<double>(0.5, ranges::symmetric_renewal_min, ranges::symmetric_renewal_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

    };

    /**
     * number of sub-populations parameter
     */
    class Number_Pop : public Parameter_base<int> {
    public:

        /**
         * ctor
         */
        explicit Number_Pop(const int &value__) : Parameter_base<int>(value__, ranges::number_pop_min, ranges::number_pop_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

        /**
         * must declare default constructor: \n
         * compiler provides default constructor only if no custom constructors exist.
         */
        explicit Number_Pop() : Parameter_base<int>(0, ranges::number_pop_min, ranges::number_pop_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

    };

    /**
     * population index
     */
    class Pop : public Parameter_base<int> {
    public:

        /**
         * ctor
         */
        explicit Pop(const int &value__) : Parameter_base<int>(value__, ranges::number_pop_min, ranges::number_pop_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

    };

    /**
     * number of cells to add (positive value__) or take away (negative value__) from a population
     */
    class Change_Pop_Size : public Parameter_base<int> {
    public:

        /**
         * ctor
         */
        explicit Change_Pop_Size(const int &value__) : Parameter_base<int>(value__, ranges::change_pop_size_min, ranges::change_pop_size_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

    };

    /**
     * number of species parameter
     */
    class Number_Spe : public Parameter_base<int> {
    public:

        /**
         * ctor
         */
        explicit Number_Spe(const int &value__) : Parameter_base<int>(value__, ranges::number_spe_min, ranges::number_spe_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

    };

    /**
     * species index
     */
    class Spe : public Parameter_base<int> {
    public:

        /**
         * ctor
         */
        explicit Spe(const int &value__) : Parameter_base<int>(value__, ranges::number_spe_min, ranges::number_spe_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

    };

    /**
     * number of time points at which to sample a path
     */
    class Number_Nodes : public Parameter_base<int> {
    public:

        /**
         * ctor
         */
        explicit Number_Nodes(const int &value__) : Parameter_base<int>(value__, ranges::number_sampled_times_min, ranges::number_sampled_times_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

    };

    /**
     * time index for sampling a path
     */
    class Node : public Parameter_base<int> {
    public:

        /**
         * ctor
         */
        explicit Node(const int &value__) : Parameter_base<int>(value__, ranges::number_sampled_times_min, ranges::number_sampled_times_max) {

            ranges::check_value(value_, value_min_, value_max_);

        }

    };

}

#endif	/* DERIVED_CLASSES_H */


text:
import Rx from 'rxjs/Rx'
import layout from '../utils/layout.js'

const filterGraph = (vertices, edges, rThreshold, cells, layers, variableTypes) => {
  const usedVariableTypes = new Set()
  for (const variableType of variableTypes) {
    if (variableType.checked) {
      usedVariableTypes.add(variableType.name)
    }
  }
  const usedLayers = new Set()
  for (const layer of layers) {
    if (layer.checked) {
      usedLayers.add(layer.name)
    }
  }
  const usedCells = new Set()
  for (const cell of cells) {
    if (cell.checked) {
      usedCells.add(cell.name)
    }
  }

  const vertexMap = new Map(vertices
    .filter(({d}) => usedVariableTypes.has(d.variableType) && usedLayers.has(d.layer) && d.cells.some((cell) => usedCells.has(cell)))
    .map(({u, d}) => [u, d]))
  const filteredEdges = edges.filter(({u, v, d}) => {
    const ud = vertexMap.get(u)
    const vd = vertexMap.get(v)
    return ud && vd && ud.layerOrder < vd.layerOrder && Math.abs(d.r) >= rThreshold
  })

  const usedVertices = new Set()
  for (const {u, v} of filteredEdges) {
    usedVertices.add(u)
    usedVertices.add(v)
  }
  const filteredVertices = vertices.filter(({u}) => usedVertices.has(u))
  return {
    vertices: filteredVertices,
    edges: filteredEdges
  }
}

const store = (dataSubject, controlSubject, filterSubject) => {
  const state = {
    vertices: [],
    edges: [],
    width: 0,
    height: 0
  }

  const subject = new Rx.BehaviorSubject({state, changed: false})

  Rx.Observable.zip(dataSubject, controlSubject, filterSubject)
    .subscribe(([data, control, filter]) => {
      if (!data.changed && !control.changed && !filter.changed) {
        subject.next({state, changed: false})
        return
      }

      const {vertices, edges} = data.state
      const {rThreshold, cells, layers, variableTypes, biclusteringOption, epsilon} = control.state
      const {filteredVertices} = filter.state
      const graph = filterGraph(vertices, edges, rThreshold, cells, layers, variableTypes)
      const options = {
        filteredVertices: Array.from(filteredVertices),
        biclusteringOption,
        layerMargin: 100,
        vertexMargin: 5,
        epsilon
      }
      layout(graph, options).subscribe((result) => {
        Object.assign(state, result)
        subject.next({state, changed: true})
      })
    })

  return subject
}

export default store


text:
<?php

namespace Mh\CmsBundle\Classes\Page;

use Mh\CmsBundle\Entity\Page;
use Mh\CmsBundle\Classes\Page\Handler;
use Doctrine\ORM\EntityManager;
use Symfony\Component\DependencyInjection\Container;
use Mh\CmsBundle\Entity\WebsiteExternalType;

class Stager extends Handler
{
    /**
     * Get all the content block types.
     *
     * @return array
     */
    public function getContentBlockTypes()
    {
        return $this->getEm()->getRepository("MhCmsBundle:ContentBlockType")->findAll();
    }

    public function getGlobalExternals()
    {
        return $this->getPage()->getWebsite()->getWebsiteExternals();
    }

    public function getGlobalCss()
    {
        $externals = $this->getGlobalExternals();

        $rtn = array();

        foreach ($externals as $external) {
            if ($external->getType()->getWebsiteExternalTypeName() == WebsiteExternalType::TYPE_CSS) {
                $rtn[] = $external;
            }
        }

        return $rtn;
    }
}


text:
using FluentAssertions;
using NUnit.Framework;
using SharpRemote.Test.Extensions;

namespace SharpRemote.Test.Exceptions
{
	[TestFixture]
	public sealed class NotConnectedExceptionTest
		: AbstractExceptionTest<NotConnectedException>
	{
		[Test]
		public void TestConstruction()
		{
			var endPointName = "Some endpoint";
			var exception = new NotConnectedException(endPointName);
			exception.Message.Should().Be("This endpoint is not connected to any other endpoint");
			exception.EndPointName.Should().Be(endPointName);
		}

		[Test]
		[SetCulture("en-US")]
		public void TestRoundtrip()
		{
			var endPointName = "Some endpoint";
			var exception = new NotConnectedException(endPointName);
			var actualException = exception.Roundtrip();
			actualException.Message.Should().Be("This endpoint is not connected to any other endpoint");
			actualException.EndPointName.Should().Be(endPointName);
		}
	}
}