text:
<?php
namespace TYPO3\CMS\Backend\Form\Container;

use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Lang\LanguageService;

/**
 * Flex form container implementation
 * This one is called by FlexFormSectionContainer and renders HTML for a single container.
 * For processing of single elements FlexFormElementContainer is called
 */
class FlexFormContainerContainer extends AbstractContainer
{
    /**
     * Entry method
     *
     * @return array As defined in initializeResultArray() of AbstractNode
     */
    public function render()
    {
        $table = $this->data['tableName'];
        $row = $this->data['databaseRow'];
        $fieldName = $this->data['fieldName'];
        $flexFormFormPrefix = $this->data['flexFormFormPrefix'];
        $flexFormContainerElementCollapsed = $this->data['flexFormContainerElementCollapsed'];
        $flexFormContainerTitle = $this->data['flexFormContainerTitle'];
        $flexFormFieldIdentifierPrefix = $this->data['flexFormFieldIdentifierPrefix'];
        $parameterArray = $this->data['parameterArray'];

        // Every container adds its own part to the id prefix
        $flexFormFieldIdentifierPrefix = $flexFormFieldIdentifierPrefix . '-' . GeneralUtility::shortMd5(uniqid('id', true));

        $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
        $toggleIcons = ''
            . $iconFactory->getIcon('actions-view-list-collapse', Icon::SIZE_SMALL)->render()
            . '';
        $toggleIcons .= ''
            . $iconFactory->getIcon('actions-view-list-expand', Icon::SIZE_SMALL)->render()
            . '';

        $flexFormContainerCounter = $this->data['flexFormContainerCounter'];
        $actionFieldName = '_ACTION_FLEX_FORM'
            . $parameterArray['itemFormElName']
            . $this->data['flexFormFormPrefix']
            . '[_ACTION]'
            . '[' . $flexFormContainerCounter . ']';
        $toggleFieldName = 'data[' . $table . '][' . $row['uid'] . '][' . $fieldName . ']'
            . $flexFormFormPrefix
            . '[' . $flexFormContainerCounter . ']'
            . '[_TOGGLE]';

        $moveAndDeleteContent = [];
        $userHasAccessToDefaultLanguage = $this->getBackendUserAuthentication()->checkLanguageAccess(0);
        if ($userHasAccessToDefaultLanguage) {
            $moveAndDeleteContent[] = 'getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:sortable.dragmove', true) . '">' . $iconFactory->getIcon('actions-move-move', Icon::SIZE_SMALL)->render() . '';
            $moveAndDeleteContent[] = 'getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:delete', true) . '">' . $iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render() . '';
        }

        $options = $this->data;
        $options['flexFormFieldIdentifierPrefix'] = $flexFormFieldIdentifierPrefix;
        // Append container specific stuff to field prefix
        $options['flexFormFormPrefix'] =  $flexFormFormPrefix . '[' . $flexFormContainerCounter . '][' . $this->data['flexFormContainerName'] . '][el]';
        $options['renderType'] = 'flexFormElementContainer';
        $containerContentResult = $this->nodeFactory->create($options)->render();

        $html = [];
        $html[] = '
';
        $html[] =    '<input class="t3-flex-control t3js-flex-control-action" type="hidden" name="' . htmlspecialchars($actionFieldName) . '" value="" />';
        $html[] =    '
';
        $html[] =        '
';
        $html[] =            '
';
        $html[] =                '
';
        $html[] =                    $toggleIcons;
        $html[] =                '
';
        $html[] =                '
';
        $html[] =                    '' . $flexFormContainerTitle . '';
        $html[] =                '
';
        $html[] =                '
';
        $html[] =                    '
';
        $html[] =                        implode(LF, $moveAndDeleteContent);
        $html[] =                    '
';
        $html[] =                '
';
        $html[] =            '
';
        $html[] =        '
';
        $html[] =        '
';
        $html[] =            $containerContentResult['html'];
        $html[] =        '
';
        $html[] =        '<input';
        $html[] =            'class="t3-flex-control t3js-flex-control-toggle"';
        $html[] =            'id="' . $flexFormFieldIdentifierPrefix . '-toggleClosed"';
        $html[] =            'type="hidden"';
        $html[] =            'name="' . htmlspecialchars($toggleFieldName) . '"';
        $html[] =            'value="' . ($flexFormContainerElementCollapsed ? '1' : '0') . '"';
        $html[] =        '/>';
        $html[] =    '
';
        $html[] = '
';

        $containerContentResult['html'] = '';
        $resultArray = $this->initializeResultArray();
        $resultArray['html'] = implode(LF, $html);
        $resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $containerContentResult);

        return $resultArray;
    }

    /**
     * @return BackendUserAuthentication
     */
    protected function getBackendUserAuthentication()
    {
        return $GLOBALS['BE_USER'];
    }

    /**
     * @return LanguageService
     */
    protected function getLanguageService()
    {
        return $GLOBALS['LANG'];
    }
}


text:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
// 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.
//

module Labs.Core {
    /**
     * Static class containing the different event types.
     */
    export class EventTypes {
        /**
         * Mode changed event type. Fired whenever the lab mode is changed.
         */
        public static ModeChanged = "modeChanged";

        /**
         * Event invoked when the app becomes active.
         */
        public static Activate = "activate";

        /**
         * Event invoked when the app is deactivated
         */
        public static Deactivate = "deactivate";
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<grassTextures>
    <grassTexture pattern="Grass_COLOR.png"
                  specular="Grass_SPEC.png"
                  normal="Grass_NRM.png"
                  occlusion="Grass_OCC.png"
                  alpha="Grass_DISP.png">
        <material token="PLANT:*:STRUCTURAL"/>
    </grassTexture>
    <grassTexture pattern="Eyes.png"
                  specular="Mirror_S.png"
                  normal="Eyes_N.png"
                  occlusion="Eyes_O.png"
                  alpha="Eyes_Depth.png">
        <material token="PLANT:EYEBALL:STRUCTURAL"/>
    </grassTexture>
    <grassTexture pattern="Worms.png"
                  specular="Mirror_S.png"
                  normal="Worms_N.png"
                  occlusion="Worms_O.png"
                  alpha="Worms_Depth.png">
        <material token="PLANT:WORMY TENDRILS:STRUCTURAL"/>
    </grassTexture>
    <grassTexture pattern="Grey.png"
                  specular="Mirror_S.png"
                  normal="Eyes_N.png"
                  occlusion="Eyes_O.png"
                  alpha="Eyes_Depth.png">
        <material token="PLANT:BUBBLE BULBS:STRUCTURAL"/>
    </grassTexture>
</grassTextures>


text:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;

namespace Restless.Tools.Controls
{
    /// <summary>
    /// Provides a calendar control with extended features.
    /// </summary>
    /// <remarks>
    /// This class extends System.Windows.Controls.Calendar to provide the ability to use
    /// UTC dates as the backing while presenting the calendar controls using the local date.
    /// To activate, set <see cref="IsUtcMode"/> to true, and bind your date property to <see cref="SelectedDateUtc"/>.
    /// This class only permits <see cref=" CalendarSelectionMode.SingleDate"/>. Any attempt to set <see cref="Calendar.SelectionMode"/>
    /// to another value will be ignored.
    /// </remarks>
    public class RestlessCalendar : Calendar
    {
        #region Private
        private bool inSelectedDateChanged;
        #endregion

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

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="RestlessCalendar"/> class.
        /// </summary>
        public RestlessCalendar()
        {
            HorizontalAlignment = HorizontalAlignment.Left;
            DisplayDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
        }

        /// <summary>
        /// Static constructor for <see cref="RestlessCalendar"/>
        /// </summary>
        static RestlessCalendar()
        {
            SelectionModeProperty.OverrideMetadata(typeof(RestlessCalendar), new FrameworkPropertyMetadata(CalendarSelectionMode.SingleDate, null, CoerceSelectionModeProperty));
        }

        private static object CoerceSelectionModeProperty(DependencyObject d, object baseValue)
        {
            return CalendarSelectionMode.SingleDate;
        }
        #endregion

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

        #region SelectedDateUtcChanged Routed Event
        /// <summary>
        /// Occurs when the <see cref="SelectedDateUtcChanged"/> property changes.
        /// </summary>
        public event CalendarDateChangedEventHandler SelectedDateUtcChanged
        {
            add => AddHandler(SelectedDateUtcChangedEvent, value);
            remove => RemoveHandler(SelectedDateUtcChangedEvent, value);
        }

        /// <summary>
        /// Identifies the <see cref="SelectedDateUtcChanged"/> routed event.
        /// </summary>
        public static readonly RoutedEvent SelectedDateUtcChangedEvent = EventManager.RegisterRoutedEvent
            (
                nameof(SelectedDateUtcChanged), RoutingStrategy.Bubble, typeof(CalendarDateChangedEventHandler), typeof(RestlessCalendar)
            );
        #endregion

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

        #region IsUtcMode
        /// <summary>
        /// Gets or sets a boolean value that determines if the calendar operates in UTC mode.
        /// </summary>
        public bool IsUtcMode
        {
            get => (bool)GetValue(IsUtcModeProperty);
            set => SetValue(IsUtcModeProperty, value);
        }

        /// <summary>
        /// Identifies the <see cref="IsUtcMode"/> dependency property.
        /// </summary>
        public static readonly DependencyProperty IsUtcModeProperty = DependencyProperty.Register
            (
                nameof(IsUtcMode), typeof(bool), typeof(RestlessCalendar), new PropertyMetadata(true)
            );

        #endregion

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

        #region SelectedDateUtc
        /// <summary>
        /// Gets or sets the selected date in UTC.
        /// </summary>
        public DateTime? SelectedDateUtc
        {
            get => (DateTime?)GetValue(SelectedDateUtcProperty);
            set => SetValue(SelectedDateUtcProperty, value);
        }

        /// <summary>
        /// Identifies the <see cref="SelectedDateUtc"/> dependency property.
        /// </summary>
        public static readonly DependencyProperty SelectedDateUtcProperty = DependencyProperty.Register
            (
                nameof(SelectedDateUtc), typeof(DateTime?), typeof(RestlessCalendar),
                new FrameworkPropertyMetadata(default(DateTime?), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedDateUtcChanged)
            );

        private static void OnSelectedDateUtcChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (d is RestlessCalendar control)
            {
                if (e.NewValue is DateTime dt)
                {
                    DateTime dtLocal = control.ConvertIf(dt, toLocal: true);
                    control.SelectedDate = dtLocal;
                    if (!control.inSelectedDateChanged)
                    {
                        control.DisplayDate = dtLocal;
                    }
                }
                else
                {
                    control.SelectedDate = null;
                    if (!control.inSelectedDateChanged)
                    {
                        control.DisplayDate = DateTime.Now;
                    }
                }

                control.RaiseEvent(new CalendarDateChangedEventArgs(SelectedDateUtcChangedEvent, control.SelectedDateUtc));
            }
        }
        #endregion

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

