text:
package org.apache.geode.management.internal.cli.commands;

import static org.apache.geode.distributed.ConfigurationProperties.DURABLE_CLIENT_ID;
import static org.apache.geode.distributed.ConfigurationProperties.DURABLE_CLIENT_TIMEOUT;
import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
import static org.apache.geode.test.awaitility.GeodeAwaitility.await;

import java.util.Properties;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.cache.Region;
import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.client.ClientCacheFactory;
import org.apache.geode.cache.query.CqAttributesFactory;
import org.apache.geode.cache.query.CqException;
import org.apache.geode.cache.query.CqExistsException;
import org.apache.geode.cache.query.QueryService;
import org.apache.geode.cache.query.RegionNotFoundException;
import org.apache.geode.cache.query.data.Portfolio;
import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.internal.AvailablePortHelper;
import org.apache.geode.internal.cache.InternalCache;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
import org.apache.geode.test.dunit.Host;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.rules.ClientVM;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.categories.GfshTest;
import org.apache.geode.test.junit.rules.GfshCommandRule;

@Category({GfshTest.class}) // GEODE-1705 GEODE-3404
                            // GEODE-3359
@SuppressWarnings("serial")
public class DurableClientCommandsDUnitTest {

  private static final String REGION_NAME = "stocks";
  private static final String CQ1 = "cq1";
  private static final String CQ2 = "cq2";
  private static final String CQ3 = "cq3";
  private static final String CLIENT_NAME = "dc1";

  private MemberVM locator, server;

  private ClientVM client;

  @Rule
  public GfshCommandRule gfsh = new GfshCommandRule();

  @Rule
  public ClusterStartupRule lsRule = new ClusterStartupRule();

  @Before
  public void setup() throws Exception {
    int jmxPort = AvailablePortHelper.getRandomAvailableTCPPort();
    Properties props = new Properties();
    props.setProperty(LOG_LEVEL, "fine");
    props.setProperty(ConfigurationProperties.JMX_MANAGER_HOSTNAME_FOR_CLIENTS, "localhost");
    props.setProperty(ConfigurationProperties.JMX_MANAGER_PORT, "" + jmxPort);
    locator = lsRule.startLocatorVM(0, props);

    int locatorPort = locator.getPort();
    server = lsRule.startServerVM(1,
        thisServer -> thisServer.withRegion(RegionShortcut.REPLICATE, REGION_NAME)
            .withConnectionToLocator(locatorPort));

    client = lsRule.startClientVM(2, getClientProps(CLIENT_NAME, "300"), (ccf) -> {
      ccf.setPoolSubscriptionEnabled(true);
      ccf.addPoolLocator("localhost", locatorPort);
    });

    gfsh.connectAndVerify(locator);
  }

  @Test
  public void testListDurableClientCqs() {
    setupCqs();

    CommandStringBuilder csb = new CommandStringBuilder(CliStrings.LIST_DURABLE_CQS);
    csb.addOption(CliStrings.LIST_DURABLE_CQS__DURABLECLIENTID, CLIENT_NAME);
    String commandString = csb.toString();

    gfsh.executeAndAssertThat(commandString).statusIsSuccess().containsOutput(CQ1)
        .containsOutput(CQ2).containsOutput(CQ3);

    closeCq(CQ1);
    closeCq(CQ2);
    closeCq(CQ3);

    csb = new CommandStringBuilder(CliStrings.LIST_DURABLE_CQS);
    csb.addOption(CliStrings.LIST_DURABLE_CQS__DURABLECLIENTID, CLIENT_NAME);
    commandString = csb.toString();
    String errorMessage =
        CliStrings.format(CliStrings.LIST_DURABLE_CQS__NO__CQS__FOR__CLIENT, CLIENT_NAME);
    gfsh.executeAndAssertThat(commandString).statusIsError().containsOutput(errorMessage);
  }

  @Test
  public void testCloseDurableClients() {
    setupCqs();
    closeDurableClient();

    CommandStringBuilder csb = new CommandStringBuilder(CliStrings.CLOSE_DURABLE_CLIENTS);
    csb.addOption(CliStrings.CLOSE_DURABLE_CLIENTS__CLIENT__ID, CLIENT_NAME);
    String commandString = csb.toString();

    await().untilAsserted(() -> {
      gfsh.executeAndAssertThat(commandString).statusIsSuccess();
    });

    String errorMessage = CliStrings.format(CliStrings.NO_CLIENT_FOUND_WITH_CLIENT_ID, CLIENT_NAME);
    gfsh.executeAndAssertThat(commandString).statusIsError().containsOutput(errorMessage);
  }

  @Test
  public void testCloseDurableCQ() {
    setupCqs();
    closeDurableClient();

    CommandStringBuilder csb = new CommandStringBuilder(CliStrings.CLOSE_DURABLE_CQS);
    csb.addOption(CliStrings.CLOSE_DURABLE_CQS__DURABLE__CLIENT__ID, CLIENT_NAME);
    csb.addOption(CliStrings.CLOSE_DURABLE_CQS__NAME, CQ1);
    String commandString = csb.toString();

    gfsh.executeAndAssertThat(commandString).statusIsSuccess();

    csb = new CommandStringBuilder(CliStrings.CLOSE_DURABLE_CQS);
    csb.addOption(CliStrings.CLOSE_DURABLE_CQS__DURABLE__CLIENT__ID, CLIENT_NAME);
    csb.addOption(CliStrings.CLOSE_DURABLE_CQS__NAME, CQ1);
    commandString = csb.toString();

    gfsh.executeAndAssertThat(commandString).statusIsError();
  }

  @Test
  public void testCountSubscriptionQueueSize() {
    setupCqs();

    doPuts(REGION_NAME, Host.getHost(0).getVM(1));

    CommandStringBuilder csb = new CommandStringBuilder(CliStrings.COUNT_DURABLE_CQ_EVENTS);
    csb.addOption(CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID, CLIENT_NAME);
    String commandString = csb.toString();

    gfsh.executeAndAssertThat(commandString).statusIsSuccess().containsOutput("4");

    csb = new CommandStringBuilder(CliStrings.COUNT_DURABLE_CQ_EVENTS);
    csb.addOption(CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID, CLIENT_NAME);
    csb.addOption(CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CQ__NAME, CQ3);
    commandString = csb.toString();

    gfsh.executeAndAssertThat(commandString).statusIsSuccess();

    // CLOSE all the cqs
    closeCq(CQ1);
    closeCq(CQ2);
    closeCq(CQ3);

    // Run the commands again
    csb = new CommandStringBuilder(CliStrings.COUNT_DURABLE_CQ_EVENTS);
    csb.addOption(CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID, CLIENT_NAME);
    csb.addOption(CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CQ__NAME, CQ1);
    commandString = csb.toString();

    String errorMessage = CliStrings
        .format(CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE_CQ_NOT_FOUND, CLIENT_NAME, CQ1);
    gfsh.executeAndAssertThat(commandString).statusIsError().containsOutput(errorMessage);

    csb = new CommandStringBuilder(CliStrings.COUNT_DURABLE_CQ_EVENTS);
    csb.addOption(CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID, CLIENT_NAME);
    commandString = csb.toString();

    gfsh.executeAndAssertThat(commandString).statusIsSuccess();

    // Disconnect the client
    closeDurableClient();

    // Close the client
    csb = new CommandStringBuilder(CliStrings.CLOSE_DURABLE_CLIENTS);
    csb.addOption(CliStrings.CLOSE_DURABLE_CLIENTS__CLIENT__ID, CLIENT_NAME);
    String commandString1 = csb.toString();

    await().untilAsserted(() -> {
      gfsh.executeAndAssertThat(commandString1).statusIsSuccess();
    });

    csb = new CommandStringBuilder(CliStrings.COUNT_DURABLE_CQ_EVENTS);
    csb.addOption(CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID, CLIENT_NAME);
    commandString = csb.toString();

    errorMessage = CliStrings.format(CliStrings.NO_CLIENT_FOUND_WITH_CLIENT_ID, CLIENT_NAME);

    gfsh.executeAndAssertThat(commandString).statusIsError().containsOutput(errorMessage);
  }

  /**
   * Close the cq from the client-side
   *
   * @param cqName , Name of the cq which is to be close.
   */
  private void closeCq(final String cqName) {
    client.invoke(() -> {
      QueryService qs =
          InternalDistributedSystem.getConnectedInstance().getCache().getQueryService();

      try {
        qs.getCq(cqName).close();
      } catch (CqException e) {
        throw new RuntimeException(e);
      }
    });
  }

  private void setupCqs() {
    client.invoke(() -> {
      QueryService qs = ClusterStartupRule.getClientCache().getQueryService();
      CqAttributesFactory cqAf = new CqAttributesFactory();

      try {
        qs.newCq(CQ1, "select * from /" + REGION_NAME, cqAf.create(), true).execute();
        qs.newCq(CQ2, "select * from /" + REGION_NAME + " where id = 1", cqAf.create(), true)
            .execute();
        qs.newCq(CQ3, "select * from /" + REGION_NAME + " where id > 2", cqAf.create(), true)
            .execute();
      } catch (CqException | CqExistsException | RegionNotFoundException e) {
        throw new RuntimeException(e);
      }
    });
  }

  /**
   * Does few puts on the region on the server
   */
  private void doPuts(final String regionName, final VM serverVM) {
    serverVM.invoke(() -> {
      InternalCache cache = InternalDistributedSystem.getConnectedInstance().getCache();
      Region region = cache.getRegion(regionName);

      Portfolio p1 = new Portfolio();
      p1.ID = 1;
      p1.names = new String[] {"AAPL", "VMW"};

      Portfolio p2 = new Portfolio();
      p2.ID = 2;
      p2.names = new String[] {"EMC", "IBM"};

      Portfolio p3 = new Portfolio();
      p3.ID = 5;
      p3.names = new String[] {"DOW", "TON"};

      Portfolio p4 = new Portfolio();
      p4.ID = 5;
      p4.names = new String[] {"ABC", "EBAY"};

      region.put("p1", p1);
      region.put("p2", p2);
      region.put("p3", p3);
      region.put("p4", p4);
    });
  }

  private void closeDurableClient() {
    client.invoke(() -> ClientCacheFactory.getAnyInstance().close(true));
  }

  protected Properties getClientProps(String durableClientId, String durableClientTimeout) {
    Properties config = new Properties();
    config.setProperty(MCAST_PORT, "0");
    config.setProperty(DURABLE_CLIENT_ID, durableClientId);
    config.setProperty(DURABLE_CLIENT_TIMEOUT, String.valueOf(durableClientTimeout));
    return config;
  }

}


text:
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from database import *
from crf import *
import sys, os, math
import numpy as np
import copy
from utilfile import FileUtil

class InstanceFilterData(object):
#     print 'instanace'
    _instance = None
    _lst = []
    _lstFilter = []
    def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = super(InstanceFilterData, cls).__new__(
                                cls, *args, **kwargs)
            db = Database()
            cls._lst = db.select_filter_el()
            crfWordSeg = CRFWordSegment()
            for x in cls._lst:
                if x != '':
                    segMsg = crfWordSeg.crfpp(x)
#                     print ' '.join(segMsg)
                    cls._lstFilter.append(' '.join(segMsg))
        return cls._instance

    def getFilterData(self):
        return self._lstFilter

class CRFWordSegment(object):

    def process_ans(self, lst):
        b_str = ''
        ans_str = ''
        for line_data in lst:
            try :
                data = line_data.split('\t')
                b_data = data[3][:-1]
                if b_data == 'B':
                    b_str = b_str + 'B'
                else:
                    b_str = b_str + 'I'
                ans_str = ans_str+data[0]
            except Exception, e:
                b_str = b_str+'B'
                ans_str = ans_str+' '
        return b_str, ans_str

    def crfpp(self, msg):
        crf = CRF()
        fileUtil = FileUtil()
        crf.create_file_input(msg)
        os.system('crf_test -m model1 crf.test.data > crf.result')

        lst = fileUtil.read_file('crf.result')
