text:
package bucket

import (
	"fmt"
	"github.com/qiniu/go-sdk/v7/auth"
	"github.com/qiniu/go-sdk/v7/storage"
	"github.com/qiniu/qshell/v2/iqshell/common/alert"
	"github.com/qiniu/qshell/v2/iqshell/common/config"
	"github.com/qiniu/qshell/v2/iqshell/common/data"
	"github.com/qiniu/qshell/v2/iqshell/common/utils"
	"github.com/qiniu/qshell/v2/iqshell/common/workspace"
	"strings"
)

func DomainOfBucket(bucket string) (domain string, err *data.CodeError) {
	//get domains of bucket
	domainsOfBucket, gErr := AllDomainsOfBucket(bucket)
	if gErr != nil {
		err = data.NewEmptyError().AppendDescF("Get domains of bucket error: %v", gErr)
		return
	}

	if len(domainsOfBucket) == 0 {
		err = data.NewEmptyError().AppendDescF("No domains found for bucket: %s", bucket)
		return
	}
	return domainsOfBucket[0].Domain.Value(), nil
}

var (
	DomainTypeStrings     = []string{"CDN 域名", "源站域名"}
	DomainApiScopeStrings = []string{"kodo api", "s3 api"}
)

type DomainInfo struct {
	Domain      *data.String `json:"domain"`
	DomainType  *data.Int    `json:"domaintype"`   // 0:cdn 1:源站
	ApiScope    *data.Int    `json:"apiscope"`     //
	FreezeTypes []string     `json:"freeze_types"` // 不为空表示已被冻结
	Tbl         *data.String `json:"tbl"`          // 存储空间名字
	Owner       *data.Int    `json:"uid"`          // 用户UID
	Refresh     *data.Bool   `json:"refresh"`      // cdn的自主刷新
	Ctime       *data.Int    `json:"ctime"`
	Utime       *data.Int    `json:"utime"`
}

func (i *DomainInfo) getTypeString() string {
	if i.DomainType.Value() < 0 || i.DomainType.Value() > len(DomainTypeStrings) {
		return "Unknown"
	}
	return DomainTypeStrings[i.DomainType.Value()]
}

func (i *DomainInfo) getApiScopeString() string {
	if i.ApiScope.Value() < 0 || i.ApiScope.Value() > len(DomainTypeStrings) {
		return "Unknown"
	}
	return DomainApiScopeStrings[i.ApiScope.Value()]
}

func (i *DomainInfo) DescriptionString() string {
	return fmt.Sprintf("%s", i.Domain.Value())
}

func (i *DomainInfo) DetailDescriptionString() string {
	return fmt.Sprintf("%-12s: %s\n%-12s: %d(%s)\n%-12s: %d(%s)\n%-12s: %s\n",
		"domain", i.Domain.Value(),
		"type", i.DomainType.Value(), i.getTypeString(),
		"ApiScope", i.ApiScope.Value(), i.getApiScopeString(),
		"FreezeTypes", i.FreezeTypes)
}

// AllDomainsOfBucket 获取一个存储空间绑定的CDN域名
func AllDomainsOfBucket(bucket string) (domains []DomainInfo, err *data.CodeError) {
	domains, err = allDomainsOfBucket(workspace.GetConfig(), bucket)
	if len(domains) == 0 {
		return domains, err
	}

	cdnDomains := make([]DomainInfo, 0)
	sourceDomains := make([]DomainInfo, 0)
	for _, d := range domains {
		if d.Domain != nil && !strings.HasPrefix(d.Domain.Value(), ".") {
			if d.DomainType.Value() == 0 {
				cdnDomains = append(cdnDomains, d)
			} else if d.DomainType.Value() == 1 {
				sourceDomains = append(sourceDomains, d)
			}
		}
	}
	domains = append(cdnDomains, sourceDomains...)
	return domains, err
}

func allDomainsOfBucket(cfg *config.Config, bucket string) ([]DomainInfo, *data.CodeError) {
	bucketManager, gErr := GetBucketManager()
	if gErr != nil {
		return nil, gErr
	}

	reqHost := cfg.Hosts.GetOneApi()
	if len(reqHost) == 0 {
		if region, err := Region(bucket); err != nil {
			return nil, alert.Error("get region error:"+err.Error(), "")
		} else {
			reqHost = region.ApiHost
		}
	}

	var domains []DomainInfo
	reqURL := fmt.Sprintf("%s/v7/domain/list?tbl=%s", utils.Endpoint(cfg.IsUseHttps(), reqHost), bucket)
	//reqURL = fmt.Sprintf("%s/domain?bucket=%s&type=all", utils.Endpoint(cfg.IsUseHttps(), reqHost), bucket)
	err := bucketManager.Client.CredentialedCall(workspace.GetContext(), bucketManager.Mac, auth.TokenQiniu, &domains, "GET", reqURL, nil)
	if err != nil {
		if e, ok := err.(*storage.ErrorInfo); ok {
			if e.Code != 404 {
				return nil, data.ConvertError(e)
			}
			err = nil
		} else {
			return nil, data.ConvertError(err)
		}
	}
	return domains, nil
}


text:
using System;
using Xamarin.Forms;
using AiForms.Renderers;
using Reactive.Bindings;
using static Sample.ViewModels.ViewModelBase;
using Xamarin.Forms.Internals;
using System.Collections.Generic;
using System.Linq;

namespace Sample.ViewModels
{
    public class ParentPropTestViewModel:ViewModelBase
    {
        public ParentPropTestViewModel()
        {

        }