        #region Public methods
        /// <summary>
        /// Gets a string representation of this instance.
        /// </summary>
        /// <returns>A string that displays the type, SelectedDate, SelectedDateUtc, and DisplayDate</returns>
        public override string ToString()
        {
            return $"{GetType()} SelectedDate: {SelectedDate} SelectedDateUtc: {SelectedDateUtc} DisplayDate: {DisplayDate}";
        }
        #endregion

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

        #region Protected methods
        /// <summary>
        /// Builds the visual tree for <see cref="RestlessCalendar"/> when a new template is applied
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
        }

        /// <summary>
        /// Called when the PreviewMouseUp event is called. Prevents the calendar from "sticking".
        /// </summary>
        /// <param name="e">The event args.</param>
        protected override void OnPreviewMouseUp(MouseButtonEventArgs e)
        {
            base.OnPreviewMouseUp(e);

            if (Mouse.Captured is CalendarItem)
            {
                Mouse.Capture(null);
            }
        }

        /// <summary>
        /// Called when the selected date or dates change.
        /// </summary>
        /// <param name="e">The event args.</param>
        protected override void OnSelectedDatesChanged(SelectionChangedEventArgs e)
        {
            inSelectedDateChanged = true;

            if (e.AddedItems.Count == 0)
            {
                SelectedDateUtc = null;
            }
            else
            {
                DateTime added = (DateTime)e.AddedItems[0];
                SelectedDateUtc = ConvertIf(added, toLocal: false);
            }

            inSelectedDateChanged = false;
            base.OnSelectedDatesChanged(e);
        }
        #endregion

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

        #region Private methods
        /// <summary>
        /// Converts the specified date if <see cref="IsUtcMode"/> is true.
        /// </summary>
        /// <param name="dt">The date to convert</param>
        /// <param name="toLocal">true to convert to local, false to convert to UTC</param>
        /// <returns>The converted date if <see cref="IsUtcMode"/> is true; otherwise, <paramref name="dt"/> unaltered</returns>
        private DateTime ConvertIf(DateTime dt, bool toLocal)
        {
            if (IsUtcMode)
            {
                if (toLocal)
                    return dt.ToLocalTime();
                else
                    return dt.ToUniversalTime();
            }
            return dt;
        }
        #endregion

    }
}


text:
package com.facebook.buck.android;

import static com.facebook.buck.jvm.java.JavaCompilationConstants.ANDROID_JAVAC_OPTIONS;

import com.facebook.buck.cli.FakeBuckConfig;
import com.facebook.buck.cxx.CxxBuckConfig;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.rules.AbstractNodeBuilder;
import com.facebook.buck.rules.SourcePath;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.MoreExecutors;

public class AndroidInstrumentationApkBuilder
    extends
    AbstractNodeBuilder<
        AndroidInstrumentationApkDescription.Arg,
        AndroidInstrumentationApkDescription,
        AndroidInstrumentationApk> {

  private AndroidInstrumentationApkBuilder(BuildTarget target) {
    super(
        new AndroidInstrumentationApkDescription(
            new ProGuardConfig(FakeBuckConfig.builder().build()),
            ANDROID_JAVAC_OPTIONS,
            false,
            ImmutableMap.of(),
            MoreExecutors.newDirectExecutorService(),
            new CxxBuckConfig(new FakeBuckConfig.Builder().build()),
            new DxConfig(FakeBuckConfig.builder().build())),
        target);
  }

  public static AndroidInstrumentationApkBuilder createBuilder(BuildTarget buildTarget) {
    return new AndroidInstrumentationApkBuilder(buildTarget);
  }

  public AndroidInstrumentationApkBuilder setManifest(SourcePath manifest) {
    arg.manifest = manifest;
    return this;
  }

  public AndroidInstrumentationApkBuilder setApk(BuildTarget apk) {
    arg.apk = apk;
    return this;
  }

}


text:
package org.apache.druid.server.coordinator;

import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;
import it.unimi.dsi.fastutil.objects.Object2LongMap;
import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
import org.apache.druid.client.ImmutableDruidServer;
import org.apache.druid.timeline.DataSegment;
import org.apache.druid.timeline.SegmentId;

import java.util.HashMap;
import java.util.Map;
import java.util.SortedSet;

/**
 * A lookup for the number of replicants of a given segment for a certain tier.
 */
public class SegmentReplicantLookup
{
  public static SegmentReplicantLookup make(DruidCluster cluster, boolean replicateAfterLoadTimeout)
  {
    final Table<SegmentId, String, Integer> segmentsInCluster = HashBasedTable.create();

    /**
     * For each tier, this stores the number of replicants for all the segments presently queued to load in {@link cluster}.
     * Segments that have failed to load due to the load timeout may not be present in this table if {@link replicateAfterLoadTimeout} is true.
     * This is to enable additional replication of the timed out segments for improved availability.
     */
    final Table<SegmentId, String, Integer> loadingSegments = HashBasedTable.create();

    for (SortedSet<ServerHolder> serversByType : cluster.getSortedHistoricalsByTier()) {
      for (ServerHolder serverHolder : serversByType) {
        ImmutableDruidServer server = serverHolder.getServer();

        for (DataSegment segment : server.iterateAllSegments()) {
          Integer numReplicants = segmentsInCluster.get(segment.getId(), server.getTier());
          if (numReplicants == null) {
            numReplicants = 0;
          }
          segmentsInCluster.put(segment.getId(), server.getTier(), numReplicants + 1);
        }

        // Also account for queued segments
        for (DataSegment segment : serverHolder.getPeon().getSegmentsToLoad()) {
          Integer numReplicants = loadingSegments.get(segment.getId(), server.getTier());
          if (numReplicants == null) {
            numReplicants = 0;
          }
          // Timed out segments need to be replicated in another server for faster availability.
          // Therefore we skip incrementing numReplicants for timed out segments if replicateAfterLoadTimeout is enabled.
          if (!replicateAfterLoadTimeout || !serverHolder.getPeon().getTimedOutSegments().contains(segment)) {
            loadingSegments.put(segment.getId(), server.getTier(), numReplicants + 1);
          }
        }
      }
    }

    return new SegmentReplicantLookup(segmentsInCluster, loadingSegments, cluster);
  }

  private final Table<SegmentId, String, Integer> segmentsInCluster;
  private final Table<SegmentId, String, Integer> loadingSegments;
  private final DruidCluster cluster;

  private SegmentReplicantLookup(
      Table<SegmentId, String, Integer> segmentsInCluster,
      Table<SegmentId, String, Integer> loadingSegments,
      DruidCluster cluster
  )
  {
    this.segmentsInCluster = segmentsInCluster;
    this.loadingSegments = loadingSegments;
    this.cluster = cluster;
  }

  public Map<String, Integer> getClusterTiers(SegmentId segmentId)
  {
    Map<String, Integer> retVal = segmentsInCluster.row(segmentId);
    return (retVal == null) ? new HashMap<>() : retVal;
  }

  int getLoadedReplicants(SegmentId segmentId)
  {
    Map<String, Integer> allTiers = segmentsInCluster.row(segmentId);
    int retVal = 0;
    for (Integer replicants : allTiers.values()) {
      retVal += replicants;
    }
    return retVal;
  }

  public int getLoadedReplicants(SegmentId segmentId, String tier)
  {
    Integer retVal = segmentsInCluster.get(segmentId, tier);
    return (retVal == null) ? 0 : retVal;
  }

  private int getLoadingReplicants(SegmentId segmentId, String tier)
  {
    Integer retVal = loadingSegments.get(segmentId, tier);
    return (retVal == null) ? 0 : retVal;
  }

  private int getLoadingReplicants(SegmentId segmentId)
  {
    Map<String, Integer> allTiers = loadingSegments.row(segmentId);
    int retVal = 0;
    for (Integer replicants : allTiers.values()) {
      retVal += replicants;
    }
    return retVal;
  }

  public int getTotalReplicants(SegmentId segmentId)
  {
    return getLoadedReplicants(segmentId) + getLoadingReplicants(segmentId);
  }

  public int getTotalReplicants(SegmentId segmentId, String tier)
  {
    return getLoadedReplicants(segmentId, tier) + getLoadingReplicants(segmentId, tier);
  }

  public Object2LongMap<String> getBroadcastUnderReplication(SegmentId segmentId)
  {
    Object2LongOpenHashMap<String> perTier = new Object2LongOpenHashMap<>();
    for (ServerHolder holder : cluster.getAllServers()) {
      // Only record tier entry for server that is segment broadcast target
      if (holder.getServer().getType().isSegmentBroadcastTarget()) {
        // Every broadcast target server should be serving 1 replica of the segment
        if (!holder.isServingSegment(segmentId)) {
          perTier.addTo(holder.getServer().getTier(), 1L);
        } else {
          perTier.putIfAbsent(holder.getServer().getTier(), 0);
        }
      }
    }
    return perTier;
  }
}


text:
<?php

header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
header("Allow: GET, POST, OPTIONS, PUT, DELETE");
$method = $_SERVER['REQUEST_METHOD'];
if($method == "OPTIONS") {
    die();
}
require_once 'vendor/autoload.php';

$app = new \Slim\Slim();

$db = new mysqli("localhost", "dbName", "dbPass", "TableName");
$db->set_charset("utf8");

$app->post("/insertSomething", function() use($db, $app) {

	$json = $app->request->post("json");
	$data = json_decode($json, true);

  $query = "INSERT INTO sample_table VALUES(NULL,"
			. "'{$data["Foo1"]}',"
			. "'{$data["Foo2"]}',"
			. "'{$data["Foo3"]}',"
			. "'{$data["Foo4"]}',"
			. "'{$dataFoo}',"
			. "'{$dataLastFoo}'"
			. ")";

	$insert = $db->query($query);

});

$app->run();


text:
'use strict';

const _ = require('lodash');
const debug = require('../utils/Debug')('UserAction');
const keyMirror = require('fbjs/lib/keyMirror');
const Request = require('../utils/Request');

let UserAction;
UserAction = (actionContext, payload) => {
  let type = payload.get('type');
  switch (type) {

  case UserAction.ActionTypes.GetUser:
    return new Promise((resolve, reject) => {
      let name = payload.get('user_name');
      let url = `/users/${name}`;
      debug(`---> Request: ${url}`);
      Request('get', url, payload.get('body')).then(res => {
        let user = _.result(res, 'body');
        debug('===> Dispatch:SET_USER %o', user);
        actionContext.dispatch('SET_USER', {user: user});
      }).then(resolve, reject);
    });

  case UserAction.ActionTypes.GetRepos:
    return new Promise((resolve, reject) => {
      let name = payload.get('user_name');
      let url = `/users/${name}/repos`;
      debug(`---> Request: ${url}`);
      Request('get', url, payload.get('body')).then(res => {
        let repos = _.result(res, 'body');
        debug('===> Dispatch:SET_REPOS %o', repos);
        actionContext.dispatch('SET_REPOS', {repos: repos});
      }).then(resolve, reject);
    });

  default:
    return new Promise((resolve, reject) => {
      debug('==X UnknownActionType');
    });
  }
};

UserAction.displayName = 'UserAction';

UserAction.ActionTypes = keyMirror({
  GetUser: null,
  GetRepos: null
});