#         lst = [a for a in lst if a != u'\n']
#         str_ans = reduce(lambda x,y:x+y, [a.split('\t')[0] for a in lst])

        # ans = reduce(lambda x,y:x+y, [a.split('\t')[3][:-1] for a in lst])
#         lst_col3 = [a.split('\t')[3][:-1] for a in lst]
        lst_col3, str_ans = self.process_ans(lst)
        lst_ans = [n for (n, e) in enumerate(lst_col3) if e == 'B']
        result_lst = []
        for i in range(len(lst_ans)-1):
            a = lst_ans[i]
            b = lst_ans[i+1]
            result_lst.append(str_ans[a:b])
        result_lst.append(str_ans[b:len(str_ans)])
        return result_lst

class FilterComputation(object):

    def __init__(self):
        pass

    def findResutl(self, result):
        for x in result:
            if x > 0.4:
                return 'no'
        return 'yes'

    def debugResult(self, result, document):
        for x in range(0, len(result)):
            print ' d ',result[x],' -- ',document[x]

    def computeCos(self, message, corpus):
        try:
            crfWordSeg = CRFWordSegment()
            lstInput = crfWordSeg.crfpp(message)
            inMessage = ' '.join(lstInput)
            documents = copy.copy(corpus)
            documents.insert(0, inMessage)
            tfidf_vectorizer = TfidfVectorizer()
            tfidf_matrix = tfidf_vectorizer.fit_transform(documents)
            result_lst = cosine_similarity(tfidf_matrix[0:1], tfidf_matrix)
            result = result_lst[0]
            return result
        except Exception as e:
            print e

    def invFBFilter(self, message):
        try:
            crfWordSeg = CRFWordSegment()
            lstInput = crfWordSeg.crfpp(message)
            inMessage = ' '.join(lstInput)
            insData = InstanceFilterData()
            lst = insData.getFilterData()
            documents = copy.copy(lst)
            documents.insert(0, inMessage)
            tfidf_vectorizer = TfidfVectorizer()
            tfidf_matrix = tfidf_vectorizer.fit_transform(documents)
            result_lst = cosine_similarity(tfidf_matrix[0:1], tfidf_matrix)
            result = result_lst[0]
            map = {}
            for x in range(0, len(documents)):
                key = documents[x]
                value = result[x]
                map[key] = value
#             print map
            return map
        except Exception as e:
            print e

    def isFilterMessage(self, message):
        try:
            crfWordSeg = CRFWordSegment()
            lstInput = crfWordSeg.crfpp(message)
            inMessage = ' '.join(lstInput)
            insData = InstanceFilterData()
            lst = insData.getFilterData()
            documents = copy.copy(lst)
            documents.insert(0, inMessage)
            tfidf_vectorizer = TfidfVectorizer()
            tfidf_matrix = tfidf_vectorizer.fit_transform(documents)
            result_lst = cosine_similarity(tfidf_matrix[0:1], tfidf_matrix)
            result = result_lst[0]
#             self.debugResult(result, documents)
            return self.findResutl(result[1:])
#             if b:
#                 return b, data
#             else:
#                 print '******************* else'
#                 maxIndex = max(result)
#                 data = documents[np.where(result == maxIndex)[0][0]]
#                 print 'data : ',data
#                 return b, data

        except Exception as e:
            print e

# u = unicode('ทดสอบ', 'utf-8')
# filter = FilterComputation()
# filter.isFilterMessage(u)

redpajama_set_name: RedPajamaGithub


text:
module DParse
end

require_relative 'd-parse/version.rb'
require_relative 'd-parse/position.rb'
require_relative 'd-parse/string_slice.rb'
require_relative 'd-parse/success.rb'
require_relative 'd-parse/failure.rb'
require_relative 'd-parse/parser.rb'
require_relative 'd-parse/parsers.rb'
require_relative 'd-parse/dsl.rb'


text:
<?php

namespace Oro\Bundle\DataGridBundle\Datasource\Orm;

use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;

interface IterableResultInterface extends \Iterator
{
    /**
     * Sets buffer size that can be used to optimize resources usage during iterations
     *
     * @param int $size
     */
    public function setBufferSize($size);

    /**
     * @return Query|QueryBuilder|object
     */
    public function getSource();
}


text:
 **Fire of Entanglement**

**School** evocation; **Level** paladin 2

**Casting Time** 1 swift action

**Components** V, S

**Range** special; see text

**Target** one creature

**Duration** 1 round/level

**Saving Throw** Reflex partial; **Spell Resistance** yes

The next creature you attack using your smite evil class ability is wreathed in flames that impede its movement. Until the end of the spell's duration, the target is entangled. If the target starts its turn in a square adjacent to you, it is considered to be entangled to an immobile object (you) and cannot move. A target that saves against this spell is affected for only 1 round.


text:
using CqlPoco.IntegrationTests.FluentMappings;
using CqlPoco.IntegrationTests.TestData;
using NUnit.Framework;

namespace CqlPoco.IntegrationTests
{
    /// <summary>
    /// Base class for integration tests that does common fixture/test setup and teardown.
    /// </summary>
    public abstract class IntegrationTestBase
    {
        protected ICqlClient CqlClient;

        [TestFixtureSetUp]
        public void FixtureSetup()
        {
            TestDataHelper.ResetTestData();
        }

        [SetUp]
        public void Setup()
        {
            CqlClient = CqlClientConfiguration.ForSession(SessionHelper.Session)
                                              .UseIndividualMapping<FluentUserMapping>()
                                              .BuildCqlClient();
        }
    }
}


text:
from .automl_tabular import AutoMLTabular
from .classification_job import ClassificationJob
from .featurization_settings import ColumnTransformer, TabularFeaturizationSettings
from .forecasting_job import ForecastingJob
from .forecasting_settings import ForecastingSettings
from .limit_settings import TabularLimitSettings
from .regression_job import RegressionJob

__all__ = [
    "AutoMLTabular",
    "ClassificationJob",
    "ColumnTransformer",
    "ForecastingJob",
    "ForecastingSettings",
    "RegressionJob",
    "TabularFeaturizationSettings",
    "TabularLimitSettings",
]


text:
%  Return time frame of a NIFTI dataset. Support both *.nii and
%  *.hdr/*.img file extension. If file extension is not provided,
%  *.hdr/*.img will be used as default.
%
%  It is a lightweighted "load_nii_hdr", and is equivalent to
%  hdr.dime.dim(5)
%
%  Usage: [ total_scan ] = get_nii_frame(filename)
%
%  filename - NIFTI file name.
%
%  Returned values:
%
%  total_scan - total number of image scans for the time frame
%
%  NIFTI data format can be found on: http://nifti.nimh.nih.gov
%
%  - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
function [ total_scan ] = get_nii_frame(fileprefix)

   if ~exist('fileprefix','var'),
      error('Usage: [ hdr, fileprefix, machine ] = get_nii_frame(filename)');
   end

   if ~exist('machine','var'), machine = 'ieee-le'; end

   new_ext = 0;

   if findstr('.nii',fileprefix)
      new_ext = 1;
      fileprefix = strrep(fileprefix,'.nii','');
   end

   if findstr('.hdr',fileprefix)
      fileprefix = strrep(fileprefix,'.hdr','');
   end

   if findstr('.img',fileprefix)
      fileprefix = strrep(fileprefix,'.img','');
   end

   if new_ext
      fn = sprintf('%s.nii',fileprefix);

      if ~exist(fn)
         msg = sprintf('Cannot find file "%s.nii".', fileprefix);
         error(msg);
      end
   else
      fn = sprintf('%s.hdr',fileprefix);

      if ~exist(fn)
         msg = sprintf('Cannot find file "%s.hdr".', fileprefix);
         error(msg);
      end
   end

   fid = fopen(fn,'r',machine);

   if fid < 0,
      msg = sprintf('Cannot open file %s.',fn);
      error(msg);
   else
      hdr = read_header(fid);
      fclose(fid);
   end

   if hdr.sizeof_hdr ~= 348
      % first try reading the opposite endian to 'machine'
      switch machine,
      case 'ieee-le', machine = 'ieee-be';
      case 'ieee-be', machine = 'ieee-le';
      end

      fid = fopen(fn,'r',machine);

      if fid < 0,
         msg = sprintf('Cannot open file %s.',fn);
         error(msg);
      else
         hdr = read_header(fid);
         fclose(fid);
      end
   end

   if hdr.sizeof_hdr ~= 348
      % Now throw an error
      msg = sprintf('File "%s" is corrupted.',fn);
      error(msg);
   end

   total_scan = hdr.dim(5);

   return;					% get_nii_frame

%---------------------------------------------------------------------
function [ dsr ] = read_header(fid)

    fseek(fid,0,'bof');
    dsr.sizeof_hdr    = fread(fid,1,'int32')';  % should be 348!

    fseek(fid,40,'bof');
    dsr.dim           = fread(fid,8,'int16')';

    return;					% read_header


text:
package org.zstack.compute.vm;

import org.zstack.core.ScatteredValidator;
import org.zstack.header.vm.VmAttachVolumeValidatorMethod;

import java.lang.reflect.Method;
import java.util.List;

/**
 * Created by MaJin on 2017-05-31.
 */
public class VmAttachVolumeValidator extends ScatteredValidator {
    private static List<Method> methods;

    static {
        // method signature: static void xxx(String vmUuid, String volumeUuid)
        methods = collectValidatorMethods(VmAttachVolumeValidatorMethod.class, String.class, String.class);
    }

    public void validate(String vmUuid, String volumeUuid) {
        invokeValidatorMethods(methods, vmUuid, volumeUuid);
    }
}