        protected override void ParentChanged(object obj)
        {
            base.ParentChanged(obj);
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace Handle.WPF
{
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Windows.Controls;
  using System.ComponentModel.Composition;
  using Caliburn.Micro;
  using System.Windows;

  class NotificationToastViewModel : ViewModelBase
  {
    public string Network { get; set; }
    public string Channel { get; set; }
    public string TimeStamp { get; set; }
    public string User { get; set; }
    public string Message { get; set; }
    public ShellView SV;

    public NotificationToastViewModel(MessageFilterEventArgs e, Window w)
    {
      this.Network = e.Network;
      this.Channel = e.Channel;
      this.TimeStamp = e.Timestamp;
      this.User = e.Name;
      this.Message = e.Message;
      this.SV = (ShellView)w;
    }

    public void ShowTab()
    {
      List<IrcChannelViewModel> icvm = new List<IrcChannelViewModel>();
      List<IrcNetworkViewModel> invm = new List<IrcNetworkViewModel>();
      IrcMainView imv = (IrcMainView)this.SV.ActiveItem.Content;
      IrcMainViewModel imvm = (IrcMainViewModel)imv.DataContext;
      IrcNetworkViewModel y = null;

      for (int i = 0; i < imv.Items.Items.Count; i++)
      {
        invm.Add((IrcNetworkViewModel)imv.Items.Items[i]);
      }
      foreach (IrcNetworkViewModel inv in invm)
      {
        if (inv.DisplayName == this.Network)
        {
          imvm.ActivateItem(inv);
          y = inv;
        }
      }
      IrcNetworkView z = y.GetView() as IrcNetworkView;

      for (int i = 1; i < z.Items.Items.Count; i++)
      {
        icvm.Add((IrcChannelViewModel)z.Items.Items[i]);
      }
      foreach (IrcChannelViewModel ic in icvm)
      {
        if (ic.Channel.Name == this.Channel)
        {
          y.ActivateItem(ic);
        }
      }
      this.TryClose();
    }
  }
}


text:
#import "ABI8_0_0RCTDefines.h"

#if ABI8_0_0RCT_DEV // Only supported in dev mode

#import "ABI8_0_0RCTWebSocketProxyDelegate.h"

@protocol ABI8_0_0RCTWebSocketProxy

+ (instancetype)sharedInstance;

- (void)setDelegate:(id<ABI8_0_0RCTWebSocketProxyDelegate>)delegate forURL:(NSURL *)url;

- (instancetype) init   __attribute__((unavailable("init not available, call sharedInstance instead")));

@end

#endif


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Sphaerosoma tasmanica Rodway

### Remarks
null


text:
/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
   Component: Sticky
 ========================================================================== */
/*
 * 1. More robust if padding and border are used
 * 2. Enable hardware acceleration for iOS browsers, resolves scrolling issue
 */
[data-uk-sticky].uk-active {
  z-index: 980;
  /* 1 */
  box-sizing: border-box;
  /* 2 */
  -webkit-backface-visibility: hidden;
}
/*
 * Faster animations
 */
[data-uk-sticky][class*='uk-animation-'] {
  -webkit-animation-duration: 0.2s;
  animation-duration: 0.2s;
}
[data-uk-sticky].uk-animation-reverse {
  -webkit-animation-duration: 0.2s;
  animation-duration: 0.2s;
}


text:
#region License

#endregion

using System;

namespace Infinity.Client
{
    partial class CKernel
    {
        public void Debug(string message)
        {
            Log(message);
        }

        public void Error(Exception ex)
        {
            LogError(ex);
        }

        public void Fatal(Exception ex)
        {
            LogError(ex);
        }

        public void Info(string message)
        {
            Log(message);
        }

        public void Trace(string message)
        {
            Log(message);
        }

        public void Warn(string message)
        {
            LogWarning(message);
        }

        public void Warn(string message, params object[] args)
        {
            LogWarningFormat(message, args);
        }

        public void Error(Exception ex, string message, params object[] args)
        {
            LogErrorFormat(message, args);
        }
    }

}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <link rel="stylesheet" type="text/css" href="css/test2.css">
    <title>my test</title>

header

            00000000000000

            1111111111111111

            2222222222222222222222222222


text:
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/*  Fluent Bit
 *  ==========
 *  Copyright (C) 2015-2017 Treasure Data Inc.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

#ifndef FLB_THREAD_LIBCO_H
#define FLB_THREAD_LIBCO_H

#include <fluent-bit/flb_info.h>
#include <fluent-bit/flb_mem.h>
#include <fluent-bit/flb_macros.h>
#include <fluent-bit/flb_log.h>

#include <monkey/mk_core.h>

#include <stdlib.h>
#include <limits.h>
#include <libco.h>

#ifdef FLB_HAVE_VALGRIND
#include <valgrind/valgrind.h>
#endif

struct flb_thread {

#ifdef FLB_HAVE_VALGRIND
    unsigned int valgrind_stack_id;
#endif

    /* libco 'contexts' */
    cothread_t caller;
    cothread_t callee;

    void *data;

    /*
     * Callback invoked before the thread is destroyed. Used to release
     * any pending info in FLB_THREAD_DATA(...).
     */
    void (*cb_destroy) (void *);
};

#define FLB_THREAD_STACK_SIZE      ((3 * PTHREAD_STACK_MIN) / 2)
#define FLB_THREAD_DATA(th)        (((char *) th) + sizeof(struct flb_thread))

FLB_EXPORT pthread_key_t flb_thread_key;

static FLB_INLINE void flb_thread_prepare()
{
    pthread_key_create(&flb_thread_key, NULL);
}

static FLB_INLINE void flb_thread_yield(struct flb_thread *th, int ended)
{
    co_switch(th->caller);
}

static FLB_INLINE void flb_thread_destroy(struct flb_thread *th)
{
    if (th->cb_destroy) {
        th->cb_destroy(FLB_THREAD_DATA(th));
    }
    flb_trace("[thread] destroy thread=%p data=%p", th, FLB_THREAD_DATA(th));

#ifdef FLB_HAVE_VALGRIND
    VALGRIND_STACK_DEREGISTER(th->valgrind_stack_id);
#endif

    co_delete(th->callee);
    flb_free(th);
}

#define flb_thread_return(th) co_switch(th->caller)

static FLB_INLINE void flb_thread_resume(struct flb_thread *th)
{
    pthread_setspecific(flb_thread_key, (void *) th);

    /*
     * In the past we used to have a flag to mark when a coroutine
     * has finished (th->ended == MK_TRUE), now we let the coroutine
     * to submit an event to the event loop indicating what's going on
     * through the call FLB_OUTPUT_RETURN(...).
     *
     * So we just swap context and let the event loop to handle all
     * the cleanup required.
     */

    th->caller = co_active();
    co_switch(th->callee);
}

static FLB_INLINE struct flb_thread *flb_thread_new(size_t data_size,
                                         void (*cb_destroy) (void *))

{
    void *p;
    struct flb_thread *th;

    /* Create a thread context and initialize */
    p = flb_malloc(sizeof(struct flb_thread) + data_size);
    if (!p) {
        flb_errno();
        return NULL;
    }

    th = (struct flb_thread *) p;
    th->cb_destroy = NULL;

    flb_trace("[thread %p] created (custom data at %p, size=%lu",
              th, FLB_THREAD_DATA(th), data_size);

    return th;
}

#endif


text:
<?php

namespace Adyen\Payment\Helper;

use Adyen\Payment\Exception\InvalidAdditionalDataException;
use Adyen\Payment\Exception\PaymentMethodException;
use Adyen\Payment\Helper\PaymentMethods\AbstractWalletPaymentMethod;
use Adyen\Payment\Helper\PaymentMethods\PaymentMethodFactory;
use Adyen\Payment\Helper\PaymentMethods\PaymentMethodInterface;
use Adyen\Payment\Logger\AdyenLogger;
use Adyen\Payment\Model\Ui\AdyenCcConfigProvider;
use Adyen\Payment\Model\Ui\AdyenHppConfigProvider;
use DateInterval;
use DateTime;
use DateTimeZone;
use Exception;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Payment\Model\InfoInterface;
use Magento\Sales\Api\Data\OrderPaymentExtensionInterface;
use Magento\Vault\Api\Data\PaymentTokenFactoryInterface;
use Magento\Vault\Api\Data\PaymentTokenInterface;
use Magento\Vault\Api\PaymentTokenRepositoryInterface;
use Magento\Vault\Model\PaymentTokenManagement;

class Vault
{
    const RECURRING_DETAIL_REFERENCE = 'recurring.recurringDetailReference';
    const CARD_SUMMARY = 'cardSummary';
    const EXPIRY_DATE = 'expiryDate';
    const PAYMENT_METHOD = 'paymentMethod';
    const TOKEN_TYPE = 'tokenType';
    const ADDITIONAL_DATA_ERRORS = [
        self::RECURRING_DETAIL_REFERENCE => 'Missing Token in Result please enable in ' .
            'Settings -> API URLs and Response menu in the Adyen Customer Area Recurring details setting',
        self::CARD_SUMMARY => 'Missing cardSummary in Result please login to the adyen portal ' .
            'and go to Settings -> API URLs and Response and enable the Card summary property',
        self::EXPIRY_DATE => 'Missing expiryDate in Result please login to the adyen portal and go to ' .
            'Settings -> API URLs and Response and enable the Expiry date property',
        self::PAYMENT_METHOD => 'Missing paymentMethod in Result please login to the adyen portal and go to ' .
            'Settings -> API URLs and Response and enable the Variant property'
    ];

    /**
     * @var Data
     */
    private $adyenHelper;

    /**
     * @var AdyenLogger
     */
    private $adyenLogger;

    /**
     * @var PaymentTokenManagement
     */
    private $paymentTokenManagement;

    /**
     * @var PaymentTokenFactoryInterface
     */
    private $paymentTokenFactory;

    /**
     * @var PaymentTokenRepositoryInterface
     */
    private $paymentTokenRepository;

    /**
     * @var Config
     */
    private $config;

    /** @var PaymentMethods */
    private $paymentMethodsHelper;

    /** @var PaymentMethodFactory */
    private $paymentMethodFactory;

    public function __construct(
        Data $adyenHelper,
        AdyenLogger $adyenLogger,
        PaymentTokenManagement $paymentTokenManagement,
        PaymentTokenFactoryInterface $paymentTokenFactory,
        PaymentTokenRepositoryInterface $paymentTokenRepository,
        Config $config,
        PaymentMethods $paymentMethodsHelper,
        PaymentMethodFactory $paymentMethodFactory
    ) {
        $this->adyenHelper = $adyenHelper;
        $this->adyenLogger = $adyenLogger;
        $this->paymentTokenManagement = $paymentTokenManagement;
        $this->paymentTokenFactory = $paymentTokenFactory;
        $this->paymentTokenRepository = $paymentTokenRepository;
        $this->config = $config;
        $this->paymentMethodsHelper = $paymentMethodsHelper;
        $this->paymentMethodFactory = $paymentMethodFactory;
    }

    /**
     * Check if one click is enabled AND Magento Vault is set
     * intval() is required since "" is returned if config doesn't exist
     *
     * @param null $storeId
     * @return bool
     */
    public function isCardVaultEnabled($storeId = null): bool
    {
        return intval($this->config->getCardRecurringActive($storeId)) && ($this->config->getCardRecurringMode($storeId) === Recurring::MODE_MAGENTO_VAULT);
    }

    /**
     * @param array $response
     * @return bool
     */
    public function hasRecurringDetailReference(array $response): bool
    {
        if (array_key_exists('additionalData', $response) &&
            array_key_exists(self::RECURRING_DETAIL_REFERENCE, $response['additionalData'])) {
            return true;
        }

        return false;
    }

    public function saveRecurringCardDetails(
        $payment,
        array $additionalData,
        AbstractWalletPaymentMethod $paymentMethod = null
    ) {
        if (!$this->isCardVaultEnabled($payment->getOrder()->getStoreId()) &&
            !$this->adyenHelper->isHppVaultEnabled($payment->getOrder()->getStoreId())) {
            return;
        }

        if (!$this->validateAdditionalData($additionalData)) {
            return;
        }

        try {
            $paymentToken = $this->getVaultPaymentToken($payment, $additionalData, $paymentMethod);
        } catch (Exception $exception) {
            $this->adyenLogger->error(json_encode($exception));
            return;
        }

        if (null !== $paymentToken) {
            $extensionAttributes = $this->getExtensionAttributes($payment);
            $extensionAttributes->setVaultPaymentToken($paymentToken);
        } else {
            $this->adyenLogger->error(
                sprintf(
                    'Failure trying to save credit card token in vault for order %s',
                    $payment->getOrder()->getIncrementId()
                )
            );
        }
    }

    /**
     * Save recurring details related to the payment method.
     *
     * @param $payment
     * @param array $additionalData
     * @return PaymentTokenInterface|null
     */
    public function saveRecurringPaymentMethodDetails($payment, array $additionalData): ?PaymentTokenInterface
    {
        try {
            $paymentToken = $this->createVaultAccountToken($payment, $additionalData);
            $extensionAttributes = $this->getExtensionAttributes($payment);
            $extensionAttributes->setVaultPaymentToken($paymentToken);
        } catch (PaymentMethodException $e) {
            $this->adyenLogger->error(sprintf(
                'Unable to create token for order %s',
                $payment->getOrder()->getEntityId()
            ));

            return null;
        } catch (Exception $exception) {
            $this->adyenLogger->error($exception->getMessage());

            return null;
        }

        return $paymentToken;
    }