UserAction.DispatchTypes = keyMirror({
  SET_USER: null,
  SET_REPOS: null
});

module.exports = UserAction;


text:
package org.apache.flink.docs.rest;

import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.docs.rest.data.TestEmptyMessageHeaders;
import org.apache.flink.docs.rest.data.TestExcludeMessageHeaders;
import org.apache.flink.runtime.rest.handler.RestHandlerSpecification;
import org.apache.flink.runtime.rest.util.DocumentingRestEndpoint;
import org.apache.flink.runtime.rest.versioning.RestAPIVersion;
import org.apache.flink.util.FileUtils;
import org.apache.flink.util.TestLogger;

import org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler;

import org.junit.jupiter.api.Test;

import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

class OpenApiSpecGeneratorTest extends TestLogger {

    @Test
    void testExcludeFromDocumentation() throws Exception {
        File file = File.createTempFile("rest_v0_", ".html");
        OpenApiSpecGenerator.createDocumentationFile(
                new TestExcludeDocumentingRestEndpoint(), RestAPIVersion.V0, file.toPath());
        String actual = FileUtils.readFile(file, "UTF-8");

        assertThat(actual).contains("/test/empty1");
        assertThat(actual).contains("This is a testing REST API.");
        assertThat(actual).contains("/test/empty2");
        assertThat(actual).contains("This is another testing REST API.");
        assertThat(actual).doesNotContain("/test/exclude1");
        assertThat(actual)
                .doesNotContain("This REST API should not appear in the generated documentation.");
        assertThat(actual).doesNotContain("/test/exclude2");
        assertThat(actual)
                .doesNotContain(
                        "This REST API should also not appear in the generated documentation.");
    }

    private static class TestExcludeDocumentingRestEndpoint implements DocumentingRestEndpoint {

        @Override
        public List<Tuple2<RestHandlerSpecification, ChannelInboundHandler>> initializeHandlers(
                CompletableFuture<String> localAddressFuture) {
            return Arrays.asList(
                    Tuple2.of(
                            new TestEmptyMessageHeaders(
                                    "/test/empty1", "This is a testing REST API."),
                            null),
                    Tuple2.of(
                            new TestEmptyMessageHeaders(
                                    "/test/empty2", "This is another testing REST API."),
                            null),
                    Tuple2.of(
                            new TestExcludeMessageHeaders(
                                    "/test/exclude1",
                                    "This REST API should not appear in the generated documentation."),
                            null),
                    Tuple2.of(
                            new TestExcludeMessageHeaders(
                                    "/test/exclude2",
                                    "This REST API should also not appear in the generated documentation."),
                            null));
        }
    }
}


text:
from gppylib.commands.base import Command, CommandResult, REMOTE

from mpp.lib.datagen import TINCTestDatabase

from mpp.lib.PSQL import PSQL

import os, commands

class TPCHDBDatabase(TINCTestDatabase):
    def __init__(self, database_name = "tpch_1g_heap", scale_factor = 1, storage_type = 'heap', partition = False):
        self.db_name = database_name
        self.scale_factor = scale_factor
        self.storage_type = storage_type
        self.partition = partition
        self.primary_segments_count = 1
        self._pwd = os.path.abspath(os.path.dirname(__file__))
        super(TPCHDBDatabase, self).__init__(database_name)

    def setUp(self):
        if super(TPCHDBDatabase, self).setUp():
            return True
        #Find number of primary segments
        self.primary_segments_count = (PSQL.run_sql_command("select 'primary_segment' from gp_segment_configuration \
                                      where content >= 0 and role = 'p'")).count('primary_segment')

        self._loading_pl = os.path.join(self._pwd, 'generate_load_tpch.pl')
        if not os.path.exists(self._loading_pl):
            print('generate_load_tpch.pl does not exist. Load fails. ')
            return False

        command = ''
        default_port = os.environ['PGPORT']

        if self.storage_type == 'heap':
            command = '%s -scale %s -num %s -port %s -db %s -table heap'%(self._loading_pl, self.scale_factor ,self.primary_segments_count - 1, default_port, self.db_name)
        elif self.storage_type == 'ao':
            command = '%s -scale %s -num %s -port %s -db %s -table ao -orient row'%(self._loading_pl, self.scale_factor ,self.primary_segments_count - 1, default_port, self.db_name)
        elif self.storage_type == 'aoco':
            command = '%s -scale %s -num %s -port %s -db %s -table ao -orient column'%(self._loading_pl, self.scale_factor ,self.primary_segments_count - 1, default_port, self.db_name)
        else:
            command = '%s -scale %s -num %s -port %s -db %s -table heap'%(self._loading_pl, self.scale_factor ,self.primary_segments_count - 1, default_port, self.db_name)

        if self.partition:
            command += ' -partition True'

        # print ('Execute command: %s'%command)
        status, output = commands.getstatusoutput(command)
        if status != 0:
            print ('Error in generate and load TPCH data. ')
            print (output)
            return False

        return False


text:
package org.olat.commons.servlets;

import java.util.HashMap;
import java.util.Map;

import org.olat.commons.servlets.pathhandlers.PathHandler;
import org.olat.core.configuration.Initializable;
import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing;

/**
 * Initial Date:  13.11.2002
 *
 * @author Mike Stock
 *
 * Comment:
 * @deprecated Please use GlobalMapperRegistry if you need to provide an url for e.g. static resources which are shared by all users
 *
 */
public class StaticsModule implements Initializable {
	private static final OLog log = Tracing.createLoggerFor(StaticsModule.class);
	private static Map<String,PathHandler> handlers = new HashMap<>(5);

	/**
	 *
	 */
	private StaticsModule() {
		//
	}

	/**
	 * @see org.olat.core.configuration.OLATModule#init(com.anthonyeden.lib.config.Configuration)
	 */
	public void init() {
		// Initialize handlers

				try {
					Class pathHandler = Class.forName("org.olat.commons.servlets.pathhandlers.FilePathHandler");
					PathHandler o = (PathHandler)pathHandler.newInstance();
					o.init("static");
					handlers.put("raw", o);

					pathHandler = Class.forName("org.olat.ims.qti.QTIStaticsHandler");
					o = (PathHandler)pathHandler.newInstance();
					o.init("");
					handlers.put("qti", o);

					pathHandler = Class.forName("org.olat.ims.qti.editor.QTIEditorStaticsHandler");
					o = (PathHandler)pathHandler.newInstance();
					o.init("");
					handlers.put("qtieditor", o);
				} catch (Exception e) {
					log.error("error while creating class by name", e);
				}
	}

	/**
	 * @param name
	 * @return A path handler handling requests for the given name identifier.
	 */
	public static PathHandler getInstance(String name) {
		return (PathHandler)handlers.get(name);
	}

}


text:
package org.ovirt.engine.core.searchbackend;

public class StringConditionRelationAutoCompleter extends BaseAutoCompleter {
    public StringConditionRelationAutoCompleter() {
        super(new String[] { "=", "!=" });

    }
}


text:
function prepareEnv() {
  unset JWS_SERVER_NAME
}

function configure() {
  configure_http
}

function configure_http() {
  if [ -n "$JWS_SERVER_NAME" ]; then
    sed -i "s|redirectPort=\"8443\"|redirectPort=\"8443\" server=\"${JWS_SERVER_NAME}\"|" $JWS_HOME/conf/server.xml
  fi

}


text:
package advanced.combinatorial.permutation.lc047_permutations2;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Set;

/**
 * Given a collection of numbers that might contain duplicates, return all possible unique permutations.
 * For example, [1,1,2] have the following unique permutations:
 *  [
 *      [1,1,2],
 *      [1,2,1],
 *      [2,1,1]
 *  ]
 */
public class Solution {

    public static void main(String[] args) {
        System.out.println(new Solution().permuteUnique(new int[]{1, 1, 2}));
    }

    // 3AC.
    public List<List<Integer>> permuteUnique(int[] nums) {
        List<List<Integer>> ret = new ArrayList<>();
        Arrays.sort(nums);
        dfs(ret, new ArrayList<Integer>(), nums, new boolean[nums.length]);
        return ret;
    }

    // Very tricky to avoid duplicate! 1) Sort the nums at first (don't forget)
    // 2) "when a number has the same value with its previous, we can use this number only if his previous is used (upper level)"
    // (num on the same level will be not used=true at the same time)
    private void dfs(List<List<Integer>> ret, List<Integer> path, int[] nums, boolean[] used) {
        if (path.size() == nums.length) {
            ret.add(new ArrayList<>(path));
        } else {
            for (int i = 0; i < nums.length; i++) {
                if (used[i]) continue;
                if (i > 0 && used[i - 1] && nums[i - 1] == nums[i]) continue;
                used[i] = true;
                path.add(nums[i]);
                dfs(ret, path, nums, used);
                path.remove(path.size() - 1);
                used[i] = false;
            }
        }
    }

    public List<List<Integer>> permuteUnique3_iterative(int[] nums) {
        Queue<List<Integer>> ret = new LinkedList<>();
        ret.offer(new LinkedList<>());
        for (int num : nums) {
            Set<List<Integer>> dup = new HashSet<>();
            for (int i = ret.size(); i > 0; i--) {
                List<Integer> perm = ret.poll();
                for (int j = 0; j <= perm.size(); j++) {
                    List<Integer> cpy = new LinkedList<>(perm);
                    cpy.add(j, num);
                    if (dup.add(cpy)) ret.offer(cpy);
                }
            }
        }
        return (List<List<Integer>>) ret;
    }

    // Iterative version: O(N^3 * N copy) ?!
    public List<List<Integer>> permuteUnique2_iterative(int[] nums) {
        LinkedList<List<Integer>> result = new LinkedList<>();
        result.offer(new ArrayList<>());
        for (int num : nums) {
            Set<String> dup = new HashSet<>();
            int size = result.size();
            while (size-- > 0) {
                List<Integer> per = result.poll();
                for (int i = 0; i <= per.size(); i++) {
                    List<Integer> newPer = new ArrayList<>(per);
                    newPer.add(i, num);
                    if (dup.add(newPer.toString()))
                        result.add(newPer);
                }
            }
        }
        return result;
    }

    // My 2nd: use boolean[] used + List path to replace LinkedHashSet
    // But actually, use Set to remove duplicate is more straightforward
    // O(N!)
    public List<List<Integer>> permuteUnique2(int[] nums) {
        List<List<Integer>> result = new ArrayList<>();
        Arrays.sort(nums);
        doPermuteUnique(result, new ArrayList<>(), new boolean[nums.length], nums);
        return result;
    }

    private void doPermuteUnique(List<List<Integer>> result, List<Integer> path, boolean[] used, int[] nums) {
        if (path.size() == nums.length) {
            result.add(new ArrayList<>(path));
            return;
        }
        // [1,1,2] if first 1 is used then second 1 should be considered
        // But if first 1 is NOT used that means they're in the same recursion
        for (int i = 0; i < nums.length; i++) {
            if (used[i]) continue;
            if (i > 0 && nums[i] == nums[i - 1] && !used[i - 1]) continue;
            used[i] = true;
            path.add(nums[i]);
            doPermuteUnique(result, path, used, nums);
            used[i] = false;
            path.remove(path.size() - 1);
        }
    }