text:
 !(function(factory) {
   if (typeof define === 'function' && define.amd) {
        // AMD
        define(['angular'], factory);
    } else {
        // Global Variables
        factory(window.angular);
    }
    factory(window.angular);
})(function(ng) {
    'use strict';


text:
@interface CSNAdReportsBuilder ()
@property CSNClientInfo *clientInfo;
@property CSNPAdReports *adReports;
@property uint64_t epoch;
@property CSNImpressionDetector *impressionDetector;
@end

@implementation CSNAdReportsBuilder

- (instancetype) initWithClientInfo:(CSNClientInfo *)clientInfo {
    _clientInfo = clientInfo;
    _epoch = [self currentTime];
    _adReports = [self createAdReports];
    _impressionDetector = [[CSNImpressionDetector alloc] init];
    return self;
}

- (void) setDeviceID:(CSNPDeviceID *)deviceID
{
    [_adReports setDeviceId:deviceID];
}

- (void) setIpAddresses:(NSArray<NSData *> *)ipAddresses
{
    [_adReports setIpAddressesArray:[NSMutableArray arrayWithArray:ipAddresses]];

}

- (void) setLocations:(NSArray<CSNPDeviceLocation *> *)locations
{
    [_adReports setDeviceLocationsArray:[NSMutableArray arrayWithArray:locations]];
}

- (void) recordInteraction:(uint64_t)requestID adID:(uint64_t)adID versionID:(uint64_t)versionID componentID:(uint64_t)componentID interactionKind:(int32_t)interactionKind {
    CSNPAdReport *adReport = [self getAdReport:_adReports requestID:requestID adID:adID versionID:versionID];
    if([_impressionDetector recordInteraction:requestID adID:adID versionID:versionID componentID:componentID interactionKind:interactionKind]) {
        [self addImpression:adReport];
    }
    CSNPComponentReport *compReport = [self getComponentReport:adReport componentID:componentID];
    [self addComponentInteraction:compReport interactionKind:interactionKind];

}

- (void) recordVisibility:(uint64_t)requestID adID:(uint64_t)adID versionID:(uint64_t)versionID componentID:(uint64_t)componentID viewVisibility:(double)viewVisiblity deviceVisibility:(double)deviceVisibility {
    CSNPAdReport *adReport = [self getAdReport:_adReports requestID:requestID adID:adID versionID:versionID];
    if([_impressionDetector recordVisibility:requestID adID:adID versionID:versionID componentID:componentID viewVisibility:viewVisiblity deviceVisibility:deviceVisibility]) {
        [self addImpression:adReport];
    }
    CSNPComponentReport *compReport = [self getComponentReport:adReport componentID:componentID];
    [self addComponentVisibility:compReport viewVisibility:viewVisiblity deviceVisibility:deviceVisibility];
}

- (CSNPAdReports *) buildReport {
    CSNPAdReports *adReports = _adReports;
    _adReports = [self createAdReports];
    return adReports;
}

// return the current device time in milliseconds since the unix epoch
- (uint64_t) currentTime {
    return (uint64_t)([[NSDate date] timeIntervalSince1970] * 1000.0);
}

- (CSNPAdReports *) createAdReports {
    CSNPAdReports *adReports = [[CSNPAdReports alloc] init];
    [adReports setAdUnit:[_clientInfo getAdUnitData]];
    [adReports setDeviceId:_clientInfo.deviceID];
    [adReports setIpAddressesArray:[NSMutableArray arrayWithArray:_clientInfo.ipAddresses]];
    [adReports setTimezone:_clientInfo.timeZone];
    [adReports setDeviceTime:[self currentTime]];
    [adReports setSdkVersion:CSN_SDK_VERSION];
    return adReports;
}

- (void) addImpression:(CSNPAdReport *) adReport {
    CSNPAdImpression *adImpression = [[CSNPAdImpression alloc] init];
    [adImpression setDeviceTime:[self currentTime]];
    [[adReport impressionsArray] addObject:adImpression];
}

- (void) addComponentInteraction:(CSNPComponentReport *)compReport interactionKind:(int32_t)interactionKind {
    CSNPComponentInteraction *compInteraction = [[CSNPComponentInteraction alloc] init];
    [compInteraction setKind:interactionKind];
    [compInteraction setDeviceTime:[self currentTime]];
    [[compReport interactionsArray] addObject:compInteraction];
}

- (CSNPAdReport *) findAdReport:(CSNPAdReports *)adReports requestID:(uint64_t)requestID adID:(uint64_t)adID versionID:(uint64_t)versionID {
    for (id adReport in [_adReports adReportsArray]) {
        if([adReport adId] == adID && [adReport versionId] == versionID && [adReport requestId] == requestID) {
            return adReport;
        }
    }
    return nil;
}

- (CSNPAdReport *) getAdReport:(CSNPAdReports *)adReports requestID:(uint64_t)requestID adID:(uint64_t)adID versionID:(uint64_t)versionID {
    CSNPAdReport *adReport = [self findAdReport:adReports requestID:requestID adID:adID versionID:versionID];
    if(adReport){
        return adReport;
    } else {
        adReport = [self createAdReport:requestID adID:adID versionID:versionID];
        [[adReports adReportsArray] addObject:adReport];
        return adReport;
    }
}

- (CSNPComponentReport *) findComponentReport:(CSNPAdReport *)adReport componentID:(uint64_t)componentID {
    for(id compReport in [adReport componentsArray]) {
        if([compReport componentId] == componentID) {
            return compReport;
        }
    }
    return nil;
}

- (CSNPComponentReport *) getComponentReport:(CSNPAdReport *)adReport componentID:(uint64_t)componentID {
    CSNPComponentReport *compReport = [self findComponentReport:adReport componentID:componentID];
    if(compReport){
        return compReport;
    } else {
        compReport = [self createComponentReport:componentID];
        [[adReport componentsArray] addObject:compReport];
        return compReport;
    }
}

- (void) addComponentVisibility:(CSNPComponentReport *)compReport viewVisibility:(double)viewVisibility deviceVisibility:(double)deviceVisibility {
    if([compReport visibilitySampleCount] == 0) {
        [compReport setVisibilityEpoch:[self currentTime]];
    }
    uint8_t position = [compReport visibilitySampleCount] % 16;
    uint8_t viewEncoded = [self encodeVisibility:viewVisibility];
    uint8_t deviceEncoded = [self encodeVisibility:deviceVisibility];
    if(position == 0) {
        uint64_t viewSample = [self setSample:0 position:0 value:viewEncoded];
        uint64_t deviceSample = [self setSample:0 position:0 value:deviceEncoded];
        [[compReport viewVisibilitySamplesArray] addValue:viewSample];
        [[compReport deviceVisibilitySamplesArray] addValue:deviceSample];
    } else {
        NSUInteger idx = [compReport viewVisibilitySamplesArray_Count] - 1;
        uint64_t curViewSample = [[compReport viewVisibilitySamplesArray] valueAtIndex:idx];
        uint64_t curDeviceSample = [[compReport viewVisibilitySamplesArray] valueAtIndex:idx];
        uint64_t viewSample = [self setSample:curViewSample position:position value:viewEncoded];
        uint64_t deviceSample = [self setSample:curDeviceSample position:position value:deviceEncoded];
        [[compReport viewVisibilitySamplesArray] replaceValueAtIndex:idx withValue:viewSample];
        [[compReport deviceVisibilitySamplesArray] replaceValueAtIndex:idx withValue:(deviceSample)];
    }
    [compReport setVisibilitySampleCount:[compReport visibilitySampleCount] + 1];
}

- (CSNPAdReport *) createAdReport:(uint64_t)requestID adID:(uint64_t)adID versionID:(uint64_t)versionID {
    CSNPAdReport *adReport = [[CSNPAdReport alloc] init];
    [adReport setAdId:adID];
    [adReport setVersionId:versionID];
    [adReport setRequestId:requestID];
    return adReport;
}

- (CSNPComponentReport *) createComponentReport:(uint64_t)componentID {
    CSNPComponentReport *compReport = [[CSNPComponentReport alloc] init];
    [compReport setComponentId:componentID];
    return compReport;
}

// encode a double visibility percentage (0.0 to 1.0) value into a 4 bit histogram value
- (uint8_t) encodeVisibility:(double)visibility {
    return (uint8_t)round(visibility*15.0) & 0x0F;
}

// set a 4 bit portion of a 64bit value to the sample value which is a 4 bit value itself
- (uint64_t) setSample:(uint64_t)sample position:(uint8_t)position value:(uint8_t)value  {
    uint64_t shift = position*4;
    uint64_t valueMask = 0x000000000000000F;
    valueMask = valueMask << shift;
    uint64_t sampleMask = valueMask ^ 0xFFFFFFFFFFFFFFFF;
    uint64_t shiftedValue = ((uint64_t)value) << shift;
    uint64_t maskedSample = sample & sampleMask;
    uint64_t newSample = maskedSample | shiftedValue;
    return newSample;
}

@end


text:
var AWS = require('./core');
require('./http');
var inherit = AWS.util.inherit;

/**
 * Represents a metadata service available on EC2 instances. Using the
 * {request} method, you can receieve metadata about any available resource
 * on the metadata service.
 *
 * You can disable the use of the IMDS by setting the AWS_EC2_METADATA_DISABLED
 * environment variable to a truthy value.
 *
 * @!attribute [r] httpOptions
 *   @return [map] a map of options to pass to the underlying HTTP request:
 *
 *     * **timeout** (Number) — a timeout value in milliseconds to wait
 *       before aborting the connection. Set to 0 for no timeout.
 *
 * @!macro nobrowser
 */
AWS.MetadataService = inherit({
  /**
   * @return [String] the hostname of the instance metadata service
   */
  host: '169.254.169.254',

  /**
   * @!ignore
   */

  /**
   * Default HTTP options. By default, the metadata service is set to not
   * timeout on long requests. This means that on non-EC2 machines, this
   * request will never return. If you are calling this operation from an
   * environment that may not always run on EC2, set a `timeout` value so
   * the SDK will abort the request after a given number of milliseconds.
   */
  httpOptions: { timeout: 0 },

  /**
   * Creates a new MetadataService object with a given set of options.
   *
   * @option options host [String] the hostname of the instance metadata
   *   service
   * @option options httpOptions [map] a map of options to pass to the
   *   underlying HTTP request:
   *
   *   * **timeout** (Number) — a timeout value in milliseconds to wait
   *     before aborting the connection. Set to 0 for no timeout.
   * @option options maxRetries [Integer] the maximum number of retries to
   *   perform for timeout errors
   * @option options retryDelayOptions [map] A set of options to configure the
   *   retry delay on retryable errors. See AWS.Config for details.
   */
  constructor: function MetadataService(options) {
    AWS.util.update(this, options);
  },

  /**
   * Sends a request to the instance metadata service for a given resource.
   *
   * @param path [String] the path of the resource to get
   * @callback callback function(err, data)
   *   Called when a response is available from the service.
   *   @param err [Error, null] if an error occurred, this value will be set
   *   @param data [String, null] if the request was successful, the body of
   *     the response
   */
  request: function request(path, callback) {
    if (process.env[AWS.util.imdsDisabledEnv]) {
      callback(new Error('EC2 Instance Metadata Service access disabled'));
      return;
    }

    path = path || '/';
    var httpRequest = new AWS.HttpRequest('http://' + this.host + path);
    httpRequest.method = 'GET';
    AWS.util.handleRequestWithRetries(httpRequest, this, callback);
  },

  /**
  * @api private
  */
  loadCredentialsCallbacks: [],

  /**
   * Loads a set of credentials stored in the instance metadata service
   *
   * @api private
   * @callback callback function(err, credentials)
   *   Called when credentials are loaded from the resource
   *   @param err [Error] if an error occurred, this value will be set
   *   @param credentials [Object] the raw JSON object containing all
   *     metadata from the credentials resource
   */
  loadCredentials: function loadCredentials(callback) {
    var self = this;
    var basePath = '/latest/meta-data/iam/security-credentials/';
    self.loadCredentialsCallbacks.push(callback);
    if (self.loadCredentialsCallbacks.length > 1) { return; }

    function callbacks(err, creds) {
      var cb;
      while ((cb = self.loadCredentialsCallbacks.shift()) !== undefined) {
        cb(err, creds);
      }
    }

    self.request(basePath, function (err, roleName) {
      if (err) callbacks(err);
      else {
        roleName = roleName.split('\n')[0]; // grab first (and only) role
        self.request(basePath + roleName, function (credErr, credData) {
          if (credErr) callbacks(credErr);
          else {
            try {
              var credentials = JSON.parse(credData);
              callbacks(null, credentials);
            } catch (parseError) {
              callbacks(parseError);
            }
          }
        });
      }
    });
  }
});

/**
 * @api private
 */
module.exports = AWS.MetadataService;


text:
OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
{
namespace metrics
{
struct RegisteredView
{
  RegisteredView(
      std::unique_ptr<opentelemetry::sdk::metrics::InstrumentSelector> instrument_selector,
      std::unique_ptr<opentelemetry::sdk::metrics::MeterSelector> meter_selector,
      std::unique_ptr<opentelemetry::sdk::metrics::View> view)
      : instrument_selector_{std::move(instrument_selector)},
        meter_selector_{std::move(meter_selector)},
        view_{std::move(view)}
  {}
  std::unique_ptr<opentelemetry::sdk::metrics::InstrumentSelector> instrument_selector_;
  std::unique_ptr<opentelemetry::sdk::metrics::MeterSelector> meter_selector_;
  std::unique_ptr<opentelemetry::sdk::metrics::View> view_;
};

class ViewRegistry
{
public:
  void AddView(std::unique_ptr<opentelemetry::sdk::metrics::InstrumentSelector> instrument_selector,
               std::unique_ptr<opentelemetry::sdk::metrics::MeterSelector> meter_selector,
               std::unique_ptr<opentelemetry::sdk::metrics::View> view)
  {
    // TBD - thread-safe ?

    auto registered_view = std::unique_ptr<RegisteredView>(new RegisteredView{
        std::move(instrument_selector), std::move(meter_selector), std::move(view)});
    registered_views_.push_back(std::move(registered_view));
  }

  bool FindViews(
      const opentelemetry::sdk::metrics::InstrumentDescriptor &instrument_descriptor,
      const opentelemetry::sdk::instrumentationscope::InstrumentationScope &instrumentation_scope,
      nostd::function_ref<bool(const View &)> callback) const
  {
    bool found = false;
    for (auto const &registered_view : registered_views_)
    {
      if (MatchMeter(registered_view->meter_selector_.get(), instrumentation_scope) &&
          MatchInstrument(registered_view->instrument_selector_.get(), instrument_descriptor))
      {
        found = true;
        if (!callback(*(registered_view->view_.get())))
        {
          return false;
        }
      }
    }
    // return default view if none found;
    if (!found)
    {
      static const View view("");
      if (!callback(view))
      {
        return false;
      }
    }
    return true;
  }

  ~ViewRegistry() = default;

private:
  std::vector<std::unique_ptr<RegisteredView>> registered_views_;
  static bool MatchMeter(
      opentelemetry::sdk::metrics::MeterSelector *selector,
      const opentelemetry::sdk::instrumentationscope::InstrumentationScope &instrumentation_scope)
  {
    return selector->GetNameFilter()->Match(instrumentation_scope.GetName()) &&
           (instrumentation_scope.GetVersion().size() == 0 ||
            selector->GetVersionFilter()->Match(instrumentation_scope.GetVersion())) &&
           (instrumentation_scope.GetSchemaURL().size() == 0 ||
            selector->GetSchemaFilter()->Match(instrumentation_scope.GetSchemaURL()));
  }

  static bool MatchInstrument(
      opentelemetry::sdk::metrics::InstrumentSelector *selector,
      const opentelemetry::sdk::metrics::InstrumentDescriptor &instrument_descriptor)
  {
    return selector->GetNameFilter()->Match(instrument_descriptor.name_) &&
           (selector->GetInstrumentType() == instrument_descriptor.type_);
  }
};
}  // namespace metrics
}  // namespace sdk
OPENTELEMETRY_END_NAMESPACE


text:
ALTER TABLE  `order` ADD  `price_plus_delivery_markup` float DEFAULT NULL;
ALTER TABLE  `order` ADD  `final_price_plus_delivery_markup` float DEFAULT NULL;


text:
action :add do
  #Fill missing values from defaults
  repo_name = new_resource.repo_name
  varlist = [ :repo_name, :description, :url, :mirrorlist, :key, :enabled,
              :type, :failovermethod, :bootstrapurl, :options, :key_url ]
  vars = {}
  varlist.each do | var |
    vars[var] = new_resource.send(var) || node[:yum][:repos][repo_name][var]
  end
  #import the gpg key.
  if vars[:key] then
    yum_key vars[:key] do
      url vars[:key_url]
      action :add
    end
  end
  #get the metadata
  execute "yum -q makecache" do
    action :nothing
  end
  #write out the file
  template "/etc/yum.repos.d/#{new_resource.repo_name}.repo" do
    cookbook "yum"
    source "repo.erb"
    mode "0644"
    variables(vars)
    notifies :run, resources(:execute => "yum -q makecache"), :immediately
  end
  # end
end

action :remove do
  if ::File.exists?("/etc/yum.repos.d/#{new_resource.repo_name}.repo")
    Chef::Log.info "Removing #{new_resource.repo_name} repository from /etc/yum.repos.d/"
    file "/etc/yum.repos.d/#{new_resource.repo_name}.repo" do
      action :delete
    end
    new_resource.updated_by_last_action(true)
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                       xmlns:moz="http://www.mozilla.org/2006/browser/search/">
  <ShortName>kiranico.com/mh4u</ShortName>
  <Description>Search engine for Kiranico's MH4U database</Description>
  <InputEncoding>UTF-8</InputEncoding>
  <Image width="16" height="16" type="image/png">http://kiranico.com/favicon.png</Image>
  <Url type="text/html" method="get" template="http://k.mhquestboard.com/kiranicomh4u/first?s={searchTerms}&l=it"/>
  <Url type="application/x-suggestions+json" method="get" template="http://k.mhquestboard.com/kiranicomh4u/suggest?s={searchTerms}&l=it"/>
  <Url type="application/opensearchdescription+xml"
     rel="self"
     template="http://k.mhquestboard.com/kiranicomh4u/plugins?l=it" />
</OpenSearchDescription>


text:
<?php

namespace Somnambulist\Doctrine\EventSubscribers;

use Somnambulist\Doctrine\Contracts\Timestampable as TimestampableContract;
use Carbon\Carbon;
use Doctrine\Common\EventSubscriber;
use Doctrine\Common\Util\ClassUtils;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\PreUpdateEventArgs;
use Doctrine\ORM\Events;

/**
 * Class TimestampableEventSubscriber
 *
 * @package    Somnambulist\Doctrine\EventSubscribers
 * @subpackage Somnambulist\Doctrine\EventSubscribers\TimestampableEventSubscriber
 * @author     Dave Redfern
 */
class TimestampableEventSubscriber implements EventSubscriber
{

    /**
     * @return array
     */
    public function getSubscribedEvents()
    {
        return [
            Events::prePersist,
            Events::preUpdate,
        ];
    }

    /**
     * @param LifecycleEventArgs $eventArgs
     */
    public function prePersist(LifecycleEventArgs $eventArgs)
    {
        $entity = $eventArgs->getEntity();
        if ($entity instanceof TimestampableContract) {
            $entity->initializeTimestamps();
        }
    }

    /**
     * @param PreUpdateEventArgs $eventArgs
     */
    public function preUpdate(PreUpdateEventArgs $eventArgs)
    {
        $entity = $eventArgs->getEntity();
        if ($entity instanceof TimestampableContract) {
            $entity->updateTimestamps();

            $em = $eventArgs->getEntityManager();
            $em->getUnitOfWork()->recomputeSingleEntityChangeSet(
                $em->getClassMetadata(ClassUtils::getClass($entity)), $entity
            );
        }
    }
}


text:
JPEG Error Level Analysis for the GIMP
======================================

The JPEG-compression is a lossy technique. Using this kind of compression on digital images introduces an error on each block of 8x8 pixels that composes the resulting picture. Nevertheless, when an image is modified, the 8x8 cells containing the modifications have no longer the same error level of the rest of the unmodified image.

The [Error Level Analysis][ELA] (ELA) aims to discover areas within a JPEG image that are at different compression levels, so that a possible manipulation of the highlighted portions could be clued. In order to succeed in this operation the original image is intentionally saved again at a known error rate - such as 70% - and then the difference between the resulted image and the original one is computed. If an area of the image has been compressed multiple times one could suppose that the image has possibly been manipulated.

Installation
------------

In order to install this Python plugin in GIMP (tested with GIMP 2.8+) you must save *plugin-ela.py* under the plug-ins directory and then start the GIMP. The new _Forensics_ submenu would be disposable under _Filters_.

Usage
-----

After selecting the JPEG ELA plugin from _Filters_ on a saved JPEG image it is possible to specify the amount of compression of the resaved image and an HTML report.

### Requirements

* [GIMP](https://www.gimp.org/) 2.8+
* Python

[ELA]: http://www.errorlevelanalysis.com/


text:
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ForumUser, UserApi } from './../../../../swagger/index'

import 'style-loader!./userDetail.scss';

@Component({
  selector: 'users-detail',
  templateUrl: './userDetail.html',
})
export class UserDetail implements OnInit {

  protected userId : number;
  protected user : ForumUser;
  protected statusList : any = [];

  constructor(protected api : UserApi, protected route : ActivatedRoute ) {
    for(let value in ForumUser.StatusEnum) {
      this.statusList.push(value);
    }
  }

  ngOnInit(){
    this.userId = this.route.snapshot.params['id'];
    if(!isNaN(this.userId) && this.userId > 0){
        // Searches the user
        this.api.usersIdGet(this.userId).subscribe((user) => this.user = user)
    }
    else {
        console.log("No ID received");
    }
  }
}


text:
export class Control {
    id: string;
    name: string;
    description: string;
    _x: number = 0;
    _y: number = 0;
    _width: number = 0;
    _height: number = 0;
    display:any = {
        x: 0,
        y: 0,
        width: 0,
        height: 0,
    };
    dimension_error: boolean = false;
    dimension_display:any = {
        vertical: false,
        horizontal: false,
        offset: {
            x: 0,
            y: 0,
        },
        spacing: {
            x: 15,
            y: 15,
        },
    };

    parent_control: Control;

    private in_change:boolean = false;

    get x(): number { return this._x; }
    set x(value: number){
        this._x = value;
        this.display.x = value;
        this.onDimensionChange();
    }

    get y(): number { return this._y; }
    set y(value: number){
        this._y = value;
        this.display.y = value;
        this.onDimensionChange();
    }

    get width(): number { return this._width; }
    set width(value: number){
        this._width = value;
        this.display.width = value;
        this.onDimensionChange();
    }

    get height(): number { return this._height; }
    set height(value: number){
        this._height = value;
        this.display.height = value;
        this.onDimensionChange();
    }

    get abs_display_x(): number {
        let abs_x = this.display.x;
        if (this.parent_control !== undefined){
            abs_x += this.parent_control.abs_display_x;
        }
        return abs_x;
    }

    get abs_display_y(): number {
        let abs_y = this.display.y;
        if (this.parent_control !== undefined){
            abs_y += this.parent_control.abs_display_y;
        }
        return abs_y;
    }

    get moveable(): boolean {
        return false;
    }

    on_dimension_change: (control: Control) => void;

    constructor(params: any) {
        this.id = params.id;
        this.name = params.name;
        this.description = params.decription;
        this._x = params.x;
        this._y = params.y;
        this._width = params.width;
        this._height = params.height;
        this.display.x = params.x;
        this.display.y = params.y;
        this.display.width = params.width;
        this.display.height = params.height;
    }

    onDimensionChange(): void{
        if (this.on_dimension_change !== undefined){
            if (!this.in_change){
                this.in_change = true;
                this.on_dimension_change(this);
                this.in_change = false;
            }
        }
    }

    calculateDimensions(): void {
    }

    addControl(control: Control): void {
    }

    removeControl(control: Control): void {
    }

    changeParent(new_parent: Control): void {
        if (this.parent_control !== undefined){
            let old_parent = this.parent_control;
            old_parent.removeControl(this);
        }
        if (new_parent !== undefined){
            new_parent.addControl(this);
        }
    }

    getAcceptableParents(control: Control): Control[] {
        if (this.isAcceptableChild(control)){
            return [this];
        }
        return [];
    }

    isAcceptableChild(control: Control): boolean {
        return false;
    }

    getRoot(): Control {
        if (this.parent_control === undefined){
            return this;
        }
        return this.parent_control.getRoot();
    }
}


text:
package io.chamerling.hacks.arquillian.gfcdi;

import io.chamerling.hacks.arquillian.gfcdi.rest.HelloResource;

import java.util.HashSet;
import java.util.Set;

/**
 * The JAXRS Application
 *
 * @author Christophe Hamerling - chamerling.github.io
 */
public class Application extends javax.ws.rs.core.Application {

    @Override
    public Set<Class<?>> getClasses() {
        Set<Class<?>> result = new HashSet<>();
        result.add(HelloResource.class);
        return result;
    }
}


text:
/*
 * Do not modify this file. This file is generated from the kinesis-2013-12-02.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;

using Amazon.Kinesis.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;

namespace Amazon.Kinesis.Model.Internal.MarshallTransformations
{
    /// <summary>
    /// PutRecords Request Marshaller
    /// </summary>
    public class PutRecordsRequestMarshaller : IMarshaller<IRequest, PutRecordsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
    {
        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public IRequest Marshall(AmazonWebServiceRequest input)
        {
            return this.Marshall((PutRecordsRequest)input);
        }

        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>
        /// <param name="publicRequest"></param>
        /// <returns></returns>
        public IRequest Marshall(PutRecordsRequest publicRequest)
        {
            IRequest request = new DefaultRequest(publicRequest, "Amazon.Kinesis");
            string target = "Kinesis_20131202.PutRecords";
            request.Headers["X-Amz-Target"] = target;
            request.Headers["Content-Type"] = "application/x-amz-json-1.1";
            request.HttpMethod = "POST";

            string uriResourcePath = "/";
            request.ResourcePath = uriResourcePath;
            using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
            {
                JsonWriter writer = new JsonWriter(stringWriter);
                writer.WriteObjectStart();
                var context = new JsonMarshallerContext(request, writer);
                if(publicRequest.IsSetRecords())
                {
                    context.Writer.WritePropertyName("Records");
                    context.Writer.WriteArrayStart();
                    foreach(var publicRequestRecordsListValue in publicRequest.Records)
                    {
                        context.Writer.WriteObjectStart();

                        var marshaller = PutRecordsRequestEntryMarshaller.Instance;
                        marshaller.Marshall(publicRequestRecordsListValue, context);

                        context.Writer.WriteObjectEnd();
                    }
                    context.Writer.WriteArrayEnd();
                }

                if(publicRequest.IsSetStreamName())
                {
                    context.Writer.WritePropertyName("StreamName");
                    context.Writer.Write(publicRequest.StreamName);
                }

                writer.WriteObjectEnd();
                string snippet = stringWriter.ToString();
                request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
            }

            return request;
        }

    }
}


text:
<?php
namespace Dwoo\Template;
use Dwoo\Compiler;
use Dwoo\Core;
use Dwoo\Exception;
use Dwoo\ICompiler;
use Dwoo\ITemplate;

class String implements ITemplate {
	/**
	 * template name
	 *
	 * @var string
	 */
	protected $name;

	/**
	 * template compilation id
	 *
	 * @var string
	 */
	protected $compileId;

	/**
	 * template cache id, if not provided in the constructor, it is set to
	 * the md4 hash of the request_uri. it is however highly recommended to
	 * provide one that will fit your needs.
	 *
	 * in all cases, the compilation id is prepended to the cache id to separate
	 * templates with similar cache ids from one another
	 *
	 * @var string
	 */
	protected $cacheId;

	/**
	 * validity duration of the generated cache file (in seconds)
	 *
	 * set to -1 for infinite cache, 0 to disable and null to inherit the Dwoo instance's cache time
	 *
	 * @var int
	 */
	protected $cacheTime;

	/**
	 * boolean flag that defines whether the compilation should be enforced (once) or
	 * not use this if you have issues with the compiled templates not being updated
	 * but if you do need this it's most likely that you should file a bug report
	 *
	 * @var bool
	 */
	protected $compilationEnforced;

	/**
	 * caches the results of the file checks to save some time when the same
	 * templates is rendered several times
	 *
	 * @var array
	 */
	protected static $cache = array('cached' => array(), 'compiled' => array());

	/**
	 * holds the compiler that built this template
	 *
	 * @var ICompiler
	 */
	protected $compiler;

	/**
	 * chmod value for all files written (cached or compiled ones)
	 *
	 * set to null if you don't want any chmod operation to happen
	 *
	 * @var int
	 */
	protected $chmod = 0777;

	private $debug = false;

	/**
	 * creates a template from a string
	 *
	 * @param string $templateString the template to use
	 * @param int    $cacheTime      duration of the cache validity for this template,
	 *                               if null it defaults to the Dwoo instance that will
	 *                               render this template, set to -1 for infinite cache or 0 to disable
	 * @param string $cacheId        the unique cache identifier of this page or anything else that
	 *                               makes this template's content unique, if null it defaults
	 *                               to the current url
	 * @param string $compileId      the unique compiled identifier, which is used to distinguish this
	 *                               template from others, if null it defaults to the md4 hash of the template
	 */
	public function __construct($templateString, $cacheTime = null, $cacheId = null, $compileId = null) {
		$this->template = $templateString;
		if (function_exists('hash')) {
			$this->name = hash('md4', $templateString);
		}
		else {
			$this->name = md5($templateString);
		}
		$this->cacheTime = $cacheTime;

		if ($compileId !== null) {
			$this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;' . PATH_SEPARATOR, '/-------'));
		}

		if ($cacheId !== null) {
			$this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;' . PATH_SEPARATOR, '/-------'));
		}
	}

	/**
	 * returns the cache duration for this template
	 *
	 * defaults to null if it was not provided
	 *
	 * @return int|null
	 */
	public function getCacheTime() {
		return $this->cacheTime;
	}

	/**
	 * sets the cache duration for this template
	 *
	 * can be used to set it after the object is created if you did not provide
	 * it in the constructor
	 *
	 * @param int $seconds duration of the cache validity for this template, if
	 *                     null it defaults to the Dwoo instance's cache time. 0 = disable and
	 * -1 = infinite cache
	 */
	public function setCacheTime($seconds = null) {
		$this->cacheTime = $seconds;
	}

	/**
	 * returns the chmod value for all files written (cached or compiled ones)
	 *
	 * defaults to 0777
	 *
	 * @return int|null
	 */
	public function getChmod() {
		return $this->chmod;
	}

	/**
	 * set the chmod value for all files written (cached or compiled ones)
	 *
	 * set to null if you don't want to do any chmod() operation
	 *
	 * @param int $mask new bitmask to use for all files
	 */
	public function setChmod($mask = null) {
		$this->chmod = $mask;
	}

	/**
	 * returns the template name
	 *
	 * @return string
	 */
	public function getName() {
		return $this->name;
	}

	/**
	 * returns the resource name for this template class
	 *
	 * @return string
	 */
	public function getResourceName() {
		return 'string';
	}

	/**
	 * returns the resource identifier for this template, false here as strings don't have identifiers
	 *
	 * @return boolean false
	 */
	public function getResourceIdentifier() {
		return false;
	}

	/**
	 * returns the template source of this template
	 *
	 * @return string
	 */
	public function getSource() {
		return $this->template;
	}

	/**
	 * returns an unique value identifying the current version of this template,
	 * in this case it's the md4 hash of the content
	 *
	 * @return string
	 */
	public function getUid() {
		return $this->name;
	}

	/**
	 * returns the compiler used by this template, if it was just compiled, or null
	 *
	 * @return ICompiler
	 */
	public function getCompiler() {
		return $this->compiler;
	}

	/**
	 * marks this template as compile-forced, which means it will be recompiled even if it
	 * was already saved and wasn't modified since the last compilation. do not use this in production,
	 * it's only meant to be used in development (and the development of dwoo particularly)
	 */
	public function forceCompilation() {
		$this->compilationEnforced = true;
	}

	/**
	 * returns the cached template output file name, true if it's cache-able but not cached
	 * or false if it's not cached
	 *
	 * @param Core $dwoo the dwoo instance that requests it
	 *
	 * @return string|bool
	 */
	public function getCachedTemplate(Core $dwoo) {
		if ($this->cacheTime !== null) {
			$cacheLength = $this->cacheTime;
		}
		else {
			$cacheLength = $dwoo->getCacheTime();
		}

		// file is not cacheable
		if ($cacheLength == 0) {
			return false;
		}

		$cachedFile = $this->getCacheFilename($dwoo);

		if (isset(self::$cache['cached'][$this->cacheId]) === true && file_exists($cachedFile)) {
			// already checked, return cache file
			return $cachedFile;
		}
		elseif ($this->compilationEnforced !== true && file_exists($cachedFile) && ($cacheLength === -1 || filemtime($cachedFile) > ($_SERVER['REQUEST_TIME'] - $cacheLength)) && $this->isValidCompiledFile($this->getCompiledFilename($dwoo))) {
			// cache is still valid and can be loaded
			self::$cache['cached'][$this->cacheId] = true;

			return $cachedFile;
		}
		else {
			// file is cacheable
			return true;
		}
	}

	/**
	 * caches the provided output into the cache file
	 *
	 * @param Core   $dwoo   the dwoo instance that requests it
	 * @param string $output the template output
	 *
	 * @return mixed full path of the cached file or false upon failure
	 */
	public function cache(Core $dwoo, $output) {
		$cacheDir   = $dwoo->getCacheDir();
		$cachedFile = $this->getCacheFilename($dwoo);

		// the code below is courtesy of Rasmus Schultz,
		// thanks for his help on avoiding concurency issues
		$temp = tempnam($cacheDir, 'temp');
		if (!($file = @fopen($temp, 'wb'))) {
			$temp = $cacheDir . uniqid('temp');
			if (!($file = @fopen($temp, 'wb'))) {
				trigger_error('Error writing temporary file \'' . $temp . '\'', E_USER_WARNING);

				return false;
			}
		}

		fwrite($file, $output);
		fclose($file);

		$this->makeDirectory(dirname($cachedFile), $cacheDir);
		if (!@rename($temp, $cachedFile)) {
			@unlink($cachedFile);
			@rename($temp, $cachedFile);
		}

		if ($this->chmod !== null) {
			chmod($cachedFile, $this->chmod);
		}

		self::$cache['cached'][$this->cacheId] = true;

		return $cachedFile;
	}

	/**
	 * clears the cached template if it's older than the given time
	 *
	 * @param Core $dwoo      the dwoo instance that was used to cache that template
	 * @param int  $olderThan minimum time (in seconds) required for the cache to be cleared
	 *
	 * @return bool true if the cache was not present or if it was deleted, false if it remains there
	 */
	public function clearCache(Core $dwoo, $olderThan = -1) {
		$cachedFile = $this->getCacheFilename($dwoo);

		return !file_exists($cachedFile) || (filectime($cachedFile) < (time() - $olderThan) && unlink($cachedFile));
	}

	/**
	 * returns the compiled template file name
	 *
	 * @param Core      $dwoo     the dwoo instance that requests it
	 * @param ICompiler $compiler the compiler that must be used
	 *
	 * @return string
	 */
	public function getCompiledTemplate(Core $dwoo, ICompiler $compiler = null) {
		$compiledFile = $this->getCompiledFilename($dwoo);

		if ($this->debug !== true && $this->compilationEnforced !== true && isset(self::$cache['compiled'][$this->compileId]) === true) {
			// already checked, return compiled file
		}
		elseif ($this->debug !== true && $this->compilationEnforced !== true && $this->isValidCompiledFile($compiledFile)) {
			// template is compiled
			self::$cache['compiled'][$this->compileId] = true;
		}
		else {
			// compiles the template
			$this->compilationEnforced = false;

			if ($compiler === null) {
				$compiler = $dwoo->getDefaultCompilerFactory($this->getResourceName());

				if ($compiler === null || $compiler === array('\Dwoo\Compiler', 'compilerFactory')) {
					if (class_exists('Compiler') === false) {
						include_once Core::DWOO_DIRECTORY . DIRECTORY_SEPARATOR . 'Compiler.php';
					}
					$compiler = Compiler::compilerFactory();
				}
				else {
					$compiler = call_user_func($compiler);
				}
			}
			$compiler->debug = $this->debug;
			$this->compiler  = $compiler;

			$compiler->setCustomPlugins($dwoo->getCustomPlugins());
			$compiler->setSecurityPolicy($dwoo->getSecurityPolicy());
			$this->makeDirectory(dirname($compiledFile), $dwoo->getCompileDir());
			file_put_contents($compiledFile, $compiler->compile($dwoo, $this));
			if ($this->chmod !== null) {
				chmod($compiledFile, $this->chmod);
			}

			self::$cache['compiled'][$this->compileId] = true;
		}

		return $compiledFile;
	}

	/**
	 * Checks if compiled file is valid (it exists)
	 *
	 * @param string file
	 *
	 * @return boolean True cache file existance
	 */
	protected function isValidCompiledFile($file) {
		return file_exists($file);
	}

	/**
	 * returns a new template string object with the resource id being the template source code
	 *
	 * @param Core      $dwoo                         the dwoo instance requiring it
	 * @param mixed     $resourceId                   the filename (relative to this template's dir) of the template to include
	 * @param int       $cacheTime                    duration of the cache validity for this template,
	 *                                                if null it defaults to the Dwoo instance that will
	 *                                                render this template
	 * @param string    $cacheId                      the unique cache identifier of this page or anything else that
	 *                                                makes this template's content unique, if null it defaults
	 *                                                to the current url
	 * @param string    $compileId                    the unique compiled identifier, which is used to distinguish this
	 *                                                template from others, if null it defaults to the filename+bits of the path
	 * @param ITemplate $parentTemplate               the template that is requesting a new template object (through
	 *                                                an include, extends or any other plugin)
	 *
	 * @return String
	 */
	public static function templateFactory(Core $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, ITemplate $parentTemplate = null) {
		return new self($resourceId, $cacheTime, $cacheId, $compileId);
	}

	/**
	 * returns the full compiled file name and assigns a default value to it if
	 * required
	 *
	 * @param Core $dwoo the dwoo instance that requests the file name
	 *
	 * @return string the full path to the compiled file
	 */
	protected function getCompiledFilename(Core $dwoo) {
		// no compile id was provided, set default
		if ($this->compileId === null) {
			$this->compileId = $this->name;
		}

		return $dwoo->getCompileDir() . $this->compileId . '.d' . Core::RELEASE_TAG . '.php';
	}

	/**
	 * returns the full cached file name and assigns a default value to it if
	 * required
	 *
	 * @param Core $dwoo the dwoo instance that requests the file name
	 *
	 * @return string the full path to the cached file
	 */
	protected function getCacheFilename(Core $dwoo) {
		// no cache id provided, use request_uri as default
		if ($this->cacheId === null) {
			if (isset($_SERVER['REQUEST_URI']) === true) {
				$cacheId = $_SERVER['REQUEST_URI'];
			}
			elseif (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv'])) {
				$cacheId = $_SERVER['SCRIPT_FILENAME'] . '-' . implode('-', $_SERVER['argv']);
			}
			else {
				$cacheId = '';
			}
			// force compiled id generation
			$this->getCompiledFilename($dwoo);

			$this->cacheId = str_replace('../', '__', $this->compileId . strtr($cacheId, '\\%?=!:;' . PATH_SEPARATOR, '/-------'));
		}

		return $dwoo->getCacheDir() . $this->cacheId . '.html';
	}

	/**
	 * returns some php code that will check if this template has been modified or not
	 *
	 * if the function returns null, the template will be instanciated and then the Uid checked
	 *
	 * @return string
	 */
	public function getIsModifiedCode() {
		return null;
	}

	/**
	 * Set debug mode true/false
	 *
	 * @param $debug boolean
	 */
	public function setDebugMode($debug) {
		$this->debug = $debug;
	}

	/**
	 * ensures the given path exists
	 *
	 * @param string $path    any path
	 * @param string $baseDir the base directory where the directory is created
	 *                        ($path must still contain the full path, $baseDir
	 *                        is only used for unix permissions)
	 *
	 * @throws Exception
	 */
	protected function makeDirectory($path, $baseDir = null) {
		if (is_dir($path) === true) {
			return;
		}

		if ($this->chmod === null) {
			$chmod = 0777;
		}
		else {
			$chmod = $this->chmod;
		}

		$retries = 3;
		while ($retries--) {
			@mkdir($path, $chmod, true);
			if (is_dir($path)) {
				break;
			}
			usleep(20);
		}

		// enforce the correct mode for all directories created
		if (strpos(PHP_OS, 'WIN') !== 0 && $baseDir !== null) {
			$path    = strtr(str_replace($baseDir, '', $path), '\\', '/');
			$folders = explode('/', trim($path, '/'));
			foreach ($folders as $folder) {
				$baseDir .= $folder . DIRECTORY_SEPARATOR;
				if (!@chmod($baseDir, $chmod)) {
					throw new Exception("Unable to chmod " . "$baseDir to $chmod: " . print_r(error_get_last(), true));
				}
			}
		}
	}
}


text:
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Joan.Json.Sub;

namespace Joan.Manage.Download
{
    public abstract class Download
    {
        public DownloadType Type { get; set; }
        public RpcStatus Status { get; set; }

        public Download()
        {
            Status = new RpcStatus();
        }

        public static UriDownload GetNewUriDownload(IEnumerable<string> uris)
        {
            return new UriDownload
            {
                Type = DownloadType.Uri,
                Uris = uris
            };
        }

        public static UriDownload GetnewUriDownload(string uri)
        {
            return GetNewUriDownload(new[] {uri});
        }

        public static TorrentDownload GetNewTorrentDownload(string torrent)
        {
            return new TorrentDownload
            {
                Type = DownloadType.Torrent,
                Torrent = torrent
            };
        }

        public static async Task<TorrentDownload> GetnewTorrentDownload(FileInfo torrent)
        {
            using (var s = torrent.OpenText())
            {
                return new TorrentDownload
                {
                    Type = DownloadType.Torrent,
                    Torrent = await s.ReadToEndAsync()
                };
            }
        }

        public static MetalinkDownload GetNewMetalinkDownload(string metalink)
        {
            return new MetalinkDownload
            {
                Type = DownloadType.Metalink,
                Metalink = metalink
            };
        }

        public static async Task<MetalinkDownload> GetNewMetalinkDownload(FileInfo metalink)
        {
            using (var s = metalink.OpenText())
            {
                return new MetalinkDownload
                {
                    Type = DownloadType.Metalink,
                    Metalink = await s.ReadToEndAsync()
                };
            }
        }
    }
}


text:
permalink: 404.html
---

Hello, this page does not exist. Please navigate back to the [front page](/).


text:
<?php
namespace Czim\CmsModels\Facades;

use Illuminate\Support\Facades\Facade;

class TranslationLocaleFacade extends Facade
{
    /**
     * {@inheritDoc}
     */
    protected static function getFacadeAccessor()
    {
        return 'cms-translation-locale-helper';
    }
}


text:
<fieldset>

	<legend>Virtual Private Server</legend>

		Virtual Server

			<input name="server" id="server-0" value="20" checked="checked" type="radio" />
			 I5 - 2Gb Ram - 200Gb - 20$

			<input name="server" id="server-1" value="40" type="radio" />
			I5 - 6Gb Ram - 250Gb - 40$

			<input name="server" id="server-2" value="70" type="radio" />
			I7 - 8Gb Ram - 750Gb - 70$

		Name
		<input id="name" name="name" placeholder="Name" class="form-control input-md" type="text" />

		Email
		<input id="email" name="email" placeholder="Email" class="form-control input-md" type="text" />

		Password
		<input id="pass" name="pass" placeholder="Password" class="form-control input-md" type="password" />

		Submit
		<button id="sub" name="sub" class="btn btn-primary">Order</button>

</fieldset>


text:
<#

.SYNOPSIS
This is a Powershell script to bootstrap a Cake.Tin build.

.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake/Cake.tin), compile
and execute your Cake.Tin solution with the parameters you provide.