    /**
     * Build the recurring data when payment is done trough a payment method (not card)
     *
     * @param int $storeId
     * @param $payment
     * @return array
     */
    public function buildPaymentMethodRecurringData(int $storeId, $brand): array
    {
        $request = [];
        if (!$this->config->isStoreAlternativePaymentMethodEnabled()) {
            return $request;
        }
        try {
            $adyenPaymentMethod = $this->paymentMethodFactory::createAdyenPaymentMethod($brand);
            $allowRecurring = $this->allowRecurringOnPaymentMethod($adyenPaymentMethod, $storeId);
        } catch (PaymentMethodException $exception) {
            $this->adyenLogger->error(sprintf('Unable to create payment method with tx variant %s', $brand));
            return $request;
        } catch (NoSuchEntityException $exception) {
            $this->adyenLogger->error(sprintf('Unable to find payment method with tx variant %s', $brand));
            return $request;
        }

        if (!$allowRecurring) {
            return $request;
        }

        $recurringModel = $this->config->getAlternativePaymentMethodTokenType($storeId);
        if (isset($recurringModel)) {
            $request['storePaymentMethod'] = true;
            $request['recurringProcessingModel'] = $recurringModel;
        }
        return $request;
    }

    /**
     * Check if recurring should be allowed for payment method by checking:
     * What type of recurring is currently enabled AND if the payment method supports that specific type recurring
     * AND if the admin has enabled recurring for this payment method
     *
     * @param PaymentMethodInterface $adyenPaymentMethod
     * @param int|null $storeId
     * @return bool
     * @throws NoSuchEntityException
     */
    public function allowRecurringOnPaymentMethod(PaymentMethodInterface $adyenPaymentMethod, ?int $storeId): bool
    {
        $currentRecurringTokenSetting = $this->config->getAlternativePaymentMethodTokenType($storeId);
        if ($currentRecurringTokenSetting === Recurring::CARD_ON_FILE) {
            $methodSupportsRecurring = $adyenPaymentMethod->supportsCardOnFile();
        } elseif ($currentRecurringTokenSetting === Recurring::UNSCHEDULED_CARD_ON_FILE) {
            $methodSupportsRecurring = $adyenPaymentMethod->supportsUnscheduledCardOnFile();
        } else {
            $methodSupportsRecurring = $adyenPaymentMethod->supportsSubscription();
        }

        $tokenizedPaymentMethods = array_map(
            'trim',
            explode(',', $this->config->getTokenizedPaymentMethods($storeId))
        );
        $shouldTokenize = in_array($adyenPaymentMethod->getTxVariant(), $tokenizedPaymentMethods);

        return $methodSupportsRecurring && $shouldTokenize;
    }

    /**
     * Return the Adyen token type (CardOnFile/Subscription)
     * If it does not exist (token was created in an older version) return null
     *
     * @param PaymentTokenInterface $paymentToken
     * @return string|null
     */
    public function getAdyenTokenType(PaymentTokenInterface $paymentToken): ?string
    {
        $details = json_decode($paymentToken->getTokenDetails() ?: '{}', true);
        if (array_key_exists(self::TOKEN_TYPE, $details)) {
            return $details[self::TOKEN_TYPE];
        }

        return null;
    }

    /**
     * Create an entry in the vault table w/type=Account (for pms such as PayPal)
     * If the token has already been created, do nothing
     * Before doing this, validate the additionalData sent by Adyen, based on the params required by the payment method
     *
     * @throws InvalidAdditionalDataException
     */
    private function createVaultAccountToken($payment, array $additionalData): PaymentTokenInterface
    {
        // Check if paymentToken exists already
        $paymentToken = $this->paymentTokenManagement->getByGatewayToken(
            $additionalData[self::RECURRING_DETAIL_REFERENCE],
            $payment->getMethodInstance()->getCode(),
            $payment->getOrder()->getCustomerId()
        );

        // In case the payment token does not exist, create it based on the additionalData
        if (is_null($paymentToken)) {
            $storeId = $payment->getOrder()->getStoreId();
            $recurringModel = $this->config->getAlternativePaymentMethodTokenType($storeId);
            $paymentToken = $this->paymentTokenFactory->create(PaymentTokenFactoryInterface::TOKEN_TYPE_ACCOUNT);
            $paymentToken->setGatewayToken($additionalData[self::RECURRING_DETAIL_REFERENCE]);
            $expiryDate = new DateTime();
            $expiryDate->add(new DateInterval('P1Y'));
            $paymentToken->setExpiresAt($expiryDate);
            $details = [
                'type' => $payment->getCcType(),
                self::TOKEN_TYPE => $recurringModel
            ];

            $paymentToken->setTokenDetails(json_encode($details, JSON_FORCE_OBJECT));
        }

        return $paymentToken;
    }

    /**
     * @throws Exception
     */
    private function getVaultPaymentToken(
        $payment,
        array $additionalData,
        AbstractWalletPaymentMethod $paymentMethod = null
    ): PaymentTokenInterface {
        // Check if paymentToken exists already
        $paymentToken = $this->paymentTokenManagement->getByGatewayToken(
            $additionalData[self::RECURRING_DETAIL_REFERENCE],
            $payment->getMethodInstance()->getCode(),
            $payment->getOrder()->getCustomerId()
        );

        $paymentTokenSaveRequired = false;

        // In case the payment token does not exist, create it based on the additionalData
        if ($paymentToken === null) {
            $paymentToken = $this->paymentTokenFactory->create(
                PaymentTokenFactoryInterface::TOKEN_TYPE_CREDIT_CARD
            );
            $paymentToken->setGatewayToken($additionalData[self::RECURRING_DETAIL_REFERENCE]);
        } else {
            $paymentTokenSaveRequired = true;
        }

        $paymentToken->setExpiresAt($this->getExpirationDate($additionalData[self::EXPIRY_DATE]));

        if (isset($paymentMethod)) {
            $details = [
                'type' => $paymentMethod->getCardScheme(),
                'walletType' => $paymentMethod->getTxVariant()
            ];
        } else {
            $details = ['type' => $additionalData[self::PAYMENT_METHOD]];
        }

        if (!empty($additionalData[self::CARD_SUMMARY])) {
            $details['maskedCC'] =  $additionalData[self::CARD_SUMMARY];
        }

        if (!empty($additionalData[self::EXPIRY_DATE])) {
            $details['expirationDate'] =  $additionalData[self::EXPIRY_DATE];
        }

        // Set token type (alternative payment methods) for card tokens created using googlepay, applepay.
        // This will be done for all card tokens once all vault changes are implemented
        if ($payment->getMethodInstance()->getCode() === AdyenHppConfigProvider::CODE) {
            $storeId = $payment->getOrder()->getStoreId();
            $recurringModel = $this->config->getAlternativePaymentMethodTokenType($storeId);
            $details[self::TOKEN_TYPE] = $recurringModel;
        } elseif ($payment->getMethodInstance()->getCode() === AdyenCcConfigProvider::CODE) {
            $storeId = $payment->getOrder()->getStoreId();
            $recurringModel = $this->config->getCardRecurringType($storeId);
            $details[self::TOKEN_TYPE] = $recurringModel;
        }

        $paymentToken->setTokenDetails(json_encode($details));

        // If the token is updated, it needs to be saved to keep the changes
        if ($paymentTokenSaveRequired) {
            $this->paymentTokenRepository->save($paymentToken);
        }
        return $paymentToken;
    }

    /**
     * @param array $additionalData
     * @return bool
     */
    private function validateAdditionalData(array $additionalData)
    {
        if (empty($additionalData)) {
            return false;
        }

        foreach (self::ADDITIONAL_DATA_ERRORS as $key => $errorMsg) {
            if (empty($additionalData[$key])) {
                $this->adyenLogger->error($errorMsg);
                return false;
            }
        }

        return true;
    }

    /**
     * @param $expirationDate
     * @return string
     * @throws Exception
     */
    private function getExpirationDate($expirationDate)
    {
        $expirationDate = explode('/', $expirationDate);

        $expDate = new DateTime(
        //add leading zero to month
            sprintf("%s-%02d-01 00:00:00", $expirationDate[1], $expirationDate[0]),
            new DateTimeZone('UTC')
        );

        // add one month
        $expDate->add(new DateInterval('P1M'));
        return $expDate->format('Y-m-d H:i:s');
    }

    /**
     * Get payment extension attributes
     *
     * @param InfoInterface $payment
     * @return OrderPaymentExtensionInterface
     */
    private function getExtensionAttributes(InfoInterface $payment)
    {
        $extensionAttributes = $payment->getExtensionAttributes();
        if (null === $extensionAttributes) {
            $extensionAttributes = $this->paymentExtensionFactory->create();
            $payment->setExtensionAttributes($extensionAttributes);
        }
        return $extensionAttributes;
    }
}


text:
===================
sphinx-contour-docs
===================

Install
-------

Clone and install::

  git clone https://github.com/sprin/sphinx-contour-docs.git
  cd sphinx-contour-docs
  python setup.py install

Enable Extension
----------------

Append to the extensions list in ``conf.py``::

    extensions = ['contour_docs.contour_docs']

Configure
---------

Set config variable to the projectID in ``conf.py`` file::