    // My 1st
    public List<List<Integer>> permuteUnique1(int[] nums) {
        List<List<Integer>> result = new ArrayList<>();
        Set<Integer> path = new LinkedHashSet<>();
        Arrays.sort(nums);
        permute(result, path, nums, 0);
        return result;
    }

    private void permute(List<List<Integer>> result, Set<Integer> path, int[] nums, int k) {
        if (k == nums.length) {
            List<Integer> r = new ArrayList<>();
            for (int i : path) {
                r.add(nums[i]);
            }
            result.add(r);
            return;
        }

        Integer prev = null; // error2: failed to assume nums all positive and use -1 as indicator
        for (int i = 0; i < nums.length; i++) {
            if ((prev != null && nums[i] == prev)
                    || path.contains(i)) {  // error1: path could possibly contain nums[i],
                continue;                   // but from another location, so record i instead
            }

            path.add(i);
            permute(result, path, nums, k+1);
            path.remove(i);

            prev = nums[i];
        }
    }

}


text:
<?php namespace Anomaly\FilesFieldType;

use Anomaly\Streams\Platform\Addon\FieldType\FieldTypeAccessor;
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
use Illuminate\Database\Eloquent\Collection;

/**
 * Class FilesFieldTypeAccessor
 *
 * @link          http://pyrocms.com/
 * @author        PyroCMS, Inc. <support@pyrocms.com>
 * @author        Ryan Thompson <ryan@pyrocms.com>
 */
class FilesFieldTypeAccessor extends FieldTypeAccessor
{

    /**
     * The field type object.
     * This is for IDE support.
     *
     * @var FilesFieldType
     */
    protected $fieldType;

    /**
     * Set the value.
     *
     * @param $value
     */
    public function set($value)
    {
        if (is_string($value)) {
            $value = $this->organizeSyncValue(explode(',', $value));
        } elseif (is_array($value)) {
            $value = $this->organizeSyncValue($value);
        } elseif ($value instanceof Collection) {
            $value = $this->organizeSyncValue($value->filter()->all());
        } elseif ($value instanceof EntryInterface) {
            $value = $this->organizeSyncValue([$value->getId()]);
        }

        $this->fieldType->getRelation()->detach();
        $this->fieldType->getRelation()->sync($value);
    }

    /**
     * Organize the value for sync.
     *
     * @param  array $value
     * @return array
     */
    protected function organizeSyncValue(array $value)
    {

        /**
         * First clean our value.
         */
        $value = array_filter(array_unique($value));

        /**
         * Next take the natural array
         * key and make it the sort order.
         */
        $value = array_combine(
            array_values($value),
            array_map(
                function ($key) {
                    return [
                        'sort_order' => $key,
                    ];
                },
                array_keys($value)
            )
        );

        /**
         * Lastly add the file_id
         * relation column for sync.
         */
        array_walk(
            $value,
            function (&$value, $key) {
                $value['file_id'] = $key;
            }
        );

        return $value;
    }

    /**
     * Get the value.
     *
     * @return mixed
     */
    public function get()
    {
        return $this->fieldType->getRelation();
    }
}


text:
/*
 * OANDA v20 REST API
 *
 * The full OANDA v20 REST API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
 *
 * OpenAPI spec version: 3.0.15
 * Contact: api@oanda.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;

namespace Oanda.RestV20.Model
{
    /// <summary>
    /// The reason that an Account is being funded.
    /// </summary>
    /// <value>The reason that an Account is being funded.</value>
    [JsonConverter(typeof(StringEnumConverter))]
    public enum FundingReason
    {

        /// <summary>
        /// Enum CLIENTFUNDING for "CLIENT_FUNDING"
        /// </summary>
        [EnumMember(Value = "CLIENT_FUNDING")]
        CLIENTFUNDING,

        /// <summary>
        /// Enum ACCOUNTTRANSFER for "ACCOUNT_TRANSFER"
        /// </summary>
        [EnumMember(Value = "ACCOUNT_TRANSFER")]
        ACCOUNTTRANSFER,

        /// <summary>
        /// Enum DIVISIONMIGRATION for "DIVISION_MIGRATION"
        /// </summary>
        [EnumMember(Value = "DIVISION_MIGRATION")]
        DIVISIONMIGRATION,

        /// <summary>
        /// Enum SITEMIGRATION for "SITE_MIGRATION"
        /// </summary>
        [EnumMember(Value = "SITE_MIGRATION")]
        SITEMIGRATION,

        /// <summary>
        /// Enum ADJUSTMENT for "ADJUSTMENT"
        /// </summary>
        [EnumMember(Value = "ADJUSTMENT")]
        ADJUSTMENT
    }

}


text:
def run(verbosity=1, doctest=False):
    """Run NetworkX tests.

    Parameters
    ----------
    verbosity: integer, optional
      Level of detail in test reports.  Higher numbers provide more detail.

    doctest: bool, optional
      True to run doctests in code modules
    """

    import pytest

    pytest_args = ['-l']

    if verbosity and int(verbosity) > 1:
        pytest_args += ["-" + "v"*(int(verbosity)-1)]

    if doctest:
        pytest_args += ["--doctest-modules"]

    pytest_args += ["--pyargs", "networkx"]

    try:
        code = pytest.main(pytest_args)
    except SystemExit as exc:
        code = exc.code

    return (code == 0)

if __name__ == "__main__":
    run()


text:
package org.neo4j.kernel.ha;

import java.io.File;
import java.io.IOException;

import org.neo4j.io.fs.FileUtils;

import static org.neo4j.kernel.impl.util.StoreUtil.cleanStoreDir;
import static org.neo4j.kernel.impl.util.StoreUtil.getBranchedDataRootDirectory;
import static org.neo4j.kernel.impl.util.StoreUtil.isBranchedDataDirectory;
import static org.neo4j.kernel.impl.util.StoreUtil.moveAwayDb;
import static org.neo4j.kernel.impl.util.StoreUtil.newBranchedDataDir;

public enum BranchedDataPolicy
{
    keep_all
            {
                @Override
                public void handle( File storeDir ) throws IOException
                {
                    moveAwayDb( storeDir, newBranchedDataDir( storeDir ) );
                }
            },
    keep_last
            {
                @Override
                public void handle( File storeDir ) throws IOException
                {
                    File branchedDataDir = newBranchedDataDir( storeDir );
                    moveAwayDb( storeDir, branchedDataDir );
                    for ( File file : getBranchedDataRootDirectory( storeDir ).listFiles() )
                    {
                        if ( isBranchedDataDirectory( file ) && !file.equals( branchedDataDir ) )
                        {
                            FileUtils.deleteRecursively( file );
                        }
                    }
                }
            },
    keep_none
            {
                @Override
                public void handle( File storeDir ) throws IOException
                {
                    cleanStoreDir( storeDir );
                }
            };

    public abstract void handle( File storeDir ) throws IOException;
}


text:
<?php

namespace auth;

class Module extends \yii\base\Module
{
	public $controllerNamespace = 'auth\controllers';

    /**
     * @var int
     * @desc Remember Me Time (seconds), default = 2592000 (30 days)
     */
    public $rememberMeTime = 2592000; // 30 days

    /**
     * @var array
     * @desc User model relation from other models
     * @see http://www.yiiframework.com/doc/guide/database.arr
     */
    public $relations = array();

    public $tableMap = array(
        'User' => 'User',
        'UserStatus' => 'UserStatus',
        'ProfileFieldValue' => 'ProfileFieldValue',
        'ProfileField' => 'ProfileField',
        'ProfileFieldType' => 'ProfileFieldType',
    );

    public $layoutLogged;

    public $attemptsBeforeCaptcha = 3; // Unsuccessful Login Attempts before Captcha

    public $referralParam = 'ref';

	/**
	 * @var int Seconds for token expiration
	 */
	public $passwordResetTokenExpire = 3600;

	public $supportEmail;

	public $superAdmins = ['admin'];

    /**
     * @var boolean Use only email for signup
     */
    public $signupWithEmailOnly = false;

	public function init()
	{
		parent::init();

		\Yii::$app->getI18n()->translations['auth.*'] = [
			'class' => 'yii\i18n\PhpMessageSource',
			'basePath' => __DIR__.'/messages',
		];
		$this->setAliases([
			'@auth' => __DIR__
		]);	}

}


text:
namespace Atata
{
    public interface IPageObjectVerificationProvider<out TPageObject> :
        IUIComponentVerificationProvider<TPageObject, TPageObject>
        where TPageObject : PageObject<TPageObject>
    {
    }
}


text:
#ifndef BIOSAL_SEQUENCE_STORE_H
#define BIOSAL_SEQUENCE_STORE_H

#include <genomics/data/dna_codec.h>

#include <core/structures/vector.h>
#include <core/structures/vector_iterator.h>

#include <core/system/memory_pool.h>

#include <engine/thorium/actor.h>

#define SCRIPT_SEQUENCE_STORE 0x47e2e424

/*
 * This is a BIOSAL DNA sequence store.
 *
 * It is possibler to distribute data by using a lot of these actors.
 */
struct biosal_sequence_store {
    struct core_vector sequences;
    struct biosal_dna_codec codec;
    int64_t received;
    int64_t expected;

    int iterator_started;
    int reservation_producer;
    struct core_vector_iterator iterator;

    int64_t left;
    int64_t last;

    struct core_memory_pool persistent_memory;

    int progress_supervisor;

    int required_kmers;

    int small_production_block_size;
    int big_production_block_size;
};

#define ACTION_RESERVE 0x00000d3c
#define ACTION_RESERVE_REPLY 0x00002ca8
#define ACTION_PUSH_SEQUENCE_DATA_BLOCK 0x00001160
#define ACTION_PUSH_SEQUENCE_DATA_BLOCK_REPLY 0x00004d02

#define ACTION_SEQUENCE_STORE_READY 0x00002c00

#define ACTION_SEQUENCE_STORE_ASK 0x00006b99
#define ACTION_SEQUENCE_STORE_ASK_REPLY 0x00007b13

#define ACTION_SEQUENCE_STORE_REQUEST_PROGRESS 0x0000648a
#define ACTION_SEQUENCE_STORE_REQUEST_PROGRESS_REPLY 0x000074a5

extern struct thorium_script biosal_sequence_store_script;

#endif


text:
var RightJS = (function(window, document, Object, Array, String, Function, Number, Math, undefined) {

%{source_code}

// globalizing the top-level variables
$ext(window, Object.without(RightJS, 'version', 'modules'));

return RightJS;
})(window, document, Object, Array, String, Function, Number, Math);


text:
typedef enum {AUTUMN, WINTER, SPRING, SUMMER} SEASON;

@interface NSDate (FCADateAndSeason)
-(SEASON)season;
-(NSString*)seasonString;
@end


text:
using System;
using System.Collections.Generic;
using System.Linq;