.PARAMETER Solution
The build Solution to compile and execute.
.PARAMETER Target
The build target to run.
.PARAMETER Configuration
The build configuration to use.
.PARAMETER Verbosity
Specifies the amount of information to be displayed.
.PARAMETER WhatIf
Performs a dry run of the build.
No tasks will be executed.
.PARAMETER Experimental
Tells Cake to use the latest Roslyn release.

.LINK
http://cakebuild.net
#>

Param(
    [string]$Solution = "Build\Build.sln",
    [string]$Configuration = "Release",
    [string]$BuildExe = "Build\bin\$Configuration\Build.exe",
    [string]$Target = "Default",
    [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
    [string]$Verbosity = "Verbose",
    [Alias("DryRun","Noop")]
    [switch]$Experimental,
    [switch]$WhatIf
)

$LIB_DIR = Join-Path $PSScriptRoot "Build\lib"
$NUGET_EXE = Join-Path $LIB_DIR "nuget.exe"
$CAKETIN_DLL = Join-Path $LIB_DIR "Cake.Tin\Cake.Tin.dll"
$PACKAGES_CONFIG = Join-Path $LIB_DIR "packages.config"
$Solution = Join-Path $PSScriptRoot $Solution
$BuildExe =  Join-Path $PSScriptRoot $BuildExe

# Should we use the new Roslyn?
$UseExperimental = "";
if($Experimental.IsPresent) {
    $UseExperimental = "-experimental"
}

# Is this a dry run?
$UseDryRun = "";
if($WhatIf.IsPresent) {
    $UseDryRun = "-dryrun"
}

# Make sure Lib folder exists
if ((Test-Path $PSScriptRoot) -and !(Test-Path $LIB_DIR)) {
    New-Item -path $LIB_DIR -name logfiles -itemtype directory
}

# Try find NuGet.exe in path if not exists
if (!(Test-Path $NUGET_EXE)) {
    "Trying to find nuget.exe in path"
    $NUGET_EXE_IN_PATH = &where.exe nuget.exe
    if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH)) {
        "Found $($NUGET_EXE_IN_PATH)"
        $NUGET_EXE = $NUGET_EXE_IN_PATH
    }
}