    CONTOUR_PROJECT_ID = 1111

Usage
-----

Link to a document with docID 111111::

    :contour:`111111`


text:
import Test.Cabal.Prelude
-- NB: The --dependency flag is not supported by cabal-install
main = setupTest $ do
    withPackageDb $ do
        base_id <- getIPID "base"
        setup_install ["sublib", "--cid", "sublib-0.1-abc"]
        setup_install [ "exe", "--exact-configuration"
                      , "--dependency", "sublib=sublib-0.1-abc"
                      , "--dependency", "base=" ++ base_id ]
        runExe' "exe" [] >>= assertOutputContains "OK"


text:
package me.modmuss50.technicaldimensions.misc;

import me.modmuss50.technicaldimensions.client.gui.GuiDimDevice;
import me.modmuss50.technicaldimensions.client.gui.GuiLinkingDevice;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

/**
 * Created by Mark on 04/08/2016.
 */
public class GuiHandler implements IGuiHandler {
    @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
        return null;
    }

    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
        if (ID == 0) {
            return new GuiLinkingDevice(world, player);
        }
        if (ID == 1) {
            return new GuiDimDevice(world, player);
        }
        return null;
    }
}


text:
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Ads.GoogleAds.V10.Services {

  /// Holder for reflection information generated from google/ads/googleads/v10/services/custom_interest_service.proto
  public static partial class CustomInterestServiceReflection {

    #region Descriptor
    /// File descriptor for google/ads/googleads/v10/services/custom_interest_service.proto
    public static pbr::FileDescriptor Descriptor {
      get { return descriptor; }
    }
    private static pbr::FileDescriptor descriptor;

    static CustomInterestServiceReflection() {
      byte[] descriptorData = global::System.Convert.FromBase64String(
          string.Concat(
            "Cj9nb29nbGUvYWRzL2dvb2dsZWFkcy92MTAvc2VydmljZXMvY3VzdG9tX2lu",
            "dGVyZXN0X3NlcnZpY2UucHJvdG8SIWdvb2dsZS5hZHMuZ29vZ2xlYWRzLnYx",
            "MC5zZXJ2aWNlcxo4Z29vZ2xlL2Fkcy9nb29nbGVhZHMvdjEwL3Jlc291cmNl",
            "cy9jdXN0b21faW50ZXJlc3QucHJvdG8aHGdvb2dsZS9hcGkvYW5ub3RhdGlv",
            "bnMucHJvdG8aF2dvb2dsZS9hcGkvY2xpZW50LnByb3RvGh9nb29nbGUvYXBp",
            "L2ZpZWxkX2JlaGF2aW9yLnByb3RvGhlnb29nbGUvYXBpL3Jlc291cmNlLnBy",
            "b3RvGiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90byKkAQocTXV0",
            "YXRlQ3VzdG9tSW50ZXJlc3RzUmVxdWVzdBIYCgtjdXN0b21lcl9pZBgBIAEo",
            "CUID4EECElMKCm9wZXJhdGlvbnMYAiADKAsyOi5nb29nbGUuYWRzLmdvb2ds",
            "ZWFkcy52MTAuc2VydmljZXMuQ3VzdG9tSW50ZXJlc3RPcGVyYXRpb25CA+BB",
            "AhIVCg12YWxpZGF0ZV9vbmx5GAQgASgIIuMBChdDdXN0b21JbnRlcmVzdE9w",
            "ZXJhdGlvbhIvCgt1cGRhdGVfbWFzaxgEIAEoCzIaLmdvb2dsZS5wcm90b2J1",
            "Zi5GaWVsZE1hc2sSRAoGY3JlYXRlGAEgASgLMjIuZ29vZ2xlLmFkcy5nb29n",
            "bGVhZHMudjEwLnJlc291cmNlcy5DdXN0b21JbnRlcmVzdEgAEkQKBnVwZGF0",
            "ZRgCIAEoCzIyLmdvb2dsZS5hZHMuZ29vZ2xlYWRzLnYxMC5yZXNvdXJjZXMu",
            "Q3VzdG9tSW50ZXJlc3RIAEILCglvcGVyYXRpb24ibwodTXV0YXRlQ3VzdG9t",
            "SW50ZXJlc3RzUmVzcG9uc2USTgoHcmVzdWx0cxgCIAMoCzI9Lmdvb2dsZS5h",
            "ZHMuZ29vZ2xlYWRzLnYxMC5zZXJ2aWNlcy5NdXRhdGVDdXN0b21JbnRlcmVz",
            "dFJlc3VsdCJhChpNdXRhdGVDdXN0b21JbnRlcmVzdFJlc3VsdBJDCg1yZXNv",
            "dXJjZV9uYW1lGAEgASgJQiz6QSkKJ2dvb2dsZWFkcy5nb29nbGVhcGlzLmNv",
            "bS9DdXN0b21JbnRlcmVzdDLWAgoVQ3VzdG9tSW50ZXJlc3RTZXJ2aWNlEvUB",
            "ChVNdXRhdGVDdXN0b21JbnRlcmVzdHMSPy5nb29nbGUuYWRzLmdvb2dsZWFk",
            "cy52MTAuc2VydmljZXMuTXV0YXRlQ3VzdG9tSW50ZXJlc3RzUmVxdWVzdBpA",
            "Lmdvb2dsZS5hZHMuZ29vZ2xlYWRzLnYxMC5zZXJ2aWNlcy5NdXRhdGVDdXN0",
            "b21JbnRlcmVzdHNSZXNwb25zZSJZgtPkkwI6IjUvdjEwL2N1c3RvbWVycy97",
            "Y3VzdG9tZXJfaWQ9Kn0vY3VzdG9tSW50ZXJlc3RzOm11dGF0ZToBKtpBFmN1",
            "c3RvbWVyX2lkLG9wZXJhdGlvbnMaRcpBGGdvb2dsZWFkcy5nb29nbGVhcGlz",
            "LmNvbdJBJ2h0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL2F1dGgvYWR3b3Jk",
            "c0KGAgolY29tLmdvb2dsZS5hZHMuZ29vZ2xlYWRzLnYxMC5zZXJ2aWNlc0Ia",
            "Q3VzdG9tSW50ZXJlc3RTZXJ2aWNlUHJvdG9QAVpJZ29vZ2xlLmdvbGFuZy5v",
            "cmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9hZHMvZ29vZ2xlYWRzL3YxMC9zZXJ2",
            "aWNlcztzZXJ2aWNlc6ICA0dBQaoCIUdvb2dsZS5BZHMuR29vZ2xlQWRzLlYx",
            "MC5TZXJ2aWNlc8oCIUdvb2dsZVxBZHNcR29vZ2xlQWRzXFYxMFxTZXJ2aWNl",
            "c+oCJUdvb2dsZTo6QWRzOjpHb29nbGVBZHM6OlYxMDo6U2VydmljZXNiBnBy",
            "b3RvMw=="));
      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
          new pbr::FileDescriptor[] { global::Google.Ads.GoogleAds.V10.Resources.CustomInterestReflection.Descriptor, global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Api.ClientReflection.Descriptor, global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor, },
          new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
            new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestsRequest), global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestsRequest.Parser, new[]{ "CustomerId", "Operations", "ValidateOnly" }, null, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V10.Services.CustomInterestOperation), global::Google.Ads.GoogleAds.V10.Services.CustomInterestOperation.Parser, new[]{ "UpdateMask", "Create", "Update" }, new[]{ "Operation" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestsResponse), global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestsResponse.Parser, new[]{ "Results" }, null, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestResult), global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestResult.Parser, new[]{ "ResourceName" }, null, null, null, null)
          }));
    }
    #endregion

  }
  #region Messages
  ///
  /// Request message for [CustomInterestService.MutateCustomInterests][google.ads.googleads.v10.services.CustomInterestService.MutateCustomInterests].
  ///
  public sealed partial class MutateCustomInterestsRequest : pb::IMessage<MutateCustomInterestsRequest>
  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      , pb::IBufferMessage
  #endif
  {
    private static readonly pb::MessageParser<MutateCustomInterestsRequest> _parser = new pb::MessageParser<MutateCustomInterestsRequest>(() => new MutateCustomInterestsRequest());
    private pb::UnknownFieldSet _unknownFields;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public static pb::MessageParser<MutateCustomInterestsRequest> Parser { get { return _parser; } }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public static pbr::MessageDescriptor Descriptor {
      get { return global::Google.Ads.GoogleAds.V10.Services.CustomInterestServiceReflection.Descriptor.MessageTypes[0]; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public MutateCustomInterestsRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public MutateCustomInterestsRequest(MutateCustomInterestsRequest other) : this() {
      customerId_ = other.customerId_;
      operations_ = other.operations_.Clone();
      validateOnly_ = other.validateOnly_;
      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public MutateCustomInterestsRequest Clone() {
      return new MutateCustomInterestsRequest(this);
    }

    /// Field number for the "customer_id" field.
    public const int CustomerIdFieldNumber = 1;
    private string customerId_ = "";
    ///
    /// Required. The ID of the customer whose custom interests are being modified.
    ///
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public string CustomerId {
      get { return customerId_; }
      set {
        customerId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
      }
    }

    /// Field number for the "operations" field.
    public const int OperationsFieldNumber = 2;
    private static readonly pb::FieldCodec<global::Google.Ads.GoogleAds.V10.Services.CustomInterestOperation> _repeated_operations_codec
        = pb::FieldCodec.ForMessage(18, global::Google.Ads.GoogleAds.V10.Services.CustomInterestOperation.Parser);
    private readonly pbc::RepeatedField<global::Google.Ads.GoogleAds.V10.Services.CustomInterestOperation> operations_ = new pbc::RepeatedField<global::Google.Ads.GoogleAds.V10.Services.CustomInterestOperation>();
    ///
    /// Required. The list of operations to perform on individual custom interests.
    ///
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public pbc::RepeatedField<global::Google.Ads.GoogleAds.V10.Services.CustomInterestOperation> Operations {
      get { return operations_; }
    }

    /// Field number for the "validate_only" field.
    public const int ValidateOnlyFieldNumber = 4;
    private bool validateOnly_;
    ///
    /// If true, the request is validated but not executed. Only errors are
    /// returned, not results.
    ///
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public bool ValidateOnly {
      get { return validateOnly_; }
      set {
        validateOnly_ = value;
      }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override bool Equals(object other) {
      return Equals(other as MutateCustomInterestsRequest);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public bool Equals(MutateCustomInterestsRequest other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (CustomerId != other.CustomerId) return false;
      if(!operations_.Equals(other.operations_)) return false;
      if (ValidateOnly != other.ValidateOnly) return false;
      return Equals(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override int GetHashCode() {
      int hash = 1;
      if (CustomerId.Length != 0) hash ^= CustomerId.GetHashCode();
      hash ^= operations_.GetHashCode();
      if (ValidateOnly != false) hash ^= ValidateOnly.GetHashCode();
      if (_unknownFields != null) {
        hash ^= _unknownFields.GetHashCode();
      }
      return hash;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void WriteTo(pb::CodedOutputStream output) {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      output.WriteRawMessage(this);
    #else
      if (CustomerId.Length != 0) {
        output.WriteRawTag(10);
        output.WriteString(CustomerId);
      }
      operations_.WriteTo(output, _repeated_operations_codec);
      if (ValidateOnly != false) {
        output.WriteRawTag(32);
        output.WriteBool(ValidateOnly);
      }
      if (_unknownFields != null) {
        _unknownFields.WriteTo(output);
      }
    #endif
    }

    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
      if (CustomerId.Length != 0) {
        output.WriteRawTag(10);
        output.WriteString(CustomerId);
      }
      operations_.WriteTo(ref output, _repeated_operations_codec);
      if (ValidateOnly != false) {
        output.WriteRawTag(32);
        output.WriteBool(ValidateOnly);
      }
      if (_unknownFields != null) {
        _unknownFields.WriteTo(ref output);
      }
    }
    #endif

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public int CalculateSize() {
      int size = 0;
      if (CustomerId.Length != 0) {
        size += 1 + pb::CodedOutputStream.ComputeStringSize(CustomerId);
      }
      size += operations_.CalculateSize(_repeated_operations_codec);
      if (ValidateOnly != false) {
        size += 1 + 1;
      }
      if (_unknownFields != null) {
        size += _unknownFields.CalculateSize();
      }
      return size;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void MergeFrom(MutateCustomInterestsRequest other) {
      if (other == null) {
        return;
      }
      if (other.CustomerId.Length != 0) {
        CustomerId = other.CustomerId;
      }
      operations_.Add(other.operations_);
      if (other.ValidateOnly != false) {
        ValidateOnly = other.ValidateOnly;
      }
      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void MergeFrom(pb::CodedInputStream input) {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      input.ReadRawMessage(this);
    #else
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
            break;
          case 10: {
            CustomerId = input.ReadString();
            break;
          }
          case 18: {
            operations_.AddEntriesFrom(input, _repeated_operations_codec);
            break;
          }
          case 32: {
            ValidateOnly = input.ReadBool();
            break;
          }
        }
      }
    #endif
    }

    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
            break;
          case 10: {
            CustomerId = input.ReadString();
            break;
          }
          case 18: {
            operations_.AddEntriesFrom(ref input, _repeated_operations_codec);
            break;
          }
          case 32: {
            ValidateOnly = input.ReadBool();
            break;
          }
        }
      }
    }
    #endif

  }

  ///
  /// A single operation (create, update) on a custom interest.
  ///
  public sealed partial class CustomInterestOperation : pb::IMessage<CustomInterestOperation>
  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      , pb::IBufferMessage
  #endif
  {
    private static readonly pb::MessageParser<CustomInterestOperation> _parser = new pb::MessageParser<CustomInterestOperation>(() => new CustomInterestOperation());
    private pb::UnknownFieldSet _unknownFields;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public static pb::MessageParser<CustomInterestOperation> Parser { get { return _parser; } }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public static pbr::MessageDescriptor Descriptor {
      get { return global::Google.Ads.GoogleAds.V10.Services.CustomInterestServiceReflection.Descriptor.MessageTypes[1]; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public CustomInterestOperation() {
      OnConstruction();
    }

    partial void OnConstruction();

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public CustomInterestOperation(CustomInterestOperation other) : this() {
      updateMask_ = other.updateMask_ != null ? other.updateMask_.Clone() : null;
      switch (other.OperationCase) {
        case OperationOneofCase.Create:
          Create = other.Create.Clone();
          break;
        case OperationOneofCase.Update:
          Update = other.Update.Clone();
          break;
      }

      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public CustomInterestOperation Clone() {
      return new CustomInterestOperation(this);
    }

    /// Field number for the "update_mask" field.
    public const int UpdateMaskFieldNumber = 4;
    private global::Google.Protobuf.WellKnownTypes.FieldMask updateMask_;
    ///
    /// FieldMask that determines which resource fields are modified in an update.
    ///
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public global::Google.Protobuf.WellKnownTypes.FieldMask UpdateMask {
      get { return updateMask_; }
      set {
        updateMask_ = value;
      }
    }

    /// Field number for the "create" field.
    public const int CreateFieldNumber = 1;
    ///
    /// Create operation: No resource name is expected for the new custom
    /// interest.
    ///
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public global::Google.Ads.GoogleAds.V10.Resources.CustomInterest Create {
      get { return operationCase_ == OperationOneofCase.Create ? (global::Google.Ads.GoogleAds.V10.Resources.CustomInterest) operation_ : null; }
      set {
        operation_ = value;
        operationCase_ = value == null ? OperationOneofCase.None : OperationOneofCase.Create;
      }
    }

    /// Field number for the "update" field.
    public const int UpdateFieldNumber = 2;
    ///
    /// Update operation: The custom interest is expected to have a valid
    /// resource name.
    ///
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public global::Google.Ads.GoogleAds.V10.Resources.CustomInterest Update {
      get { return operationCase_ == OperationOneofCase.Update ? (global::Google.Ads.GoogleAds.V10.Resources.CustomInterest) operation_ : null; }
      set {
        operation_ = value;
        operationCase_ = value == null ? OperationOneofCase.None : OperationOneofCase.Update;
      }
    }

    private object operation_;
    /// Enum of possible cases for the "operation" oneof.
    public enum OperationOneofCase {
      None = 0,
      Create = 1,
      Update = 2,
    }
    private OperationOneofCase operationCase_ = OperationOneofCase.None;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public OperationOneofCase OperationCase {
      get { return operationCase_; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void ClearOperation() {
      operationCase_ = OperationOneofCase.None;
      operation_ = null;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override bool Equals(object other) {
      return Equals(other as CustomInterestOperation);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public bool Equals(CustomInterestOperation other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(UpdateMask, other.UpdateMask)) return false;
      if (!object.Equals(Create, other.Create)) return false;
      if (!object.Equals(Update, other.Update)) return false;
      if (OperationCase != other.OperationCase) return false;
      return Equals(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override int GetHashCode() {
      int hash = 1;
      if (updateMask_ != null) hash ^= UpdateMask.GetHashCode();
      if (operationCase_ == OperationOneofCase.Create) hash ^= Create.GetHashCode();
      if (operationCase_ == OperationOneofCase.Update) hash ^= Update.GetHashCode();
      hash ^= (int) operationCase_;
      if (_unknownFields != null) {
        hash ^= _unknownFields.GetHashCode();
      }
      return hash;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void WriteTo(pb::CodedOutputStream output) {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      output.WriteRawMessage(this);
    #else
      if (operationCase_ == OperationOneofCase.Create) {
        output.WriteRawTag(10);
        output.WriteMessage(Create);
      }
      if (operationCase_ == OperationOneofCase.Update) {
        output.WriteRawTag(18);
        output.WriteMessage(Update);
      }
      if (updateMask_ != null) {
        output.WriteRawTag(34);
        output.WriteMessage(UpdateMask);
      }
      if (_unknownFields != null) {
        _unknownFields.WriteTo(output);
      }
    #endif
    }

    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
      if (operationCase_ == OperationOneofCase.Create) {
        output.WriteRawTag(10);
        output.WriteMessage(Create);
      }
      if (operationCase_ == OperationOneofCase.Update) {
        output.WriteRawTag(18);
        output.WriteMessage(Update);
      }
      if (updateMask_ != null) {
        output.WriteRawTag(34);
        output.WriteMessage(UpdateMask);
      }
      if (_unknownFields != null) {
        _unknownFields.WriteTo(ref output);
      }
    }
    #endif

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public int CalculateSize() {
      int size = 0;
      if (updateMask_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(UpdateMask);
      }
      if (operationCase_ == OperationOneofCase.Create) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Create);
      }
      if (operationCase_ == OperationOneofCase.Update) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Update);
      }
      if (_unknownFields != null) {
        size += _unknownFields.CalculateSize();
      }
      return size;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void MergeFrom(CustomInterestOperation other) {
      if (other == null) {
        return;
      }
      if (other.updateMask_ != null) {
        if (updateMask_ == null) {
          UpdateMask = new global::Google.Protobuf.WellKnownTypes.FieldMask();
        }
        UpdateMask.MergeFrom(other.UpdateMask);
      }
      switch (other.OperationCase) {
        case OperationOneofCase.Create:
          if (Create == null) {
            Create = new global::Google.Ads.GoogleAds.V10.Resources.CustomInterest();
          }
          Create.MergeFrom(other.Create);
          break;
        case OperationOneofCase.Update:
          if (Update == null) {
            Update = new global::Google.Ads.GoogleAds.V10.Resources.CustomInterest();
          }
          Update.MergeFrom(other.Update);
          break;
      }

      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void MergeFrom(pb::CodedInputStream input) {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      input.ReadRawMessage(this);
    #else
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
            break;
          case 10: {
            global::Google.Ads.GoogleAds.V10.Resources.CustomInterest subBuilder = new global::Google.Ads.GoogleAds.V10.Resources.CustomInterest();
            if (operationCase_ == OperationOneofCase.Create) {
              subBuilder.MergeFrom(Create);
            }
            input.ReadMessage(subBuilder);
            Create = subBuilder;
            break;
          }
          case 18: {
            global::Google.Ads.GoogleAds.V10.Resources.CustomInterest subBuilder = new global::Google.Ads.GoogleAds.V10.Resources.CustomInterest();
            if (operationCase_ == OperationOneofCase.Update) {
              subBuilder.MergeFrom(Update);
            }
            input.ReadMessage(subBuilder);
            Update = subBuilder;
            break;
          }
          case 34: {
            if (updateMask_ == null) {
              UpdateMask = new global::Google.Protobuf.WellKnownTypes.FieldMask();
            }
            input.ReadMessage(UpdateMask);
            break;
          }
        }
      }
    #endif
    }

    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
            break;
          case 10: {
            global::Google.Ads.GoogleAds.V10.Resources.CustomInterest subBuilder = new global::Google.Ads.GoogleAds.V10.Resources.CustomInterest();
            if (operationCase_ == OperationOneofCase.Create) {
              subBuilder.MergeFrom(Create);
            }
            input.ReadMessage(subBuilder);
            Create = subBuilder;
            break;
          }
          case 18: {
            global::Google.Ads.GoogleAds.V10.Resources.CustomInterest subBuilder = new global::Google.Ads.GoogleAds.V10.Resources.CustomInterest();
            if (operationCase_ == OperationOneofCase.Update) {
              subBuilder.MergeFrom(Update);
            }
            input.ReadMessage(subBuilder);
            Update = subBuilder;
            break;
          }
          case 34: {
            if (updateMask_ == null) {
              UpdateMask = new global::Google.Protobuf.WellKnownTypes.FieldMask();
            }
            input.ReadMessage(UpdateMask);
            break;
          }
        }
      }
    }
    #endif

  }

  ///
  /// Response message for custom interest mutate.
  ///
  public sealed partial class MutateCustomInterestsResponse : pb::IMessage<MutateCustomInterestsResponse>
  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      , pb::IBufferMessage
  #endif
  {
    private static readonly pb::MessageParser<MutateCustomInterestsResponse> _parser = new pb::MessageParser<MutateCustomInterestsResponse>(() => new MutateCustomInterestsResponse());
    private pb::UnknownFieldSet _unknownFields;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public static pb::MessageParser<MutateCustomInterestsResponse> Parser { get { return _parser; } }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public static pbr::MessageDescriptor Descriptor {
      get { return global::Google.Ads.GoogleAds.V10.Services.CustomInterestServiceReflection.Descriptor.MessageTypes[2]; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public MutateCustomInterestsResponse() {
      OnConstruction();
    }

    partial void OnConstruction();

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public MutateCustomInterestsResponse(MutateCustomInterestsResponse other) : this() {
      results_ = other.results_.Clone();
      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public MutateCustomInterestsResponse Clone() {
      return new MutateCustomInterestsResponse(this);
    }

    /// Field number for the "results" field.
    public const int ResultsFieldNumber = 2;
    private static readonly pb::FieldCodec<global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestResult> _repeated_results_codec
        = pb::FieldCodec.ForMessage(18, global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestResult.Parser);
    private readonly pbc::RepeatedField<global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestResult> results_ = new pbc::RepeatedField<global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestResult>();
    ///
    /// All results for the mutate.
    ///
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public pbc::RepeatedField<global::Google.Ads.GoogleAds.V10.Services.MutateCustomInterestResult> Results {
      get { return results_; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override bool Equals(object other) {
      return Equals(other as MutateCustomInterestsResponse);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public bool Equals(MutateCustomInterestsResponse other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if(!results_.Equals(other.results_)) return false;
      return Equals(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override int GetHashCode() {
      int hash = 1;
      hash ^= results_.GetHashCode();
      if (_unknownFields != null) {
        hash ^= _unknownFields.GetHashCode();
      }
      return hash;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void WriteTo(pb::CodedOutputStream output) {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      output.WriteRawMessage(this);
    #else
      results_.WriteTo(output, _repeated_results_codec);
      if (_unknownFields != null) {
        _unknownFields.WriteTo(output);
      }
    #endif
    }

    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
      results_.WriteTo(ref output, _repeated_results_codec);
      if (_unknownFields != null) {
        _unknownFields.WriteTo(ref output);
      }
    }
    #endif

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public int CalculateSize() {
      int size = 0;
      size += results_.CalculateSize(_repeated_results_codec);
      if (_unknownFields != null) {
        size += _unknownFields.CalculateSize();
      }
      return size;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void MergeFrom(MutateCustomInterestsResponse other) {
      if (other == null) {
        return;
      }
      results_.Add(other.results_);
      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void MergeFrom(pb::CodedInputStream input) {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      input.ReadRawMessage(this);
    #else
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
            break;
          case 18: {
            results_.AddEntriesFrom(input, _repeated_results_codec);
            break;
          }
        }
      }
    #endif
    }

    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
            break;
          case 18: {
            results_.AddEntriesFrom(ref input, _repeated_results_codec);
            break;
          }
        }
      }
    }
    #endif

  }

  ///
  /// The result for the custom interest mutate.
  ///
  public sealed partial class MutateCustomInterestResult : pb::IMessage<MutateCustomInterestResult>
  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      , pb::IBufferMessage
  #endif
  {
    private static readonly pb::MessageParser<MutateCustomInterestResult> _parser = new pb::MessageParser<MutateCustomInterestResult>(() => new MutateCustomInterestResult());
    private pb::UnknownFieldSet _unknownFields;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public static pb::MessageParser<MutateCustomInterestResult> Parser { get { return _parser; } }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public static pbr::MessageDescriptor Descriptor {
      get { return global::Google.Ads.GoogleAds.V10.Services.CustomInterestServiceReflection.Descriptor.MessageTypes[3]; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public MutateCustomInterestResult() {
      OnConstruction();
    }

    partial void OnConstruction();

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public MutateCustomInterestResult(MutateCustomInterestResult other) : this() {
      resourceName_ = other.resourceName_;
      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public MutateCustomInterestResult Clone() {
      return new MutateCustomInterestResult(this);
    }

    /// Field number for the "resource_name" field.
    public const int ResourceNameFieldNumber = 1;
    private string resourceName_ = "";
    ///
    /// Returned for successful operations.
    ///
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public string ResourceName {
      get { return resourceName_; }
      set {
        resourceName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
      }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override bool Equals(object other) {
      return Equals(other as MutateCustomInterestResult);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public bool Equals(MutateCustomInterestResult other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (ResourceName != other.ResourceName) return false;
      return Equals(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override int GetHashCode() {
      int hash = 1;
      if (ResourceName.Length != 0) hash ^= ResourceName.GetHashCode();
      if (_unknownFields != null) {
        hash ^= _unknownFields.GetHashCode();
      }
      return hash;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void WriteTo(pb::CodedOutputStream output) {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      output.WriteRawMessage(this);
    #else
      if (ResourceName.Length != 0) {
        output.WriteRawTag(10);
        output.WriteString(ResourceName);
      }
      if (_unknownFields != null) {
        _unknownFields.WriteTo(output);
      }
    #endif
    }

    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
      if (ResourceName.Length != 0) {
        output.WriteRawTag(10);
        output.WriteString(ResourceName);
      }
      if (_unknownFields != null) {
        _unknownFields.WriteTo(ref output);
      }
    }
    #endif

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public int CalculateSize() {
      int size = 0;
      if (ResourceName.Length != 0) {
        size += 1 + pb::CodedOutputStream.ComputeStringSize(ResourceName);
      }
      if (_unknownFields != null) {
        size += _unknownFields.CalculateSize();
      }
      return size;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void MergeFrom(MutateCustomInterestResult other) {
      if (other == null) {
        return;
      }
      if (other.ResourceName.Length != 0) {
        ResourceName = other.ResourceName;
      }
      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    public void MergeFrom(pb::CodedInputStream input) {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
      input.ReadRawMessage(this);
    #else
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
            break;
          case 10: {
            ResourceName = input.ReadString();
            break;
          }
        }
      }
    #endif
    }

    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
            break;
          case 10: {
            ResourceName = input.ReadString();
            break;
          }
        }
      }
    }
    #endif

  }

  #endregion

}

#endregion Designer generated code


text:
'use strict';

let config = require('./protractor.shared.conf.js').config;

const desktopSpecs = ['../desktop.spec.js'];
const mobileSpecs = ['../mobile.spec.js'];

config.sauceUser = process.env.SAUCE_USERNAME;
config.sauceKey = process.env.SAUCE_ACCESS_KEY;
config.sauceBuild = process.env.TRAVIS_JOB_NUMBER;

config.devicePixelRatio = {
    'chrome': 1,
    'firefox': 1,
    'internetExplorer': 1,
    'microsoftEdge': 1,
    'safari': 1
};

config.multiCapabilities = [
    {
        name: 'iPhone',
        appiumVersion: '1.6.3',
        browserName: 'Safari',
        deviceName: 'iPhone 6 Simulator',
        deviceOrientation: 'portrait',
        platformName: 'iOS',
        platformVersion: '10.0',
        logName: 'iPhone 6 Simulator Safari',
        'tunnel-identifier': config.sauceBuild,
        shardTestFiles: true,
        specs: mobileSpecs
    },
    {
        name: 'iPad',
        appiumVersion: '1.6.3',
        browserName: 'Safari',
        deviceName: 'iPad Air 2 Simulator',
        deviceOrientation: 'portrait',
        platformName: 'iOS',
        platformVersion: '10.0',
        logName: 'iPad Air 2 Simulator Safari',
        'tunnel-identifier': config.sauceBuild,
        shardTestFiles: true,
        specs: mobileSpecs
    },
    {
        name: 'Chrome',
        browserName: 'chrome',
        platform: 'Windows 10',
        version: 'latest',
        logName: 'Chrome ',
        screenResolution: '1400x1050',
        'tunnel-identifier': config.sauceBuild,
        shardTestFiles: true,
        specs: desktopSpecs
    },
//    {
//        name: 'Firefox',
//        browserName: 'firefox',
//        platform: 'Windows 10',
//        version: 'latest',
//        logName: 'Firefox ',
//        screenResolution: '1400x1050',
//        'tunnel-identifier': config.sauceBuild,
//        shardTestFiles: true,
//        specs: desktopSpecs
//    },
    {
        name: 'Internet Explorer',
        browserName: 'internet explorer',
        platform: 'Windows 8.1',
        version: '11.0',
        logName: 'IE ',
        screenResolution: '1400x1050',
        'tunnel-identifier': config.sauceBuild,
        shardTestFiles: true,
        specs: desktopSpecs
    },
    {
        name: 'Microsoft Edge',
        browserName: 'MicrosoftEdge',
        platform: 'Windows 10',
        version: 'latest',
        logName: 'Microsoft Edge ',
        screenResolution: '1400x1050',
        'tunnel-identifier': config.sauceBuild,
        shardTestFiles: true,
        specs: desktopSpecs
    },
    {
        name: 'Safari',
        browserName: 'safari',
        platform: 'OS X 10.11',
        version: '9',
        logName: 'Safari #1 ',
        screenResolution: '1600x1200',
        'tunnel-identifier': config.sauceBuild,
        shardTestFiles: true,
        specs: desktopSpecs
    },
    {
        name: 'Safari',
        browserName: 'safari',
        platform: 'OS X 10.11',
        version: '10',
        logName: 'Safari #2 ',
        screenResolution: '1600x1200',
        'tunnel-identifier': config.sauceBuild,
        shardTestFiles: true,
        specs: desktopSpecs
    }
];

exports.config = config;


text:
`dsub` can make it easy to run multiple tasks in parallel.
Often you want to split an existing data file into multiple shards
and then process each of those shards in parallel.

This example provides a simple illustration of that process.
The [demo_split_process.sh](demo_split_process.sh) script will:

* run a dsub job on a simple text file, splitting it into shards
  * each shard is written as  `--output`
* run a script on each of the shards (as `--input`) in parallel

As written, the example will run locally on your machine
(as you would when putting together a pipeline). It can also
run on Google Cloud with minimal change (delete the --provider line).

## Setup

* Follow the [dsub geting started](../../README.md#getting-started)
instructions.

Since this script uses the `local` backend provider, you will need
to be sure to install `docker`.

## Running the example

Usage:
```
./demo_split_process.sh <inputfile> <local_path_or_gcs_path>
```

### Send output to a local path

```
WORKSPACE=/tmp/split_process
./demo_split_process.sh input.txt "${WORKSPACE}"
ls "${WORKSPACE}/output/"
rm "${WORKSPACE}/temp/*"
```

### Send output to Google Cloud Storage

```
WORKSPACE=gs://mybucket/someprefix
./demo_split_process.sh input.txt "${WORKSPACE}"
gsutil ls "${WORKSPACE}/output/"
gsutil rm "${WORKSPACE}/temp/*"
```


text:
package org.springframework.web.method.annotation;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.bind.support.SessionAttributeStore;
import org.springframework.web.bind.support.SessionStatus;
import org.springframework.web.context.request.WebRequest;

/**
 * Manages controller-specific session attributes declared via
 * {@link SessionAttributes @SessionAttributes}. Actual storage is
 * delegated to a {@link SessionAttributeStore} instance.
 *
 *
When a controller annotated with {@code @SessionAttributes} adds
 * attributes to its model, those attributes are checked against names and
 * types specified via {@code @SessionAttributes}. Matching model attributes
 * are saved in the HTTP session and remain there until the controller calls
 * {@link SessionStatus#setComplete()}.
 *
 * @author Rossen Stoyanchev
 * @since 3.1
 */
public class SessionAttributesHandler {

	private final Set<String> attributeNames = new HashSet<String>();

	private final Set<Class<?>> attributeTypes = new HashSet<Class<?>>();

	private final Set<String> knownAttributeNames =
			Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(4));

	private final SessionAttributeStore sessionAttributeStore;

	/**
	 * Create a new instance for a controller type. Session attribute names and
	 * types are extracted from the {@code @SessionAttributes} annotation, if
	 * present, on the given type.
	 * @param handlerType the controller type
	 * @param sessionAttributeStore used for session access
	 */
	public SessionAttributesHandler(Class<?> handlerType, SessionAttributeStore sessionAttributeStore) {
		Assert.notNull(sessionAttributeStore, "SessionAttributeStore may not be null.");
		this.sessionAttributeStore = sessionAttributeStore;

		SessionAttributes annotation = AnnotationUtils.findAnnotation(handlerType, SessionAttributes.class);
		if (annotation != null) {
			this.attributeNames.addAll(Arrays.asList(annotation.value()));
			this.attributeTypes.addAll(Arrays.<Class<?>>asList(annotation.types()));
		}

		for (String attributeName : this.attributeNames) {
			this.knownAttributeNames.add(attributeName);
		}
	}

	/**
	 * Whether the controller represented by this instance has declared any
	 * session attributes through an {@link SessionAttributes} annotation.
	 */
	public boolean hasSessionAttributes() {
		return ((this.attributeNames.size() > 0) || (this.attributeTypes.size() > 0));
	}

	/**
	 * Whether the attribute name or type match the names and types specified
	 * via {@code @SessionAttributes} in underlying controller.
	 *
	 *
Attributes successfully resolved through this method are "remembered"
	 * and subsequently used in {@link #retrieveAttributes(WebRequest)} and
	 * {@link #cleanupAttributes(WebRequest)}.
	 *
	 * @param attributeName the attribute name to check, never {@code null}
	 * @param attributeType the type for the attribute, possibly {@code null}
	 */
	public boolean isHandlerSessionAttribute(String attributeName, Class<?> attributeType) {
		Assert.notNull(attributeName, "Attribute name must not be null");
		if (this.attributeNames.contains(attributeName) || this.attributeTypes.contains(attributeType)) {
			this.knownAttributeNames.add(attributeName);
			return true;
		}
		else {
			return false;
		}
	}

	/**
	 * Store a subset of the given attributes in the session. Attributes not
	 * declared as session attributes via {@code @SessionAttributes} are ignored.
	 * @param request the current request
	 * @param attributes candidate attributes for session storage
	 */
	public void storeAttributes(WebRequest request, Map<String, ?> attributes) {
		for (String name : attributes.keySet()) {
			Object value = attributes.get(name);
			Class<?> attrType = (value != null) ? value.getClass() : null;

			if (isHandlerSessionAttribute(name, attrType)) {
				this.sessionAttributeStore.storeAttribute(request, name, value);
			}
		}
	}

	/**
	 * Retrieve "known" attributes from the session, i.e. attributes listed
	 * by name in {@code @SessionAttributes} or attributes previously stored
	 * in the model that matched by type.
	 * @param request the current request
	 * @return a map with handler session attributes, possibly empty
	 */
	public Map<String, Object> retrieveAttributes(WebRequest request) {
		Map<String, Object> attributes = new HashMap<String, Object>();
		for (String name : this.knownAttributeNames) {
			Object value = this.sessionAttributeStore.retrieveAttribute(request, name);
			if (value != null) {
				attributes.put(name, value);
			}
		}
		return attributes;
	}

	/**
	 * Remove "known" attributes from the session, i.e. attributes listed
	 * by name in {@code @SessionAttributes} or attributes previously stored
	 * in the model that matched by type.
	 * @param request the current request
	 */
	public void cleanupAttributes(WebRequest request) {
		for (String attributeName : this.knownAttributeNames) {
			this.sessionAttributeStore.cleanupAttribute(request, attributeName);
		}
	}

	/**
	 * A pass-through call to the underlying {@link SessionAttributeStore}.
	 * @param request the current request
	 * @param attributeName the name of the attribute of interest
	 * @return the attribute value or {@code null}
	 */
	Object retrieveAttribute(WebRequest request, String attributeName) {
		return this.sessionAttributeStore.retrieveAttribute(request, attributeName);
	}

}


text:
\hypertarget{classcpp__redis_1_1logger__iface}{}\section{cpp\+\_\+redis\+:\+:logger\+\_\+iface Class Reference}
\label{classcpp__redis_1_1logger__iface}\index{cpp\+\_\+redis\+::logger\+\_\+iface@{cpp\+\_\+redis\+::logger\+\_\+iface}}

{\ttfamily \#include $<$logger.\+hpp$>$}

Inheritance diagram for cpp\+\_\+redis\+:\+:logger\+\_\+iface\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classcpp__redis_1_1logger__iface}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classcpp__redis_1_1logger__iface_a902e41bf0777b960b6575e7ac986147b}\label{classcpp__redis_1_1logger__iface_a902e41bf0777b960b6575e7ac986147b}}
\hyperlink{classcpp__redis_1_1logger__iface_a902e41bf0777b960b6575e7ac986147b}{logger\+\_\+iface} (void)=default
\begin{DoxyCompactList}\small\item\em ctor \end{DoxyCompactList}\item
\mbox{\Hypertarget{classcpp__redis_1_1logger__iface_ac7ed1b828afd2e6589fcdda167d34aa5}\label{classcpp__redis_1_1logger__iface_ac7ed1b828afd2e6589fcdda167d34aa5}}
virtual \hyperlink{classcpp__redis_1_1logger__iface_ac7ed1b828afd2e6589fcdda167d34aa5}{$\sim$logger\+\_\+iface} (void)=default
\begin{DoxyCompactList}\small\item\em dtor \end{DoxyCompactList}\item
\mbox{\Hypertarget{classcpp__redis_1_1logger__iface_a7f1cb271b18e40f2dde7e45028e69a84}\label{classcpp__redis_1_1logger__iface_a7f1cb271b18e40f2dde7e45028e69a84}}
\hyperlink{classcpp__redis_1_1logger__iface_a7f1cb271b18e40f2dde7e45028e69a84}{logger\+\_\+iface} (const \hyperlink{classcpp__redis_1_1logger__iface}{logger\+\_\+iface} \&)=default
\begin{DoxyCompactList}\small\item\em copy ctor \end{DoxyCompactList}\item
\mbox{\Hypertarget{classcpp__redis_1_1logger__iface_a04324701cb81ba6a23f73025b0b3eee0}\label{classcpp__redis_1_1logger__iface_a04324701cb81ba6a23f73025b0b3eee0}}
\hyperlink{classcpp__redis_1_1logger__iface}{logger\+\_\+iface} \& \hyperlink{classcpp__redis_1_1logger__iface_a04324701cb81ba6a23f73025b0b3eee0}{operator=} (const \hyperlink{classcpp__redis_1_1logger__iface}{logger\+\_\+iface} \&)=default
\begin{DoxyCompactList}\small\item\em assignment operator \end{DoxyCompactList}\item
virtual void \hyperlink{classcpp__redis_1_1logger__iface_aaace9e12cbb32d7bdd76c17180a30de7}{debug} (const std\+::string \&msg, const std\+::string \&file, std\+::size\+\_\+t line)=0
\item
virtual void \hyperlink{classcpp__redis_1_1logger__iface_a02e62f55d7da56efa3b47f2b05931b3b}{info} (const std\+::string \&msg, const std\+::string \&file, std\+::size\+\_\+t line)=0
\item
virtual void \hyperlink{classcpp__redis_1_1logger__iface_a0ea8e43a4f2118e77af56cd1cdb21cba}{warn} (const std\+::string \&msg, const std\+::string \&file, std\+::size\+\_\+t line)=0
\item
virtual void \hyperlink{classcpp__redis_1_1logger__iface_ac8353031252c80e69e35f5f131870ddf}{error} (const std\+::string \&msg, const std\+::string \&file, std\+::size\+\_\+t line)=0
\end{DoxyCompactItemize}

\subsection{Detailed Description}
\hyperlink{classcpp__redis_1_1logger__iface}{logger\+\_\+iface} should be inherited by any class intended to be used for logging

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classcpp__redis_1_1logger__iface_aaace9e12cbb32d7bdd76c17180a30de7}\label{classcpp__redis_1_1logger__iface_aaace9e12cbb32d7bdd76c17180a30de7}}
\index{cpp\+\_\+redis\+::logger\+\_\+iface@{cpp\+\_\+redis\+::logger\+\_\+iface}!debug@{debug}}
\index{debug@{debug}!cpp\+\_\+redis\+::logger\+\_\+iface@{cpp\+\_\+redis\+::logger\+\_\+iface}}
\subsubsection{\texorpdfstring{debug()}{debug()}}
{\footnotesize\ttfamily virtual void cpp\+\_\+redis\+::logger\+\_\+iface\+::debug (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{msg,  }\item[{const std\+::string \&}]{file,  }\item[{std\+::size\+\_\+t}]{line }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

debug logging

\begin{DoxyParams}{Parameters}
{\em msg} & message to be logged \\
\hline
{\em file} & file from which the message is coming \\
\hline
{\em line} & line in the file of the message \\
\hline
\end{DoxyParams}

Implemented in \hyperlink{classcpp__redis_1_1logger_a36e0908e7b05850b663a4b8b9cdbc299}{cpp\+\_\+redis\+::logger}.

\mbox{\Hypertarget{classcpp__redis_1_1logger__iface_ac8353031252c80e69e35f5f131870ddf}\label{classcpp__redis_1_1logger__iface_ac8353031252c80e69e35f5f131870ddf}}
\index{cpp\+\_\+redis\+::logger\+\_\+iface@{cpp\+\_\+redis\+::logger\+\_\+iface}!error@{error}}
\index{error@{error}!cpp\+\_\+redis\+::logger\+\_\+iface@{cpp\+\_\+redis\+::logger\+\_\+iface}}
\subsubsection{\texorpdfstring{error()}{error()}}
{\footnotesize\ttfamily virtual void cpp\+\_\+redis\+::logger\+\_\+iface\+::error (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{msg,  }\item[{const std\+::string \&}]{file,  }\item[{std\+::size\+\_\+t}]{line }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

error logging

\begin{DoxyParams}{Parameters}
{\em msg} & message to be logged \\
\hline
{\em file} & file from which the message is coming \\
\hline
{\em line} & line in the file of the message \\
\hline
\end{DoxyParams}

Implemented in \hyperlink{classcpp__redis_1_1logger_aaf7f2837511f4414a4d7b7b923ebc15e}{cpp\+\_\+redis\+::logger}.

\mbox{\Hypertarget{classcpp__redis_1_1logger__iface_a02e62f55d7da56efa3b47f2b05931b3b}\label{classcpp__redis_1_1logger__iface_a02e62f55d7da56efa3b47f2b05931b3b}}
\index{cpp\+\_\+redis\+::logger\+\_\+iface@{cpp\+\_\+redis\+::logger\+\_\+iface}!info@{info}}
\index{info@{info}!cpp\+\_\+redis\+::logger\+\_\+iface@{cpp\+\_\+redis\+::logger\+\_\+iface}}
\subsubsection{\texorpdfstring{info()}{info()}}
{\footnotesize\ttfamily virtual void cpp\+\_\+redis\+::logger\+\_\+iface\+::info (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{msg,  }\item[{const std\+::string \&}]{file,  }\item[{std\+::size\+\_\+t}]{line }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

info logging

\begin{DoxyParams}{Parameters}
{\em msg} & message to be logged \\
\hline
{\em file} & file from which the message is coming \\
\hline
{\em line} & line in the file of the message \\
\hline
\end{DoxyParams}

Implemented in \hyperlink{classcpp__redis_1_1logger_a04c741b5110946e76bb23728da6fb2ac}{cpp\+\_\+redis\+::logger}.

\mbox{\Hypertarget{classcpp__redis_1_1logger__iface_a0ea8e43a4f2118e77af56cd1cdb21cba}\label{classcpp__redis_1_1logger__iface_a0ea8e43a4f2118e77af56cd1cdb21cba}}
\index{cpp\+\_\+redis\+::logger\+\_\+iface@{cpp\+\_\+redis\+::logger\+\_\+iface}!warn@{warn}}
\index{warn@{warn}!cpp\+\_\+redis\+::logger\+\_\+iface@{cpp\+\_\+redis\+::logger\+\_\+iface}}
\subsubsection{\texorpdfstring{warn()}{warn()}}
{\footnotesize\ttfamily virtual void cpp\+\_\+redis\+::logger\+\_\+iface\+::warn (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{msg,  }\item[{const std\+::string \&}]{file,  }\item[{std\+::size\+\_\+t}]{line }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

warn logging

\begin{DoxyParams}{Parameters}
{\em msg} & message to be logged \\
\hline
{\em file} & file from which the message is coming \\
\hline
{\em line} & line in the file of the message \\
\hline
\end{DoxyParams}

Implemented in \hyperlink{classcpp__redis_1_1logger_ae9359429428786c7b5605a1109508ae5}{cpp\+\_\+redis\+::logger}.

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
includes/cpp\+\_\+redis/misc/logger.\+hpp\end{DoxyCompactItemize}