namespace _04._Files
{
    class File
    {
        public string Ext { get; set; }
        public long Size { get; set; }
    }
    class Program
    {
        static void Main()
        {
            Dictionary<string, List<File>> folders = new Dictionary<string, List<File>>();

            int numOfFiles = int.Parse(Console.ReadLine());

            for (int i = 0; i < numOfFiles; i++)
            {
                string text = Console.ReadLine();
                string[] args = text.Split('\\', ';');
                string root = args[0];
                string extension = args[args.Length - 2];
                long size = long.Parse(args[args.Length - 1]);

                if (!folders.ContainsKey(root))
                {
                    folders.Add(root, new List<File>());
                }

                var allFiles = folders[root];

                var existing = allFiles
                    .FirstOrDefault(x => x.Ext == extension);

                if (existing == null)
                {
                    File currFile = new File()
                    {
                        Ext = extension,
                        Size = size
                    };
                    folders[root].Add(currFile);
                }
                else
                {
                    existing.Size = size;
                }
            }
            string[] search = Console.ReadLine().Split();
            string serchedExt = search[0];
            string dir = search.Last();

            if (!folders.ContainsKey(dir))
            {
                Console.WriteLine("No");
                return;
            }

            var result = folders[dir]
                .Where(x => x.Ext.EndsWith(serchedExt))
                .OrderByDescending(x => x.Size)
                .ThenBy(x => x.Ext)
                .ToList();

            if (!folders[dir].Any(x => x.Ext.EndsWith(serchedExt)))
            {
                Console.WriteLine("No");
            }
            else
            {
                foreach (var item in result)
                {
                    Console.WriteLine($"{item.Ext} - {item.Size} KB ");
                }

            }

        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>CLUB ESTKD</title>

    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>

    <link href="vendor/magnific-popup/magnific-popup.css" rel="stylesheet">

    <link href="css/creative.css" rel="stylesheet">

        TAEKWONDO / WILD CODE SCHOOL / STRASBOURG
        <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">

        </button>

              Accueil

              Le club

              Horaires

              Contact

LE TAEKWONDO

Art martial coréen ancestral, le Taekwondo littéralement  » la voie des pieds et des poings " est devenu sport olympique à Sydney en 2000.
          Aujourd'hui, il est pratiqué par plus de 60 millions de Taekwondoïstes et 204 pays sont affiliés à la fédération mondiale de Taekwondo (W.T).
          Plusieurs formes de pratiques sont enseignées dont la self defense, le combat et le poomsé (combat imaginaire).

Qui nous sommes ?

Le 4 septembre 2017, Le club Wild Taekwondo Scool arrive sur Strasbourg pour proposer un sport nouveau et physsique à souhait.

            Après une expérience résussie sur Paris, Lyon, Lille et la loupe, nous vous proposons de venir découvrir une nouvelle expérience sportive alliant excellence et esprit d'équipe.

            Fort d'une équipe de 6 enseignants et d'un maitre venu tout droit de la corée, nous vous proposons une multitude d'activité et de crénau proche de chez vous.

            Pour se faire, plusieurs objectifs ont été définis durant toute la durée de l'olympiade. A l'issu du 02 février 2018, un des objectifs est d'atteindre 6 sportifs de haut niveau grâce notamment au plan de développement gravitant autour de 5 projets :

            Un véritable projet de club
            Une structure professionnelle
            Un projet inclus dans la ville
            Un programme à vocation sociale
            Un plan de performance vers Tokyo 2020

            Venez découvrir le club proche de chez vous

Qui sont nos entraineurs ?

                    BRETON Quentin

                    Ceinture noir 2eme Dan

                    Multiples Champions d'Alsace

                    KUENY Thomas

                    Ceinture noir 2EME Dan

                    Champion Nord-Est 2015 et 2017

                    MOUDNI Youssef

                    Ceinture noir 2EME DAN

                    Champion de france 2012 et 2015

                    REINBOLD Gregory

                    Vainqueur de la Coupe d'alsace

                    SESE Julia

                    Championne du monde 2016

                    STELTZLEN Sébastien

                    CHAMPION OLYMPIQUE 2014

Nous contacter

7 rue Georges Sand 67200 Strasbourg

06-50-49-65-23

              contact@wildtaekwondoschool.


text:
package io.cloudslang.content.google.utils.service

import java.net.Proxy.Type
import java.net.{Authenticator, InetSocketAddress, PasswordAuthentication, Proxy}

import com.google.api.client.googleapis.GoogleUtils
import com.google.api.client.http.javanet.NetHttpTransport
import org.apache.commons.lang3.StringUtils.EMPTY

/**
  * Created by victor on 2/25/17.
  */
object HttpTransportUtils {

  def getNetHttpTransport(proxyHost: Option[String] = None, proxyPort: Int = 80, proxyUser: Option[String] = None, proxyPassword: String = EMPTY): NetHttpTransport =
    new NetHttpTransport.Builder()
      .trustCertificates(GoogleUtils.getCertificateTrustStore)
      .setProxy(getProxy(proxyHost, proxyPort, proxyUser, proxyPassword))
      .build()

  def getProxy(proxyHostOpt: Option[String], proxyPort: Int, proxyUserOpt: Option[String], proxyPassword: String): Proxy = proxyHostOpt match {
    case None => Proxy.NO_PROXY
    case Some(proxyHost) =>
      proxyUserOpt match {
        case None => Unit
        case Some(proxyUser) =>
          Authenticator.setDefault(ProxyAuthenticator(proxyUser, proxyPassword))
      }
      new Proxy(Type.HTTP, InetSocketAddress.createUnresolved(proxyHost, proxyPort))
  }

  case class ProxyAuthenticator(user: String, password: String) extends Authenticator {
    override def getPasswordAuthentication = new PasswordAuthentication(user, password.toCharArray)
  }

}


text:
cask 'smartgit' do
  version '18.1.4'
  sha256 '4537105929752cd91c0db3e1d4dd832b9dd8a9faa811fac021989c80b2232e0d'

  url "https://www.syntevo.com/downloads/smartgit/smartgit-macosx-#{version.dots_to_underscores}.dmg"
  appcast 'https://www.syntevo.com/smartgit/changelog.txt'
  name 'SmartGit'
  homepage 'https://www.syntevo.com/smartgit/'

  app 'SmartGit.app'
  binary "#{appdir}/SmartGit.app/Contents/MacOS/SmartGit"
end


text:
var EMA = require('./EMA.js');

var Indicator = function(settings) {
  this.input = 'candle';
  this.lastClose = null;
  this.tsi = 0;
  this.inner = new EMA(settings.long);
  this.outer = new EMA(settings.short);
  this.absoluteInner = new EMA(settings.long);
  this.absoluteOuter = new EMA(settings.short);
}

Indicator.prototype.update = function(candle) {
  var close = candle.close;
  var prevClose = this.lastClose;

  if (prevClose === null) {
    // Set initial price to prevent invalid change calculation
    this.lastClose = close;
    // Do not calculate TSI on first close
    return;
  }

  var momentum = close - prevClose;

  this.inner.update(momentum);
  this.outer.update(this.inner.result);

  this.absoluteInner.update(Math.abs(momentum));
  this.absoluteOuter.update(this.absoluteInner.result);

  this.tsi = 100 * this.outer.result / this.absoluteOuter.result;

  this.lastClose = close;
}

module.exports = Indicator;


text:
package uk.co.quidos.gdsap.framework.common.services.impl;

import uk.co.quidos.gdsap.framework.common.Preference;
import uk.co.quidos.gdsap.framework.common.enums.ControlType;
import uk.co.quidos.gdsap.framework.common.enums.InputType;
import uk.co.quidos.gdsap.framework.common.enums.PreType;
import uk.co.quidos.gdsap.framework.common.enums.PreferenceRelId;
import uk.co.quidos.gdsap.framework.common.persistence.object.GdsapSysPreference;
import uk.co.quidos.gdsap.framework.sys.lang.enums.EnumUtils;

/**
 * @author peng.shi
 *
 */
public class BeanUtils
{
	public static GdsapSysPreference bo2do(Preference preference)
	{
		GdsapSysPreference gdsapSysPreference = new GdsapSysPreference();
		gdsapSysPreference.setTitle(preference.getTitle());
		gdsapSysPreference.setPreType(preference.getPreType().getCode());
		gdsapSysPreference.setInsertTime(preference.getInsertTime());
		gdsapSysPreference.setUpdateTime(preference.getUpdateTime());
		gdsapSysPreference.setInputType(preference.getInputType().getCode());
		gdsapSysPreference.setControlType(preference.getControlType().getCode());
		gdsapSysPreference.setContent(preference.getContent());
		gdsapSysPreference.setId(preference.getPreferenceRelId().getCode());
		return gdsapSysPreference;
	}

	public static Preference do2bo(GdsapSysPreference gdsapSysPreference)
	{
		Preference preference = new Preference();
		preference.setPreType((PreType)EnumUtils.getByCode(gdsapSysPreference.getPreType(), PreType.class));
		preference.setTitle(gdsapSysPreference.getTitle());
		preference.setContent(gdsapSysPreference.getContent());
		preference.setInsertTime(gdsapSysPreference.getInsertTime());
		preference.setUpdateTime(gdsapSysPreference.getUpdateTime());
		preference.setInputType((InputType)EnumUtils.getByCode(gdsapSysPreference.getInputType(),InputType.class));
		preference.setControlType((ControlType)EnumUtils.getByCode(gdsapSysPreference.getControlType(),ControlType.class));
		preference.setPreferenceRelId((PreferenceRelId)EnumUtils.getByCode(gdsapSysPreference.getId(), PreferenceRelId.class));
		return preference;
	}

}


text:
package com.wrapper.spotify.exceptions.detailed;

import com.wrapper.spotify.exceptions.SpotifyWebApiException;

/**
 * The server understood the request, but is refusing to fulfill it.
 */
public class ForbiddenException extends SpotifyWebApiException {

  public ForbiddenException() {
    super();
  }

  public ForbiddenException(String message) {
    super(message);
  }

  public ForbiddenException(String message, Throwable cause) {
    super(message, cause);
  }

}


text:
package me.chriskramp.test_support;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.context.internal.ManagedSessionContext;

public abstract class TestUnitOfWork {
  private SessionFactory sessionFactory;

  public TestUnitOfWork(SessionFactory sessionFactory) {
    this.sessionFactory = sessionFactory;
  }

  public void execute() {
    Session session = sessionFactory.openSession();
    ManagedSessionContext.bind(session);
    Transaction transaction = session.beginTransaction();

    performTransaction(sessionFactory);

    transaction.commit();
    session.close();
  }

  protected
  abstract void performTransaction(SessionFactory sessionFactory);
}


text:
package org.apache.hyracks.dataflow.std.structures;

public interface IHeap<T> {
    /**
     * Inserts a new element into the selectionTree
     *
     * @param element to be inserted
     */
    void insert(T element);

    /**
     * @return True of the selection tree does not have any element, false
     * otherwise
     */
    boolean isEmpty();

    /**
     * Removes all the elements in the tree
     */
    void reset();

    /**
     * Return the number of the inserted tuples
     *
     * @return
     */
    int getNumEntries();

}


text:
import groundstation.proto.channel_list_pb2
from groundstation.gref import Gref

from groundstation import logger
log = logger.getLogger(__name__)

def handle_newgreftip(self):
    proto_channels = groundstation.proto.channel_list_pb2.ChannelList()
    proto_channels.ParseFromString(self.payload)
    for channel in proto_channels.channels:
        for gref in channel.grefs:
            _gref = Gref(self.station.store, channel.channelname, gref.identifier)
            # Create a tip object to avoid upsetting fileutils
            tips = [tip.tip for tip in gref.tips]
            self.station.update_gref(_gref, tips, True)


text:
/* $OpenBSD: deattack.h,v 1.10 2006/09/16 19:53:37 djm Exp $ */

/*
 * Cryptographic attack detector for ssh - Header file
 *
 * Copyright (c) 1998 CORE SDI S.A., Buenos Aires, Argentina.
 *
 * All rights reserved. Redistribution and use in source and binary
 * forms, with or without modification, are permitted provided that
 * this copyright notice is retained.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES ARE DISCLAIMED. IN NO EVENT SHALL CORE SDI S.A. BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR
 * CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OR MISUSE OF THIS
 * SOFTWARE.
 *
 * Ariel Futoransky <futo@core-sdi.com>
 * <http://www.core-sdi.com>
 */

#ifndef _DEATTACK_H
#define _DEATTACK_H

/* Return codes */
#define DEATTACK_OK		0
#define DEATTACK_DETECTED	1
#define DEATTACK_DOS_DETECTED	2

int	 detect_attack(u_char *, u_int32_t);
#endif


text:
.PHONY: clean-pyc clean-build docs help
.DEFAULT_GOAL := help
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
	from urllib import pathname2url
except:
	from urllib.request import pathname2url

webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT
BROWSER := python -c "$$BROWSER_PYSCRIPT"

help:
	@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'

clean: clean-build clean-pyc clean-output

clean-output:
	rm -f output/*

clean-build: ## remove build artifacts
	rm -fr build/
	rm -fr dist/
	rm -fr *.egg-info

clean-pyc: ## remove Python file artifacts
	find . -name '*.pyc' -exec rm -f {} +
	find . -name '*.pyo' -exec rm -f {} +
	find . -name '*~' -exec rm -f {} +

lint: ## check style with flake8
	flake8 django_test_tools tests

test: clean-output ## run tests quickly with the default Python
	python runtests.py tests

test-all: ## run tests on every Python version with tox
	tox

coverage: ## check code coverage quickly with the default Python
	coverage run --source django_test_tools runtests.py tests
	coverage report -m
	coverage html
	open htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
	rm -f docs/django-test-tools.rst
	rm -f docs/modules.rst
	sphinx-apidoc -o docs/ django_test_tools
	$(MAKE) -C docs clean
	$(MAKE) -C docs html
	$(BROWSER) docs/_build/html/index.html

sdist: clean test
	python setup.py sdist
	python setup.py sdist bdist_wheel
	ls -l dist

patch: clean ## package and upload a release
	python ./scripts/bump.py --action=patch

minor: clean ## package and upload a release
	python ./scripts/bump.py --action=minor

upload: sdist
	git push origin master
	git push origin develop
	git push --tags
	twine upload ./dist/*

travis-push: clean
	python setup.py sdist
	python setup.py sdist bdist_wheel
	ls -l dist
	git push --tags
	git push origin master
	git push origin develop


text:
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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.

package com.google.collide.client.code;

import com.google.collide.client.AppContext;
import com.google.collide.client.code.autocomplete.integration.AutocompleteUiController;
import com.google.collide.client.code.debugging.DebuggingModelRenderer;
import com.google.collide.client.code.debugging.DebuggingSidebar;
import com.google.collide.client.code.debugging.EvaluationPopupController;
import com.google.collide.client.code.parenmatch.ParenMatchHighlighter;
import com.google.collide.client.diff.DeltaInfoBar;
import com.google.collide.client.diff.EditorDiffContainer;
import com.google.collide.client.editor.Editor;
import com.google.collide.client.editor.renderer.LineNumberRenderer;
import com.google.collide.client.filehistory.FileHistory;
import com.google.collide.client.filehistory.TimelineNode;
import com.google.collide.client.history.Place;
import com.google.collide.client.syntaxhighlighter.SyntaxHighlighterRenderer;
import com.google.collide.client.util.Elements;
import com.google.collide.client.util.ResizeController;
import com.google.collide.client.workspace.Header;
import com.google.collide.codemirror2.CodeMirror2;
import com.google.collide.mvp.CompositeView;
import com.google.collide.mvp.UiComponent;
import com.google.gwt.resources.client.CssResource;

import elemental.css.CSSStyleDeclaration;
import elemental.html.DivElement;
import elemental.html.Element;

// TODO: Rename the editor package to the code package since it should
// encapsulate the CodePerspective. Then move code editor code to editor.core etc...
/**
 * Presenter for the code perspective.
 *
 *  Contains:
 *
 *  1. Project navigation tree for current workspace.
 *
 *  2. Our working content area (where will attach the editor).
 *
 *  3. Right sidebar (where will attach debugging state panel).
 *
 *  4. Content area header (where will be shown path to the file, and other
 * controls).
 *
 */
public class CodePerspective extends UiComponent<CodePerspective.View> {

  /**
   * Static factory method for obtaining an instance of the CodePerspective.
   */
  public static CodePerspective create(View view,
      Place currentPlace,
      WorkspaceNavigation nav,
      EditableContentArea contentArea,
      AppContext context) {
    CodePerspective codePerspective =
        new CodePerspective(view, currentPlace, nav, contentArea, context);
    codePerspective.initResizeControllers();
    return codePerspective;
  }

  /**
   * CSS and images used by the CodePerspective.
   */
  public interface Resources
      extends
      Header.Resources,
      FileHistory.Resources,
      TimelineNode.Resources,
      WorkspaceNavigation.Resources,
      EditorDiffContainer.Resources,
      Editor.Resources,
      SyntaxHighlighterRenderer.Resources,
      LineNumberRenderer.Resources,
      ParenMatchHighlighter.Resources,
      DebuggingModelRenderer.Resources,
      DebuggingSidebar.Resources,
      EvaluationPopupController.Resources,
      DeltaInfoBar.Resources,
      CodeMirror2.Resources,
      EditableContentArea.Resources,
      AutocompleteUiController.Resources {

    @Source({"CodePerspective.css", "com/google/collide/client/common/constants.css"})
    Css codePerspectiveCss();
  }

  /**
   * Style names.
   */
  public interface Css extends CssResource {

    String base();

    int collapsedRightSplitterRight();

    String navArea();

    int navWidth();

    String resizing();

    String splitter();

    String rightSplitter();

    int splitterWidth();

    int splitterOverlap();

    String rightSidebarContentContainer();
  }

  /**
   * The View for the CodePerspective.
   */
  public static class View extends CompositeView<Void> {
    private final Resources res;
    private final Css css;

    private final WorkspaceNavigation.View navView;
    private final EditableContentArea.View contentView;

    /**
     * Wrapper element for the WorkspaceNavigation.View. We need a wrapper
     * because of the behavior of flex box.
     */
    private DivElement navArea;

    /** Splitter between the navigator and content area. */
    private DivElement splitter;

    /** Splitter between the content area and right sidebar. */
    private DivElement rightSplitter;

    /** Container for the right sidebar. */
    private DivElement rightSidebarContentContainer;

    public View(Resources res) {
      this.res = res;
      this.css = res.codePerspectiveCss();

      this.navView = new WorkspaceNavigation.View(res);
      this.contentView = new EditableContentArea.View(res);

      // Create the DOM and connect the elements together.
      setElement(Elements.createDivElement(css.base()));
      createDom();
    }

    public Element getSidebarElement() {
      return rightSidebarContentContainer;
    }

    public Element getNavigationElement() {
      return navArea;
    }

    public WorkspaceNavigation.View getNavigationView() {
      return navView;
    }

    public EditableContentArea.View getContentView() {
      return contentView;
    }

    public Element getSplitter() {
      return splitter;
    }

    public Element getRightSplitter() {
      return rightSplitter;
    }

    public Element getRightSidebarElement() {
      return rightSidebarContentContainer;
    }

    /**
     * Create the initial DOM structure for the workspace shell.
     */
    private void createDom() {

      // Instantiate DOM elems.
      navArea = Elements.createDivElement(css.navArea());
      splitter = Elements.createDivElement(css.splitter());

      rightSplitter = Elements.createDivElement(css.rightSplitter());
      rightSidebarContentContainer = Elements.createDivElement(css.rightSidebarContentContainer());

      Element elem = getElement();
      navArea.appendChild(navView.getElement());
      elem.appendChild(navArea);
      elem.appendChild(splitter);
      elem.appendChild(contentView.getElement());

      // Attach the right sidebar and splitter to the base element of the
      // WorkspaceContentArea.View.
      contentView.getElement().appendChild(rightSplitter);
      contentView.getElement().appendChild(rightSidebarContentContainer);

      rightSidebarContentContainer.getStyle().setVisibility(CSSStyleDeclaration.Visibility.HIDDEN);
    }
  }

  final WorkspaceNavigation nav;
  final EditableContentArea contentArea;
  private ResizeController leftResizeController;
  private ResizeController rightResizeController;
  private final Place currentPlace;

  CodePerspective(View view,
      Place currentPlace,
      WorkspaceNavigation nav,
      EditableContentArea contentArea,
      AppContext context) {
    super(view);
    this.currentPlace = currentPlace;
    this.nav = nav;
    this.contentArea = contentArea;
  }

  public EditableContentArea getContentArea() {
    return contentArea;
  }

  private void initResizeControllers() {
    View view = getView();
    leftResizeController = new NavigatorAreaResizeController(currentPlace,
        view.res,
        view.splitter,
        view.navArea,
        view.contentView.getElement(),
        view.css.splitterWidth(),
        view.css.splitterOverlap());
    leftResizeController.start();

    rightResizeController = new RightSidebarResizeController(currentPlace,
        view.res,
        view.rightSplitter,
        view.rightSidebarContentContainer,
        view.contentView.getContentElement(),
        view.css.splitterWidth(),
        view.css.collapsedRightSplitterRight(),
        contentArea.getView().getDefaultEditableContentAreaRight());
    rightResizeController.setNegativeDelta(true);
    rightResizeController.start();
  }
}


text:
VSA
===

The Viable System Agent, or VSA is a software implementation of the
Viable System Model (VSM), a model for autonomous systems developed
by Stafford Beer. The VSA provides structure, communications,
auditing and alerting as defined in the VSM. The VSA is used to
represent both viable systems and subordinate viable systems. This
is called recursion in the VSM. The VSA is intended to facilitate
creating and managing autonomous software systems.

Testing this distribution:

1) Change directories into the directory containing the distribution.
You should see the file, Rakefile in the top of the distribution.

2) Type the "rake" command. This will run all the unit testing for
the distribution.

Ruby 1.8 is not supported. Development is being done in Ruby 2.0.
The target platforms are 1.9, 2.0 and 2.1. Report test failures to
rbc@rbcarleton.com


text:
using Microsoft.Azure.WebJobs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AnotherConsoleApp {
    class Program {
        static void Main(string[] args) {
            Console.WriteLine("Start of Another Console App");

            var watcher = new WebJobsShutdownWatcher();
            Task.Run(() => {
                bool isCancelled = false;
                while (!isCancelled) {
                    if (watcher.Token.IsCancellationRequested) {
                        Console.WriteLine("Another Console App cancellation Requested!");
                        isCancelled = true;
                    }
                }
            }, watcher.Token).Wait();

            Console.WriteLine("Another Console App Cancelled!");
        }
    }
}


text:
module RuboCop
  module Cop
    module Style
      # This cop checks for redundant uses of `self`.
      #
      # `self` is only needed when:
      #
      # * Sending a message to same object with zero arguments in
      #   presence of a method name clash with an argument or a local
      #   variable.
      #
      #   Note, with using explicit self you can only send messages
      #   with public or protected scope, you cannot send private
      #   messages this way.
      #
      #   Example:
      #
      #   def bar
      #     :baz
      #   end
      #
      #   def foo(bar)
      #     self.bar # resolves name clash with argument
      #   end
      #
      #   def foo2
      #     bar = 1
      #     self.bar # resolves name clash with local variable
      #   end
      #
      # * Calling an attribute writer to prevent an local variable assignment
      #
      #   attr_writer :bar
      #
      #   def foo
      #     self.bar= 1 # Make sure above attr writer is called
      #   end
      #
      # Special cases:
      #
      # We allow uses of `self` with operators because it would be awkward
      # otherwise.
      class RedundantSelf < Cop
        MSG = 'Redundant `self` detected.'