# Try download NuGet.exe if not exists
if (!(Test-Path $NUGET_EXE)) {
    Invoke-WebRequest -Uri http://nuget.org/nuget.exe -OutFile $NUGET_EXE
}

# Make sure NuGet exists where we expect it.
if (!(Test-Path $NUGET_EXE)) {
    Throw "Could not find NuGet.exe"
}

# Save nuget.exe path to environment to be available to child processed
$ENV:NUGET_EXE = $NUGET_EXE

# Restore Lib from NuGet.
Push-Location
Set-Location $LIB_DIR

# Restore packages
if (Test-Path $PACKAGES_CONFIG)
{
    Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion"
}
# Install just Cake if missing config
else
{
    Invoke-Expression "&`"$NUGET_EXE`" install Cake.Tin -ExcludeVersion -Prerelease -Source https://www.myget.org/F/caketin/api/v2/"
}
Pop-Location
if ($LASTEXITCODE -ne 0)
{
    exit $LASTEXITCODE
}

# Make sure that CakeTin has been installed.
if (!(Test-Path $CAKETIN_DLL)) {
    Throw "Could not find " + $CAKETIN_DLL
}

$zipFile = Join-Path $PSScriptRoot "caketinbuild.zip"
$slnExists = Test-Path $Solution
$zipExists = Test-Path $zipFile

if ($zipExists -and $slnExists) {
    Throw "Found caketinbuild.zip and a build sln. Only one or other should be present($Solution)."
}

if ($zipExists) {
	Write-Host "Extracting zip"
    Add-Type -AssemblyName System.IO.Compression.FileSystem
	$targetFolder = Join-Path $PSScriptRoot "Build"
	[System.IO.Compression.ZipFile]::ExtractToDirectory($zipFile, $targetFolder)
}

$slnExists = Test-Path $Solution
if (!($slnExists)) {
    Throw "Unable to find '$Solution'."
}

if ($zipExists) {
    Move-Item $zipFile $targetFolder
}

# Load Cake Tin and build the Build Sln
add-type -path $CAKETIN_DLL
Write-Host "Pre Build: building $Solution, -configuration=`"$Configuration`""
$result = [Cake.Tin.BuildCompiler]::Compile($Solution, "-configuration=`"$Configuration`"" )
Write-Host "Pre-build complete - $result"
if ($result -eq "Success") {
    # Finally, run the actual build
	$command = "$BuildExe -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseDryRun $UseExperimental"
	Write-Host "Executing: $command"
	Invoke-Expression $command
	exit $LASTEXITCODE
}
else
{
	exit 1
}
#Install-Package Cake.Tin  -Source https://www.myget.org/F/caketin/api/v2 -Version 0.0.1-build-2


text:
using System;
using Nethereum.Generators.Core;
using Nethereum.Generators.CQS;
using Nethereum.Generators.Model;

namespace Nethereum.Generators.DTOs
{
    public class FunctionOutputDTOGenerator: ClassGeneratorBase<ClassTemplateBase<FunctionOutputDTOModel>,FunctionOutputDTOModel>
    {

        public FunctionOutputDTOGenerator(FunctionABI functionABI, string @namespace, CodeGenLanguage codeGenLanguage)
        {
            ClassModel = new FunctionOutputDTOModel(functionABI, @namespace) {CodeGenLanguage = codeGenLanguage};
            InitialiseTemplate(codeGenLanguage);
        }

        public void InitialiseTemplate(CodeGenLanguage codeGenLanguage)
        {
            switch (codeGenLanguage)
            {
                case CodeGenLanguage.CSharp:
                    ClassTemplate = new FunctionOutputDTOCSharpTemplate(ClassModel);
                    break;
                case CodeGenLanguage.Vb:
                    ClassTemplate = new FunctionOutputDTOVbTemplate(ClassModel);
                    break;
                case CodeGenLanguage.FSharp:
                    ClassTemplate = new FunctionOutputDTOFSharpTemplate(ClassModel);
                    break;
                default:
                    throw new ArgumentOutOfRangeException(nameof(codeGenLanguage), codeGenLanguage, "Code generation not implemented for this language");
            }
        }

        public override string GenerateClass()
        {
            return ClassModel.CanGenerateOutputDTO() ? ClassTemplate.GenerateClass() : null;
        }

        public override string GenerateFileContent()
        {
            return ClassModel.CanGenerateOutputDTO() ? ClassTemplate.GenerateFullClass() : null;
        }

    }
}


text:
<?php
include("../conf/init.php");
if(!connecte_admin())
{
header("location:".SITE_ROOT."connexion.php");
die();
}
//DEBUG
//DEBUG
if(isset($_POST['newslettersend']))
{
$date = date("d/m/Y");
//sélection d'un produit aléatoire
$res_rand = requetes("SELECT id_produit FROM cdo_produit WHERE stock > 0 ");
$tab_rand = $res_rand -> num_rows;
free_result($res_rand);
$prodRand = mt_rand(1,$tab_rand);
//partie sélection des promos
$res_promo = requetes("SELECT p.id_produit, p.id_promo, r.id_promo, p.titre, r.code_promo, r.reduction, p.stock
FROM cdo_produit p, cdo_promotion r
WHERE p.id_promo = r.id_promo
AND p.stock > 0
AND id_produit = '$prodRand' ");
$promo = fetch_assoc($res_promo);
free_result($res_promo);
//creer_vars($promo, "html");
//partie sélection des clients
$ref = requetes("SELECT n.id_client, c.courriel, sexe
FROM cdo_infolettre n, cdo_client c
WHERE n.id_client = c.id_client ");
$liste = "contact@guillaume-ferber.com";
while($tab_nl = fetch_assoc($ref)){
$liste .= ",";
$liste .= $tab_nl['courriel'];
}
$civilite = ($tab_nl['sexe'] == "f") ? "Chère cliente" : "Cher client";
free_result($ref);
$expe = "postmaster@guillaume-ferber.com";
$dest = $liste;
$objet = "L'infolettre Prodükt du ".$date; //AJOUTER LE NOM DU SITE WEB
$headers ='From: L\'équipe Prodükt <postmaster@guillaume-ferber.com>'."\r\n"; //AJOUTER LE NOM DU SITE WEB
    $headers .='Reply-To: postmaster@guillaume-ferber.com'."\r\n";
    $headers .='Content-Type: text/html; charset="UTF-8"'."\r\n";
    $headers .='Content-Transfer-Encoding: 8bit';
    $headers .= 'Bcc :'.$liste.''."\r\n";
    $message = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />".addslashes($_POST['message']);
    $message .= $civilite.",
En ce moment, bénéficiez d'une réduction de ".$promo['reduction']."% sur cet article tendance
".ucfirst($promo['titre'])." en tapant ce code promo au moment de votre paiement :
".$promo['code_promo']."
En espérant vous retrouver très vite sur Prodükt.
Votre équipe dévouée.";
    if(mail($dest, $objet, $message, $headers)){
    $msg .= "
Infolettre envoyée.
";
    }
    }
    include("../inc/header_admin_inc.php");
    include("../inc/menu_inc.php");
    include("../inc/menu_admin_inc.php");
    ?>

Infolettre

            <?=$msg?>

            <form class="pull-left" style='max-width:100%' enctype="multipart/form-data" method='post' action='<?=htmlspecialchars($_SERVER['PHP_SELF']); ?>'>
                <textarea name="message" id="message" rows="10" cols="80"></textarea>

                <input type="submit" class="ok okContact pull-right" value="Envoyer" name="newslettersend">
            </form>

            <?php
            /**********ACTION : URL AFFICHAGE ***********/
            $resultat = requetes("SELECT i.id_client, i.courriel FROM cdo_infolettre i, cdo_client c WHERE c.id_client = i.id_client ");
            $AboNbr = $resultat -> num_rows;
            echo "
";
                echo "
Nombre d'abonnés à l'infolettre : ".$AboNbr."
";
                echo "
";
                    echo "
";
                        echo "
";
                            while($colonne = $resultat -> fetch_field())
                            {
                            echo "".ucfirst($colonne->name)."	";
                            }
                            echo "	";
                        echo "
";
                        while($ligne = $resultat->fetch_assoc())
                        {
                        echo "
";
                            foreach($ligne as $key => $value)
                            {
                            echo "".$value."	";
                            }
                            echo "	";
                        echo "
";
                        }
                    echo "
";
                echo "
";
                free_result($resultat);
                ?>

    <?php
    include("../inc/footer_connexion_inc.php");
    ?>


text:
// Author: jmaessen@google.com (Jan Maessen)

#ifndef NET_INSTAWEB_REWRITER_PUBLIC_IMAGE_DATA_LOOKUP_H_
#define NET_INSTAWEB_REWRITER_PUBLIC_IMAGE_DATA_LOOKUP_H_

#include <cstddef>
#include "net/instaweb/util/public/basictypes.h"
#include "net/instaweb/util/public/string_util.h"

namespace net_instaweb {

// The following four helper functions were moved here for testability.  We ran
// into problems with sign extension under different compiler versions, and we'd
// like to catch regressions on that front in the future.

// char to int *without sign extension*.
inline int CharToInt(char c) {
  uint8 uc = static_cast<uint8>(c);
  return static_cast<int>(uc);
}

inline int JpegIntAtPosition(const StringPiece& buf, size_t pos) {
  return (CharToInt(buf[pos]) << 8) |
         (CharToInt(buf[pos + 1]));
}

inline int GifIntAtPosition(const StringPiece& buf, size_t pos) {
  return (CharToInt(buf[pos + 1]) << 8) |
         (CharToInt(buf[pos]));
}

inline int PngIntAtPosition(const StringPiece& buf, size_t pos) {
  return (CharToInt(buf[pos    ]) << 24) |
         (CharToInt(buf[pos + 1]) << 16) |
         (CharToInt(buf[pos + 2]) << 8) |
         (CharToInt(buf[pos + 3]));
}

inline bool PngSectionIdIs(const char* hdr,
                           const StringPiece& buf, size_t pos) {
  return ((buf[pos + 4] == hdr[0]) &&
          (buf[pos + 5] == hdr[1]) &&
          (buf[pos + 6] == hdr[2]) &&
          (buf[pos + 7] == hdr[3]));
}

namespace ImageHeaders {
  // Constants that are shared by Image and its tests.
  extern const char kPngHeader[];
  extern const size_t kPngHeaderLength;
  extern const char kPngIHDR[];
  extern const size_t kPngIHDRLength;
  extern const size_t kIHDRDataStart;
  extern const size_t kPngIntSize;

  extern const char kGifHeader[];
  extern const size_t kGifHeaderLength;
  extern const size_t kGifDimStart;
  extern const size_t kGifIntSize;

  extern const size_t kJpegIntSize;
}  // namespace ImageHeaders

}  // namespace net_instaweb

#endif  // NET_INSTAWEB_REWRITER_PUBLIC_IMAGE_DATA_LOOKUP_H_


text:
import {RequestService} from '../rest/request';

export class TaskDetailController {
    private list: Array<any>;
    private timer;
    private taskId: string;
    private detail: any;
    private subTasks: Array<any>;
    static $inject: Array<string> = [
        '$scope',
        '$interval',
        '$routeParams',
        'RequestService'
    ];
    constructor(
        private $scope: ng.IScope,
        private $interval: ng.IIntervalService,
        private routeParamsSvc: ng.route.IRouteParamsService,
        private requestSvc: RequestService) {
        if(this.taskId === undefined){
            this.taskId = this.routeParamsSvc['taskId'];
        }
        this.timer = this.$interval(() => this.refresh(), 5000);
        this.$scope.$on('$destroy', () => {
            this.$interval.cancel(this.timer);
        });
        this.refresh();
    }

    public refresh() {
        this.requestSvc.get(this.taskId).then(task => {
            this.detail = task;
            if(task.completed == true){
                this.$interval.cancel(this.timer);
            }
            if(task.subtasks.length >0){
                this.requestSvc.getSubTasks(task.id).then(subtasks => {
                    this.subTasks = subtasks;
                });
            }
        });
    }
}


text:
var html = require('choo/html')
var css = require('sheetify')
var xtend = require('xtend')

var boundaryMap = require('./map-boundary')
var mapModel = require('../models/map')()
var initialState = mapModel.state

module.exports = function (state, send) {
  var prefix = css`
    :host {}

    h2 {
      margin: 20px 0px 5px 0px;
      padding-top: 50px;
      border-top: 5px solid #fff;
    }
  `
  var features = state.boundaries.match.features
  var address = state.boundaries.address
  var lat = state.boundaries.lat
  var long = state.boundaries.long

  var data = {}
  var count = features.length

  features.forEach(function (item) {
    var props = item.properties
    data[props.dataset] = props
    data[props.dataset].feature = item
  })

  var el = html`<div class="${prefix}"></div>`
  append(html`<p>This location is inside <b>${count}</b> Seattle-related boundaries.`)
  append(html`<p>latitude/longitude: ${state.boundaries.lat}, ${state.boundaries.long}</p>`)
  var mapstate = { map: state.map, lat: lat, long: long }

  function createMap (dataset, mapstate) {
    var map = boundaryMap({ initialState: initialState })
    return map(xtend(mapstate, { dataset: dataset, geojson: data[dataset].feature }))
  }

  if (data['city-council-districts']) {
    append(html`

City council district

This location is in city council district ${data['city-council-districts'].district}.

      ${createMap('city-council-districts', mapstate)}

`)
  }

  if (data['neighborhoods']) {
    append(html`

Neighborhood

${data['neighborhoods'].name}

      ${createMap('neighborhoods', mapstate)}

`)
  }

  if (data['parks']) {
    append(html`

Park

${data.parks.name}

      ${createMap('parks', mapstate)}

`)
  }

  append(html`<h2>Schools</h2>`)
  if (!data['sps-es'] && !data['sps-ms'] && !data['sps-hs']) {
    append(html`<p>This location is not inside any school districts.`)
  }
  if (data['sps-es']) {
    append(html`

Elementary school

${data['sps-es']['ES_ZONE']}

      ${createMap('sps-es', mapstate)}

`)
  }
  if (data['sps-ms']) {
    append(html`

Middle school

${data['sps-ms']['MS_ZONE']}

      ${createMap('sps-ms', mapstate)}

`)
  }
  if (data['sps-hs']) {
    append(html`

High school

${data['sps-hs']['HS_ZONE']}

      ${createMap('sps-hs', mapstate)}

`)
  }

  append(html`<h2>Police</h2>`)
  if (data['spd-beats']) {
    append(html`

Beat

Police beat ${data['spd-beats'].name}
      ${createMap('spd-beats', mapstate)}

`)
  }
  if (data['spd-precincts']) {
    append(html`

Precinct

Precinct ${data['spd-precincts'].name}
      ${createMap('spd-precincts', mapstate)}

`)
  }
  if (data['spd-mcpp-areas']) {
    append(html`

Micro-community policing plan area

${data['spd-mcpp-areas'].NAME} in precinct ${data['spd-mcpp-areas'].PRECINCT}
      ${createMap('spd-mcpp-areas', mapstate)}

`)
  }

  if (data['wa-legislature']) {
    append(html`

Washington legislature

${data['wa-legislature']['NAMELSAD10']}

      ${createMap('wa-legislature', mapstate)}

`)
  }

  if (data['congress']) {
    append(html`

Congressional district

WA district ${data['congress']['CD114FP']}

      ${createMap('congress', mapstate)}

`)
  }

  if (data['zoning']) {
    append(html`

Zoning

${data.zoning.CLASS_DESC}

      ${createMap('zoning', mapstate)}

`)
  }

  if (data['zip-codes']) {
    append(html`

Zip code

WA district ${data['zip-codes']['GEOID10']}

      ${createMap('zip-codes', mapstate)}

`)

  }

  if (data['census-tracts']) {
    append(html`

Census

Tract

${data['census-tracts'].name}

      ${createMap('census-tracts', mapstate)}

`)
  }

  // there's something messed up about the city limits dataset
  // append(html`<h2>City limits</h2>`)
  // if (data['city-limits']) {
  //   append(html`<p>This location is inside Seattle city limits.</p>`)
  //   append(createMap('city-limits', mapstate))
  // } else {
  //   append(html`<p>This location isn't inside city limits.</p>`)
  // }

  function append (child) { el.appendChild(child) }
  return el
}


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <!--metadata-->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{title}} | Flask To-Do App</title>

    <!--stylesheets-->
    <link href="https://fonts.googleapis.com/css?family=Open+Sans%7CRoboto+Slab" rel="stylesheet">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="{{url_for('static', filename='css/jumbotron-narrow.css')}}">
    <link rel="stylesheet" href="https://bootswatch.com/sandstone/bootstrap.min.css">
    <link rel="stylesheet" href="{{url_for('static', filename='css/global.css')}}">
    {% block stylesheets %}
    {% endblock %}