        def initialize(config = nil, options = nil)
          super
          @allowed_send_nodes = []
          @local_variables = []
        end

        # Assignment of self.x

        def on_or_asgn(node)
          lhs, _rhs = *node
          allow_self(lhs)
        end

        alias_method :on_and_asgn, :on_or_asgn

        def on_op_asgn(node)
          lhs, _op, _rhs = *node
          allow_self(lhs)
        end

        # Using self.x to distinguish from local variable x

        def on_def(_node)
          @local_variables = []
        end

        def on_defs(_node)
          @local_variables = []
        end

        def on_args(node)
          node.children.each { |arg| on_argument(arg) }
        end

        def on_blockarg(node)
          on_argument(node)
        end

        def on_lvasgn(node)
          lhs, _rhs = *node
          @local_variables << lhs
        end

        # Detect offenses

        def on_send(node)
          receiver, method_name, *_args = *node
          return unless receiver && receiver.type == :self
          return if operator?(method_name) || keyword?(method_name) ||
            constant_name?(method_name) ||
            @allowed_send_nodes.include?(node) ||
            @local_variables.include?(method_name)

          add_offense(node, :expression)
        end

        def autocorrect(node)
          receiver, _method_name, *_args = *node
          @corrections << lambda do |corrector|
            corrector.remove(receiver.loc.expression)
            corrector.remove(node.loc.dot)
          end
        end