</head>
<body>
    <div class="container">
        {% include "includes/_navbar.html" %}
        {% include "includes/_flash.html" %}
        {% include "includes/_messages.html" %}

        {% block body %}
        {% endblock %}

        {% include "includes/_footer.html" %}
    </div>

    <!--scripts-->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    {% block scripts%}
    {% endblock %}
</body>
</html>


text:
<?php

class testRuleAppliesToFieldAndParameterWithNameShorterThanThreshold
{
    protected $_x;

    public function testRuleAppliesToFieldAndParameterWithNameShorterThanThreshold($x)
    {
    }
}


text:
import { Component, DebugElement, TemplateRef, ViewChild } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

import { AdNoticeIconModule } from './notice-icon.module';
import { NoticeIconComponent } from './notice-icon.component';
import { NoticeItem } from './interface';

describe('abc: notice-icon', () => {
  let fixture: ComponentFixture<TestComponent>;
  let dl: DebugElement;
  let context: TestComponent;

  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [NoopAnimationsModule, AdNoticeIconModule.forRoot()],
      declarations: [TestComponent],
    });
    fixture = TestBed.createComponent(TestComponent);
    dl = fixture.debugElement;
    context = fixture.componentInstance;
    fixture.detectChanges();
  });

  function isText(cls: string, value: any) {
    const el = dl.query(By.css(cls)).nativeElement as HTMLElement;
    if (el) return el.innerText.trim();
    return '';
  }

  function isExists(cls: string, stauts: boolean = true) {
    if (stauts) expect(dl.query(By.css(cls))).not.toBeNull();
    else expect(dl.query(By.css(cls))).toBeNull();
  }

  describe('when not data', () => {
    beforeEach(() => (context.data = []));
    it('should be count', () => {
      context.count = 5;
      fixture.detectChanges();
      const cur = dl.query(By.css('.ant-scroll-number-only .current'))
        .nativeElement as HTMLElement;
      expect(+cur.innerText).toBe(context.count);
    });
  });

  describe('when has data', () => {
    it('should be popover list via popoverVisible property', () => {
      spyOn(context, 'popupVisibleChange');
      expect(context.popoverVisible).toBeUndefined();
      context.popoverVisible = true;
      fixture.detectChanges();
      expect(context.popoverVisible).toBe(true);
      expect(context.popupVisibleChange).toHaveBeenCalled();
    });
    it('should be popover list via click', () => {
      expect(context.popoverVisible).toBeUndefined();
      (dl.query(By.css('.item')).nativeElement as HTMLElement).click();
      fixture.detectChanges();
      expect(context.popoverVisible).toBe(true);
    });
    it('should be control loading in visible popover', () => {
      context.loading = true;
      context.popoverVisible = true;
      fixture.detectChanges();
      const el = dl.query(By.css('.ant-spin-container'))
        .nativeElement as HTMLElement;
      expect(el.hidden).toBe(true);
    });
    it('should be select item', () => {
      spyOn(context, 'select');
      context.popoverVisible = true;
      fixture.detectChanges();
      expect(context.select).not.toHaveBeenCalled();
      (dl.query(By.css('nz-list-item')).nativeElement as HTMLElement).click();
      fixture.detectChanges();
      expect(context.select).toHaveBeenCalled();
    });
    it('should be clear', () => {
      spyOn(context, 'clear');
      context.popoverVisible = true;
      fixture.detectChanges();
      expect(context.clear).not.toHaveBeenCalled();
      (dl.query(By.css('.clear')).nativeElement as HTMLElement).click();
      fixture.detectChanges();
      expect(context.clear).toHaveBeenCalled();
    });
  });
});

@Component({
  template: `
    <notice-icon #comp
        [data]="data"
        [count]="count"
        [loading]="loading"
        (select)="select($event)"
        (clear)="clear($event)"
        [(popoverVisible)]="popoverVisible"
        (popoverVisibleChange)="popupVisibleChange($event)"></notice-icon>
    `,
})
class TestComponent {
  @ViewChild('comp') comp: NoticeIconComponent;
  data: NoticeItem[] = [
    {
      title: 'test',
      list: [
        {
          id: '000000001',
          avatar:
            'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
          title: '你收到了 14 份新周报',
          datetime: '7 个月前',
          type: '通知',
        },
        {
          id: '000000002',
          avatar:
            'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png',
          title: '你推荐的 曲妮妮 已通过第三轮面试',
          datetime: '7 个月前',
          type: '通知',
        },
        {
          id: '000000003',
          avatar:
            'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png',
          title: '这种模板可以区分多种通知类型',
          datetime: '7 个月前',
          read: true,
          type: '通知',
        },
        {
          id: '000000004',
          avatar:
            'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png',
          title: '左侧图标用于区分不同的类型',
          datetime: '7 个月前',
          type: '通知',
        },
        {
          id: '000000005',
          avatar:
            'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
          title: '内容不要超过两行字,超出时自动截断',
          datetime: '7 个月前',
          type: '通知',
        },
      ],
    },
  ];
  count = 10;
  loading = false;
  popoverVisible: boolean;
  select() {}
  clear() {}
  popupVisibleChange() {}
}