        private

        def on_argument(node)
          name, _ = *node
          @local_variables << name
        end

        def operator?(method_name)
          method_name.to_s =~ /\W/
        end

        def keyword?(method_name)
          [:alias, :and, :begin, :break, :case, :class, :def, :defined, :do,
           :else, :elsif, :end, :ensure, :false, :for, :if, :in, :module,
           :next, :nil, :not, :or, :redo, :rescue, :retry, :return, :self,
           :super, :then, :true, :undef, :unless, :until, :when, :while,
           :yield].include?(method_name)
        end

        def constant_name?(method_name)
          method_name.match(/^[A-Z]/)
        end

        def allow_self(node)
          return unless node.type == :send

          receiver, _method_name, *_args = *node
          @allowed_send_nodes << node if receiver && receiver.type == :self
        end
      end
    end
  end
end


text:
//  Copyright (c) 2012 Mehmet Balman
//  Copyright (c) 2012 Hartmut Kaiser
//
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <hpx/hpx_init.hpp>
#include <hpx/include/lcos.hpp>
#include <hpx/include/actions.hpp>
#include <hpx/include/components.hpp>
#include <hpx/include/iostreams.hpp>
#include <hpx/include/serialization.hpp>

#include <cstddef>
#include <iostream>
#include <memory>
#include <utility>
#include <vector>

///////////////////////////////////////////////////////////////////////////////
const std::size_t vsize_default = 1024*1024;
const std::size_t numiter_default = 5;

///////////////////////////////////////////////////////////////////////////////
void on_recv(hpx::naming::id_type to, std::vector<double> const & in,
    std::size_t counter);
HPX_PLAIN_ACTION(on_recv, on_recv_action);

void on_recv(hpx::naming::id_type to, std::vector<double> const & in,
    std::size_t counter)
{
    // received vector in
    if (--counter == 0) return;

    // send it to remote locality (to), and wait until it is received
    std::vector<double> data(in);

    on_recv_action act;
    act(to, hpx::find_here(), std::move(data), counter);
}

///////////////////////////////////////////////////////////////////////////////
void on_recv_ind(hpx::naming::id_type to,
    std::shared_ptr<std::vector<double> > const& in, std::size_t counter);
HPX_PLAIN_ACTION(on_recv_ind, on_recv_ind_action);

void on_recv_ind(hpx::naming::id_type to,
    std::shared_ptr<std::vector<double> > const& in, std::size_t counter)
{
    // received vector in
    if (--counter == 0) return;

    // send it to remote locality (to), and wait until it is received
    std::shared_ptr<std::vector<double> > data(
        std::make_shared<std::vector<double> >(*in));

    on_recv_ind_action act;
    act(to, hpx::find_here(), data, counter);
}

///////////////////////////////////////////////////////////////////////////////
int hpx_main(boost::program_options::variables_map &b_arg)
{
    std::size_t const vsize = b_arg["vsize"].as<std::size_t>();
    std::size_t const numiter = b_arg["numiter"].as<std::size_t>() * 2;
    bool verbose = b_arg["verbose"].as<bool>();

    std::vector<hpx::naming::id_type> localities = hpx::find_remote_localities();

    hpx::naming::id_type to;
    if(localities.size() == 0)
    {
        to = hpx::find_here();
    }
    else
    {
        to = localities[0]; // send to first remote locality
    }

    // test sending messages back and forth using a larger vector as one of
    // the arguments
    {
        std::vector<double> data(vsize, double(3.11));

        hpx::util::high_resolution_timer timer1;

        if (numiter != 0) {
            on_recv_action act;
            act(to, hpx::find_here(), data, numiter);
        }

        double time = timer1.elapsed();

        if (verbose) {
            std::cout << "[hpx_pingpong]" << std::endl
                    << "total_time(secs)=" << time << std::endl
                    << "vsize=" << vsize << " = " << vsize * sizeof(double)
                    << " Bytes" << std::endl
                    << "bandwidth(MiB/s)="
                    << (((vsize * sizeof(double) * numiter) / time) / 1024) / 1024
                    << std::endl
                    << "localities=" << localities.size() << std::endl
                    << "numiter=" << numiter << std::endl;
        }
        else {
            std::cout << "[hpx_pingpong]"
                    << ":total_time(secs)=" << time
                    << ":vsize=" << vsize
                    << ":bandwidth(MiB/s)="
                    << (((vsize * sizeof(double) * numiter) / time) / 1024) / 1024
                    << ":localities=" << localities.size()
                    << ":numiter=" << numiter << std::endl;
        }
    }

    // do the same but with a wrapped vector
    /*
    {
        std::shared_ptr<std::vector<double> > data(
            std::make_shared<std::vector<double> >(vsize, double(3.11)));

        hpx::util::high_resolution_timer timer1;

        if (numiter != 0) {
            on_recv_ind_action act;
            act(to, hpx::find_here(), data, numiter);
        }

        double time = timer1.elapsed();

        std::cout << "[hpx_pingpong]"
                  << ":total_time(secs)=" << time
                  << ":vsize=" << vsize
                  << ":bandwidth(GB/s)=" << (vsize * sizeof(double) * numiter)
                    / (time * 1024 * 1024)
                  << ":localities=" << localities.size()
                  << ":numiter=" << numiter << std::endl;
    }
    */

    hpx::finalize();
    return 0;
}

int main(int argc, char* argv[])
{
    namespace po = boost::program_options;
    po::options_description description("HPX pingpong example");

    description.add_options()
        ( "vsize", po::value<std::size_t>()->default_value(vsize_default),
          "number of elements (doubles) to send/receive  (integer)")
        ( "numiter", po::value<std::size_t>()->default_value(numiter_default),
          "number of ping-pong iterations")
        ( "verbose", po::value<bool>()->default_value(true),
         "verbosity of output,if false output is for awk")
        ;

    return hpx::init(description, argc, argv);
}


text:
#import "SLTBoard.h"

@class SLTCells;

/// <summary>
/// The SLTMatchingBoard class represents the matching game board.
/// </summary>
@interface SLTMatchingBoard : SLTBoard

/// The cells of the board.
@property(nonatomic, strong, readonly) SLTCells* cells;

/// The number of rows.
@property(nonatomic, assign, readonly) NSInteger rows;

/// The number of columns.
@property(nonatomic, assign, readonly) NSInteger cols;

/**
 * @brief Inits an instance of @b SLTMatchingBoard class with the given cells, layers and properties.
 *
 * @param theCells The cells of the board.
 * @param theLayers The layers of the board.
 * @param theProperties The board associated properties.
 * @return @return The instance of @b SLTMatchingBoard class.
 */
-(id) initWithCells:(SLTCells*)theCells layers:(NSMutableArray *)theLayers andProperties:(NSDictionary *)theProperties;

@end


text:
package net.jp2p.container.properties;

import net.jp2p.container.component.ILeaf;
import net.jp2p.container.component.INode;

public interface IDescendant<T, U extends Object> extends INode<T, U>, ILeaf<U> {}


text:
: '@(#)convertgeom.sh 22.1 03/24/08 1999-2002 '
#
#
# Copyright (C) 2015  University of Oregon
#
# You may distribute under the terms of either the GNU General Public
# License or the Apache License, as specified in the LICENSE file.
#
# For more information, see the LICENSE file.
#
#
#! /bin/sh -f

# Takes an image file and converts the file format and resizes
# First argument is the size, second argument is the layout, third argument is
# the plotter, fourth argument is the filename, fifth argument is the filename
# to be converted to, sixth argument if given is type of file to be converted
# to, otherwise the ending of the file (e.g. gif) is considered to be the type

if test $# -gt 4
then
    size=$1
    layout=$2
    plotter=$3
    file="$4"
    filewrite="$5"

    if [ $layout -ne 0 ]
    then
	convert -rotate $layout "$file" "$file"
    fi
    if test $# -gt 5
    then
	type=$6
	# -page -30+770 assumes a page 790 or less (letter 612x792)
	# and it puts the image 30 dots in from the left and for letter
	# size, 22 dots down.  A4 is longer so more margin si left at the top
	convert -geometry $size -page -30+770 "$file" $type:"$filewrite"
	rm "$file"
    else
        convert -geometry $size -page -30+770 "$file" "$filewrite"
	rm "$file"
    fi

    vnmr_cdump "$filewrite" $plotter
else
    echo "Usage: needs 3 arguments"
fi


text:
<?php

namespace figdice\classes\tags;

use figdice\classes\Context;
use figdice\classes\TagFig;
use figdice\exceptions\FeedClassNotFoundException;
use figdice\exceptions\RequiredAttributeException;

class TagFigFeed extends TagFig {
	const TAGNAME = 'feed';

	private $feedClass = null;

    /**
     * @param Context $context
     *
     * @return string
     * @throws FeedClassNotFoundException
     */
    public function render(Context $context)
    {
        $this->fig_feed($context);
        return '';
    }

    /**
     * @param $figNamespace
     * @param array $attributes
     *
     * @throws RequiredAttributeException
     */
    public function setAttributes($figNamespace, array $attributes)
    {
        // We don't call the parent version, which does extraneous work of resolving conds and walks etc.,
        // whereas we just need to check existence of class attribute.
        // A feed tag is oblivious to other control directives.

        $this->attributes = $attributes;

        $this->feedClass = isset($this->attributes['class']) ? $this->attributes['class'] : null;
        if(null === $this->feedClass) {
            throw new RequiredAttributeException(
                $this->getTagName(),
                $this->xmlLineNumber,
                'class'
            );
        }

    }

    /**
     * Process <fig:feed> tag.
     * This tag accepts the following attributes:
     *  - class = the name of the Feed class to instanciate and run.
     *  - target = the mount point in the global universe.
     *
     * @param Context $context
     * @throws FeedClassNotFoundException
     */
    private function fig_feed(Context $context) {

        //Set the parameters for the feed class:
        //the parameters are an assoc array made of the
        //scalar attributes of the fig:feed tag other than fig:* and
        //class and target attributes.
        $feedParameters = array();
        foreach($this->attributes as $attribName=>$attribText) {
            if( (! $context->view->isFigPrefix($attribName)) &&
                ($attribName != 'class') && ($attribName != 'target') ) {
                $feedParameters[$attribName] = $this->evaluate($context, $attribText);
            }
        }

        //TODO: catch exception, to enrich with fig xml file+line, and rethrow.
        $feedInstance = $context->view->createFeed($this->feedClass, $feedParameters);

        //At this point the feed instance must be created.
        //If not, there was no factory to handle its loading.
        if(! $feedInstance) {
            throw new FeedClassNotFoundException($this->feedClass, null, $this->xmlLineNumber);
        }

        //It is possible to simply invoke a Feed class and
        //discard its result, by not defining a target to the tag.
        $mountPoint = null;
        if(isset($this->attributes['target'])) {
            $mountPoint = $this->attributes['target'];
        }

        $feedInstance->setParameters($feedParameters);

        // The run method of the Feed might throw a FeedRuntimeException...
        // It means that the problem encountered is severe enough, for the Feed to
        // request that the View rendering should stop.
        // In this case, the controller is responsible for treating accordingly.
        $subUniverse = $feedInstance->run();

        if($mountPoint !== null) {
            $context->view->mount($mountPoint, $subUniverse);
        }

    }

    public function serialize()
    {
        return serialize([
            'class' => $this->feedClass,
            'attr' => $this->attributes
        ]);
    }

    public function unserialize($serialized)
    {
        $data = unserialize($serialized);
        $this->feedClass = $data['class'];
        $this->attributes = $data['attr'];
    }
}


text:
{{ home.heroTitle }}

The Amazing Web App

<input type="text" ng-model="newTask.text">
<input type="button" ng-click="addTask(newTask)" value="Save">

Completed and Older Tasks

    My To-Do List

 7 || task.completed == true">
        {{ task.text }}
        Task Completed


text:
import sys
import testtools
import threading
import six

from concurrent.futures import as_completed
from six.moves.queue import Queue, Empty
from time import sleep

from swiftclient import multithreading as mt

class ThreadTestCase(testtools.TestCase):
    def setUp(self):
        super(ThreadTestCase, self).setUp()
        self.got_items = Queue()
        self.got_args_kwargs = Queue()
        self.starting_thread_count = threading.active_count()

    def _func(self, conn, item, *args, **kwargs):
        self.got_items.put((conn, item))
        self.got_args_kwargs.put((args, kwargs))

        if item == 'sleep':
            sleep(1)
        if item == 'go boom':
            raise Exception('I went boom!')

        return 'success'

    def _create_conn(self):
        return "This is a connection"

    def _create_conn_fail(self):
        raise Exception("This is a failed connection")

    def assertQueueContains(self, queue, expected_contents):
        got_contents = []
        try:
            while True:
                got_contents.append(queue.get(timeout=0.1))
        except Empty:
            pass
        if isinstance(expected_contents, set):
            got_contents = set(got_contents)
        self.assertEqual(expected_contents, got_contents)

class TestConnectionThreadPoolExecutor(ThreadTestCase):
    def setUp(self):
        super(TestConnectionThreadPoolExecutor, self).setUp()
        self.input_queue = Queue()
        self.stored_results = []

    def tearDown(self):
        super(TestConnectionThreadPoolExecutor, self).tearDown()

    def test_submit_good_connection(self):
        ctpe = mt.ConnectionThreadPoolExecutor(self._create_conn, 1)
        with ctpe as pool:
            # Try submitting a job that should succeed
            f = pool.submit(self._func, "succeed")
            f.result()
            self.assertQueueContains(
                self.got_items,
                [("This is a connection", "succeed")]
            )

            # Now a job that fails
            went_boom = False
            try:
                f = pool.submit(self._func, "go boom")
                f.result()
            except Exception as e:
                went_boom = True
                self.assertEquals('I went boom!', str(e))
            self.assertTrue(went_boom)

            # Has the connection been returned to the pool?
            f = pool.submit(self._func, "succeed")
            f.result()
            self.assertQueueContains(
                self.got_items,
                [
                    ("This is a connection", "go boom"),
                    ("This is a connection", "succeed")
                ]
            )

    def test_submit_bad_connection(self):
        ctpe = mt.ConnectionThreadPoolExecutor(self._create_conn_fail, 1)
        with ctpe as pool:
            # Now a connection that fails
            connection_failed = False
            try:
                f = pool.submit(self._func, "succeed")
                f.result()
            except Exception as e:
                connection_failed = True
                self.assertEquals('This is a failed connection', str(e))
            self.assertTrue(connection_failed)

            # Make sure we don't lock up on failed connections
            connection_failed = False
            try:
                f = pool.submit(self._func, "go boom")
                f.result()
            except Exception as e:
                connection_failed = True
                self.assertEquals('This is a failed connection', str(e))
            self.assertTrue(connection_failed)

    def test_lazy_connections(self):
        ctpe = mt.ConnectionThreadPoolExecutor(self._create_conn, 10)
        with ctpe as pool:
            # Submit multiple jobs sequentially - should only use 1 conn
            f = pool.submit(self._func, "succeed")
            f.result()
            f = pool.submit(self._func, "succeed")
            f.result()
            f = pool.submit(self._func, "succeed")
            f.result()

            expected_connections = [(0, "This is a connection")]
            expected_connections.extend([(x, None) for x in range(1, 10)])

            self.assertQueueContains(
                pool._connections, expected_connections
            )

        ctpe = mt.ConnectionThreadPoolExecutor(self._create_conn, 10)
        with ctpe as pool:
            fs = []
            f1 = pool.submit(self._func, "sleep")
            f2 = pool.submit(self._func, "sleep")
            f3 = pool.submit(self._func, "sleep")
            fs.extend([f1, f2, f3])

            expected_connections = [
                (0, "This is a connection"),
                (1, "This is a connection"),
                (2, "This is a connection")
            ]
            expected_connections.extend([(x, None) for x in range(3, 10)])

            for f in as_completed(fs):
                f.result()

            self.assertQueueContains(
                pool._connections, expected_connections
            )

class TestOutputManager(testtools.TestCase):

    def test_instantiation(self):
        output_manager = mt.OutputManager()

        self.assertEqual(sys.stdout, output_manager.print_stream)
        self.assertEqual(sys.stderr, output_manager.error_stream)

    def test_printers(self):
        out_stream = six.StringIO()
        err_stream = six.StringIO()
        starting_thread_count = threading.active_count()

        with mt.OutputManager(
                print_stream=out_stream,
                error_stream=err_stream) as thread_manager:

            # Sanity-checking these gives power to the previous test which
            # looked at the default values of thread_manager.print/error_stream
            self.assertEqual(out_stream, thread_manager.print_stream)
            self.assertEqual(err_stream, thread_manager.error_stream)

            # No printing has happened yet, so no new threads
            self.assertEqual(starting_thread_count,
                             threading.active_count())

            thread_manager.print_msg('one-argument')
            thread_manager.print_msg('one %s, %d fish', 'fish', 88)
            thread_manager.error('I have %d problems, but a %s is not one',
                                 99, u'\u062A\u062A')
            thread_manager.print_msg('some\n%s\nover the %r', 'where',
                                     u'\u062A\u062A')
            thread_manager.error('one-error-argument')
            thread_manager.error('Sometimes\n%.1f%% just\ndoes not\nwork!',
                                 3.14159)

            # Now we have a thread for error printing and a thread for
            # normal print messages
            self.assertEqual(starting_thread_count + 2,
                             threading.active_count())

        # The threads should have been cleaned up
        self.assertEqual(starting_thread_count, threading.active_count())

        out_stream.seek(0)
        if six.PY3:
            over_the = "over the '\u062a\u062a'\n"
        else:
            over_the = "over the u'\\u062a\\u062a'\n"
        self.assertEqual([
            'one-argument\n',
            'one fish, 88 fish\n',
            'some\n', 'where\n', over_the,
        ], list(out_stream.readlines()))

        err_stream.seek(0)
        first_item = u'I have 99 problems, but a \u062A\u062A is not one\n'
        if six.PY2:
            first_item = first_item.encode('utf8')
        self.assertEqual([
            first_item,
            'one-error-argument\n',
            'Sometimes\n', '3.1% just\n', 'does not\n', 'work!\n',
        ], list(err_stream.readlines()))

        self.assertEqual(3, thread_manager.error_count)


text:
function[max] =canguro(num)
    num = char(num)
    digitos = [num(1), num(2)]
    digitos = double(digitos)
    digitos = sum(digitos)
    divisor = rem(num, digitos)
end


text:
CREATE TABLE t2(a);
INSERT INTO t2 VALUES(1);
INSERT INTO t2 VALUES(2);
INSERT INTO t2 VALUES(3);
CREATE TABLE t3(x,y,UNIQUE(x,y));
INSERT INTO t3 VALUES(1,11);
INSERT INTO t3 VALUES(2,NULL);
SELECT * FROM t2 LEFT JOIN t3 ON a=x WHERE +y IS NULL;


text:
import React, { Component } from 'react';

// Parent Component
class BlankSpace extends Component {
  render() {
    return(

        Google{" "}
        Facebook

    )
  }
}

export default BlankSpace