text:
<?php

namespace PDepend\Source\AST;

use PDepend\Source\ASTVisitor\ASTVisitor;

/**
 * This is a classes only version of the class or interface reference .
 *
 * @copyright 2008-2013 Manuel Pichler. All rights reserved.
 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
 * @since     0.9.5
 */
class ASTClassReference extends ASTClassOrInterfaceReference
{
    /**
     * The image type of this node.
     */
    const CLAZZ = __CLASS__;

    /**
     * Returns the concrete type instance associated with with this placeholder.
     *
     * @return \PDepend\Source\AST\AbstractASTClassOrInterface
     */
    public function getType()
    {
        if ($this->typeInstance === null) {
            $this->typeInstance = $this->context->getClass($this->getImage());
        }
        return $this->typeInstance;
    }

    /**
     * Accept method of the visitor design pattern. This method will be called
     * by a visitor during tree traversal.
     *
     * @param \PDepend\Source\ASTVisitor\ASTVisitor $visitor
     * @param mixed $data
     * @return mixed
     * @since 0.9.12
     */
    public function accept(ASTVisitor $visitor, $data = null)
    {
        return $visitor->visitClassReference($this, $data);
    }
}


text:
package com.microsoft.azure.management.compute.v2018_04_01;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
 * Defines values for StorageAccountTypes.
 */
public final class StorageAccountTypes extends ExpandableStringEnum<StorageAccountTypes> {
    /** Static value Standard_LRS for StorageAccountTypes. */
    public static final StorageAccountTypes STANDARD_LRS = fromString("Standard_LRS");

    /** Static value Premium_LRS for StorageAccountTypes. */
    public static final StorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS");

    /**
     * Creates or finds a StorageAccountTypes from its string representation.
     * @param name a name to look for
     * @return the corresponding StorageAccountTypes
     */
    @JsonCreator
    public static StorageAccountTypes fromString(String name) {
        return fromString(name, StorageAccountTypes.class);
    }

    /**
     * @return known StorageAccountTypes values
     */
    public static Collection<StorageAccountTypes> values() {
        return values(StorageAccountTypes.class);
    }
}


text:
package org.frameworkset.spi.remote.webservice;

import org.apache.cxf.transports.http.configuration.ProxyServerType;

import com.frameworkset.util.EditorInf;

/**
 *
Title: ProxyServerTypeEditor.java

 *
Description:

 *
bboss workgroup

 *
Copyright (c) 2007

 * @Date 2009-12-7 ÉÏÎç11:39:25
 * @author biaoping.yin
 * @version 1.0
 */
public class ProxyServerTypeEditor implements EditorInf
{

    public Object getValueFromObject(Object fromValue)
    {

        return getValueFromString((String)fromValue);
    }

    public Object getValueFromString(String fromValue)
    {
        if(fromValue == null)
        {
            return ProxyServerType.HTTP;
        }
        else if(fromValue.equals("HTTP"))
        {
            return ProxyServerType.HTTP;
        }
        else if(fromValue.equals("SOCKS"))
        {
            return ProxyServerType.SOCKS;
        }
        else
        {
            throw new java.lang.IllegalArgumentException();
        }
    }

}


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateAccountsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('accounts', function(Blueprint $table) {
            $table->increments('insta_id');
            $table->string('email');
            $table->string('password');
            $table->string('hashtag');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('accounts');
    }
}


text:
namespace Google.Cloud.AssuredWorkloads.V1Beta1.Snippets
{
    // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_async]
    using Google.Cloud.AssuredWorkloads.V1Beta1;
    using Google.LongRunning;
    using System.Threading.Tasks;

    public sealed partial class GeneratedAssuredWorkloadsServiceClientSnippets
    {
        /// <summary>Snippet for CreateWorkloadAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task CreateWorkloadRequestObjectAsync()
        {
            // Create client
            AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = await AssuredWorkloadsServiceClient.CreateAsync();
            // Initialize request argument(s)
            CreateWorkloadRequest request = new CreateWorkloadRequest
            {
                ParentAsLocationName = LocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
                Workload = new Workload(),
                ExternalId = "",
            };
            // Make the request
            Operation<Workload, CreateWorkloadOperationMetadata> response = await assuredWorkloadsServiceClient.CreateWorkloadAsync(request);

            // Poll until the returned long-running operation is complete
            Operation<Workload, CreateWorkloadOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
            // Retrieve the operation result
            Workload result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation<Workload, CreateWorkloadOperationMetadata> retrievedResponse = await assuredWorkloadsServiceClient.PollOnceCreateWorkloadAsync(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Workload retrievedResult = retrievedResponse.Result;
            }
        }
    }
    // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_async]
}