text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="igorw_file_serve.response_factory.php.class">Igorw\FileServeBundle\Response\PhpResponseFactory</parameter>
        <parameter key="igorw_file_serve.response_factory.sendfile.class">Igorw\FileServeBundle\Response\SendfileResponseFactory</parameter>
        <parameter key="igorw_file_serve.response_factory.xsendfile.class">Igorw\FileServeBundle\Response\XsendfileResponseFactory</parameter>
    </parameters>

    <services>
        <service id="igorw_file_serve.response_factory.php" class="%igorw_file_serve.response_factory.php.class%" public="false" scope="request">
            <argument>%igorw_file_serve.base_dir%</argument>
            <argument type="service" id="request" />
            <argument>%igorw_file_serve.skip_file_exists%</argument>
        </service>
        <service id="igorw_file_serve.response_factory.sendfile" class="%igorw_file_serve.response_factory.sendfile.class%" public="false" scope="request">
            <argument>%igorw_file_serve.base_dir%</argument>
            <argument type="service" id="request" />
            <argument>%igorw_file_serve.skip_file_exists%</argument>
        </service>
        <service id="igorw_file_serve.response_factory.xsendfile" class="%igorw_file_serve.response_factory.xsendfile.class%" public="false" scope="request">
            <argument>%igorw_file_serve.base_dir%</argument>
            <argument type="service" id="request" />
            <argument>%igorw_file_serve.skip_file_exists%</argument>
        </service>
    </services>
</container>


text:
require File.expand_path("../lib/estraier_admin", File.dirname(__FILE__))

describe EstraierAdmin do
  before do
    @admin = EstraierAdmin.new(:user=>"hoge",:password=>"foo")
  end

  it "@config[:user] should == 'hoge'" do
    @admin.instance_eval{@config}[:user].should == 'hoge'
  end

  it "@config[:password] should == 'foo'" do
    @admin.instance_eval{@config}[:password].should == 'foo'
  end

  it "should receive :request_or_raise, with {:name=>'piyo', :label=>'piyo', :action=>8} when create_node()" do
    @admin.should_receive(:request_or_raise).with(:name=>'piyo', :label=>'piyo', :action=>8)
    @admin.create_node('piyo')
  end

  it "should receive :request_or_raise, with {:name=>'piyo', :action=>9, :sure=>1} when delete_node()" do
    @admin.should_receive(:request_or_raise).with(:name=>'piyo', :action=>9, :sure=>1)
    @admin.delete_node('piyo')
  end
end

redpajama_set_name: RedPajamaGithub


text:
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { fetchWeather } from '../actions/index';

class SearchBar extends Component {
  constructor(props) {
    super(props);

    this.state = { term: '' };

    //whenever there is a callback from a dom element
    //bind this of functions to point to 'this' in the correct context
    this.onInputChange = this.onInputChange.bind(this);

    this.onFormSubmit = this.onFormSubmit.bind(this);
  }

  onInputChange(event) {
    this.setState({term: event.target.value});
  }

  onFormSubmit(event) {
    event.preventDefault();

    this.props.fetchWeather(this.state.term);

    this.setState({ term: '' });
  }

  render() {
    return (
      <form onSubmit={this.onFormSubmit} className="input-group">
        <input
          placeholder="Get a 5-day weather forecast in your favorite city"
          className="form-control"
          onChange={this.onInputChange}
          value={this.state.term}
        />
        <span className="input-group-btn">
          <button type="submit" className="btn btn-secondary">Submit</button>
        </span>
      </form>
    );
  }
}

function mapDispatchToProps(dispatch) {
  return bindActionCreators({ fetchWeather }, dispatch);
}

export default connect(null, mapDispatchToProps)(SearchBar);


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends MY_Controller {

    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     * 		http://example.com/index.php/welcome
     * 	- or -
     * 		http://example.com/index.php/welcome/index
     * 	- or -
     * Since this controller is set as the default controller in
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /index.php/welcome/<method_name>
     * @see https://codeigniter.com/user_guide/general/urls.html
     */
    function __construct() {
        parent::__construct();
        $this->load->model('Timetable');
        //$this->load->view('homepage');

    }

    function index() {

        $this->load->helper('directory');
        $this->data['pagebody'] = 'homepage';

        // Build a list of orders

        $candidates = directory_map(DATAPATH);
        sort($candidates);
        foreach ($candidates as $file) {
            if (substr_compare($file, XMLSUFFIX, strlen($file) - strlen(XMLSUFFIX), strlen(XMLSUFFIX)) === 0)
            //exclude our menu
                if ($file != 'Master.xml')
                //trim the suffix
                    $orders[] = array('filename' => substr($file, 0, -4));
        }
        $this->data['orders'] = $orders;
        // Present the list to choose from

        //homepage validation
        $doc = new DOMDocument();
        $doc->load('./data/Timetable.xml');
        //$doc->schemaValidate('./data/Master.xsd');
        $result = '';
        libxml_use_internal_errors(true);
        if ($doc->schemaValidate('./data/Master.xsd'))
        {

           $result = "Validated against schema successfully";
        }

        else {
            $result = "Oh nooooo...
";
            foreach (libxml_get_errors() as $error) {
                $result .= $error->message . '
';
            }
        }
        //Show the result
        $this->data['message'] = $result;
        libxml_clear_errors();
        $this->render();

    }

    //-------------------------------------------------------------
    //  Show the "receipt" for a specific order
    //-------------------------------------------------------------

    function order($filename) {
        // Build a receipt for the chosen order
        $timetable = new Timetable($filename);
        $this->data['filename'] = $filename;
        $this->data['perspective'] = $timetable->getWeekday("Monday");
        //$this->data['perspective'] = $timetable->getSomething("2");

        $this->data['pagebody'] = 'justone';
        $this->render();
    }

}


text:
from .stdio import StdIO
from .slack import Slack
from .mastodon import Mastodon


text:
namespace syncer {

SyncCoreProxyImpl::SyncCoreProxyImpl(
    scoped_refptr<base::SequencedTaskRunner> sync_task_runner,
    base::WeakPtr<SyncCore> sync_core)
    : sync_task_runner_(sync_task_runner),
      sync_core_(sync_core) {}

SyncCoreProxyImpl::~SyncCoreProxyImpl() {}

void SyncCoreProxyImpl::ConnectTypeToCore(
    ModelType type,
    const DataTypeState& data_type_state,
    base::WeakPtr<NonBlockingTypeProcessor> type_processor) {
  VLOG(1) << "ConnectTypeToCore: " << ModelTypeToString(type);
  sync_task_runner_->PostTask(FROM_HERE,
                              base::Bind(&SyncCore::ConnectSyncTypeToCore,
                                         sync_core_,
                                         type,
                                         data_type_state,
                                         base::MessageLoopProxy::current(),
                                         type_processor));
}

void SyncCoreProxyImpl::Disconnect(ModelType type) {
  sync_task_runner_->PostTask(
      FROM_HERE, base::Bind(&SyncCore::Disconnect, sync_core_, type));
}

scoped_ptr<SyncCoreProxy> SyncCoreProxyImpl::Clone() const {
  return scoped_ptr<SyncCoreProxy>(
      new SyncCoreProxyImpl(sync_task_runner_, sync_core_));
}

}  // namespace syncer


text:
import datetime
import json
import logging
import socket

import pika

from db.db import session
from db.models import Metric, WeatherStation, MetricType

LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) '
              '-35s %(lineno) -5d: %(message)s')
LOGGER = logging.getLogger(__name__)

class ServerManager(object):
    def __init__(self, cfg):
        """Create a new instance of the consumer class, passing in the AMQP
        URL used to connect to RabbitMQ.
        """
        self._connection = None
        self._channel = None
        self._closing = False
        self._consumer_tag = None
        self._username = str(cfg['username'])
        self._password = str(cfg['password'])
        self._broker = str(cfg['broker'])
        self._port = cfg['port']
        self._exchange = str(cfg['exchange'])
        self._exchange_type = str(cfg['exchangeType'])
        self._queue = str(cfg['queue']) % socket.gethostname()
        self._routing_key = str(cfg['routingKey'])

    def connect(self):
        LOGGER.info('Connecting to %s', self._broker)
        #creds = pika.PlainCredentials(self._username, self._password)
        conn_params = pika.ConnectionParameters(self._broker, self._port, '/')
        return pika.SelectConnection(conn_params,
                                     self.on_connection_open,
                                     stop_ioloop_on_close=False)

    def on_connection_open(self, unused_connection):
        LOGGER.info('Connection opened')
        self.add_on_connection_close_callback()
        self.open_channel()

    def add_on_connection_close_callback(self):
        LOGGER.info('Adding connection close callback')
        self._connection.add_on_close_callback(self.on_connection_closed)

    def on_connection_closed(self, connection, reply_code, reply_text):
        self._channel = None
        if self._closing:
            self._connection.ioloop.stop()
        else:
            LOGGER.warning('Connection closed, reopening in 5 seconds: (%s) %s',
                           reply_code, reply_text)
            self._connection.add_timeout(5, self.reconnect)

    def reconnect(self):
        # This is the old connection IOLoop instance, stop its ioloop
        self._connection.ioloop.stop()

        if not self._closing:

            # Create a new connection
            self._connection = self.connect()

            # There is now a new connection, needs a new ioloop to run
            self._connection.ioloop.start()

    def open_channel(self):
        LOGGER.info('Creating a new channel')
        self._connection.channel(on_open_callback=self.on_channel_open)

    def on_channel_open(self, channel):
        LOGGER.info('Channel opened')
        self._channel = channel
        self.add_on_channel_close_callback()
        self.setup_exchange(self._exchange)

    def add_on_channel_close_callback(self):
        LOGGER.info('Adding channel close callback')
        self._channel.add_on_close_callback(self.on_channel_closed)

    def on_channel_closed(self, channel, reply_code, reply_text):
        LOGGER.warning('Channel %i was closed: (%s) %s',
                       channel, reply_code, reply_text)
        self._connection.close()

    def setup_exchange(self, exchange_name):
        LOGGER.info('Declaring exchange %s', exchange_name)
        self._channel.exchange_declare(self.on_exchange_declareok,
                                       exchange_name,
                                       self._exchange_type)

    def on_exchange_declareok(self, unused_frame):
        LOGGER.info('Exchange declared')
        self.setup_queue(self._queue)

    def setup_queue(self, queue_name):
        LOGGER.info('Declaring queue %s', queue_name)
        self._channel.queue_declare(self.on_queue_declareok, queue_name)

    def on_queue_declareok(self, method_frame):
        LOGGER.info('Binding %s to %s with %s',
                    self._exchange, self._queue, self._routing_key)
        self._channel.queue_bind(self.on_bindok, self._queue,
                                 self._exchange, self._routing_key)

    def on_bindok(self, unused_frame):
        LOGGER.info('Queue bound')
        self.start_consuming()

    def start_consuming(self):
        LOGGER.info('Issuing consumer related RPC commands')
        self.add_on_cancel_callback()
        self._consumer_tag = self._channel.basic_consume(self.on_message,
                                                         self._queue)

    def add_on_cancel_callback(self):
        LOGGER.info('Adding consumer cancellation callback')
        self._channel.add_on_cancel_callback(self.on_consumer_cancelled)

    def on_consumer_cancelled(self, method_frame):
        LOGGER.info('Consumer was cancelled remotely, shutting down: %r',
                    method_frame)
        if self._channel:
            self._channel.close()

    def on_message(self, unused_channel, basic_deliver, properties, body):
        LOGGER.info('Received message # %s from %s: %s',
                    basic_deliver.delivery_tag, properties.app_id, body)

        try:
            msg_dict = json.loads(body)
            action = msg_dict['action']
            data = msg_dict['data']

            if action == 'add_metric':
                metric_type = session.query(MetricType).filter_by(
                    id=data['metric_type_id']).first()

                station = session.query(WeatherStation).filter_by(
                    id=data['weather_station_id']).first()

                metric = Metric(id=data['id'], value=data['value'],
                                metric_type=metric_type,
                                weather_station=station, is_sent=1,
                                timestamp=datetime.datetime.fromtimestamp(
                                    data['timestamp']))

                session.begin()
                session.merge(metric)
                session.commit()
            elif action == 'add_station':
                types = session.query(MetricType).filter(
                    MetricType.id.in_(data['metric_types'])).all()

                station = WeatherStation(id=data['id'], name=data['name'],
                                         latitude=data['latitude'],
                                         longitude=data['longitude'],
                                         metric_types=types, is_sent=1)

                session.begin()
                session.merge(station)
                session.commit()
        except Exception as e:
            LOGGER.error('Error %s when processing message.', str(e))

        self.acknowledge_message(basic_deliver.delivery_tag)

    def acknowledge_message(self, delivery_tag):
        LOGGER.info('Acknowledging message %s', delivery_tag)
        self._channel.basic_ack(delivery_tag)

    def stop_consuming(self):
        if self._channel:
            LOGGER.info('Sending a Basic.Cancel RPC command to RabbitMQ')
            self._channel.basic_cancel(self.on_cancelok, self._consumer_tag)

    def on_cancelok(self, unused_frame):
        LOGGER.info('RabbitMQ acknowledged the cancellation of the consumer')
        self.close_channel()

    def close_channel(self):
        LOGGER.info('Closing the channel')
        self._channel.close()

    def run(self):
        self._connection = self.connect()
        self._connection.ioloop.start()

    def stop(self):
        LOGGER.info('Stopping')
        self._closing = True
        self.stop_consuming()
        self._connection.ioloop.start()
        LOGGER.info('Stopped')

    def close_connection(self):
        """This method closes the connection to RabbitMQ."""
        LOGGER.info('Closing connection')
        self._connection.close()

def main():
    logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)

    cfg = json.load(open("config.json"))

    manager = ServerManager(cfg)
    try:
        manager.run()
    except KeyboardInterrupt:
        manager.stop()

if __name__ == '__main__':
    main()


text:
using System.Collections.Generic;

namespace SqlComparer.Model
{
    public class ComparisonResult
    {
        public ComparedEntity LeftEntity { get; set; }
        public ComparedEntity RightEntity { get; set; }

        public CompareOptions CompareOptions { get; set; }

        public ComparisonOutcome Outcome { get; set; }

        public Dictionary<int, string> LeftSourceTreeByLine = new Dictionary<int, string>();
        public Dictionary<int, string> RightSourceTreeByLine = new Dictionary<int, string>();

        public HashSet<int> LinesDifferingInLeftEntity { get; set; } = new HashSet<int>();
        public HashSet<int> LinesDifferingInRightEntity { get; set; } = new HashSet<int>();
    }
}


text:
package com.digero.common.midi;

import javax.sound.midi.Receiver;
import javax.sound.midi.Transmitter;

public interface Transceiver extends Transmitter, Receiver
{

}


text:
title: Telerik.Web.UI.Barcode.ECIBase
page_title: Telerik.Web.UI.Barcode.ECIBase
description: Telerik.Web.UI.Barcode.ECIBase
---

# Telerik.Web.UI.Barcode.ECIBase

ECI (Extended Channel Interpretations) base class

## Inheritance Hierarchy

* System.Object
* Telerik.Web.UI.Barcode.ECIBase

## Properties

###  EncodedValues `List`1`

Gets or sets the EncodedValues.

###  UnicodeValues `List`1`

Gets or sets the UnicodeValues.


text:
title:
published: true
board_chair: false
last_name:
image_path:
position:
description:
---


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package creation;

import java.util.Random;

/**
 *
 * @author cibikle
 */
public class Die {

    private final int sizeOfDie;
    private final Random r;

    public Die(int sizeOfDie) {
        this.sizeOfDie = sizeOfDie;
        r = new Random();
    }

    public int getSizeOfDie() {
        return sizeOfDie;
    }

    public int getMin() {
        return 1;
    }

    public int getMin(int addend) {
        return 1 + addend;
    }

    public int getMax() {
        return sizeOfDie;
    }

    public int getMax(int addend) {
        return sizeOfDie + addend;
    }

    public double getAvg() {
        return (sizeOfDie + 1) / 2;
    }

    public double getAvg(int addend) {
        return ((sizeOfDie + 1) / 2) + addend;
    }

    public int roll() {
        return r.nextInt(sizeOfDie) + 1;
    }

    public int roll(int addend) {
        return r.nextInt(sizeOfDie) + 1 + addend;
    }
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/clouddms/v1/clouddms_resources.proto

package com.google.cloud.clouddms.v1;

public final class ClouddmsResourcesProto {
  private ClouddmsResourcesProto() {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
  }

  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_SslConfig_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_SslConfig_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_MySqlConnectionProfile_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_MySqlConnectionProfile_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_PostgreSqlConnectionProfile_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_PostgreSqlConnectionProfile_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_CloudSqlConnectionProfile_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_CloudSqlConnectionProfile_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_SqlAclEntry_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_SqlAclEntry_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_SqlIpConfig_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_SqlIpConfig_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_CloudSqlSettings_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_CloudSqlSettings_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_CloudSqlSettings_UserLabelsEntry_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_CloudSqlSettings_UserLabelsEntry_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_CloudSqlSettings_DatabaseFlagsEntry_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_CloudSqlSettings_DatabaseFlagsEntry_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_StaticIpConnectivity_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_StaticIpConnectivity_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_ReverseSshConnectivity_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_ReverseSshConnectivity_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_VpcPeeringConnectivity_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_VpcPeeringConnectivity_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_DatabaseType_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_DatabaseType_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_MigrationJob_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_MigrationJob_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_MigrationJob_LabelsEntry_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_MigrationJob_LabelsEntry_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_ConnectionProfile_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_ConnectionProfile_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_ConnectionProfile_LabelsEntry_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_ConnectionProfile_LabelsEntry_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_clouddms_v1_MigrationJobVerificationError_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_clouddms_v1_MigrationJobVerificationError_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
    return descriptor;
  }

  private static com.google.protobuf.Descriptors.FileDescriptor descriptor;

  static {
    java.lang.String[] descriptorData = {
      "\n1google/cloud/clouddms/v1/clouddms_reso"
          + "urces.proto\022\030google.cloud.clouddms.v1\032\037g"
          + "oogle/api/field_behavior.proto\032\031google/a"
          + "pi/resource.proto\032\036google/protobuf/durat"
          + "ion.proto\032\037google/protobuf/timestamp.pro"
          + "to\032\036google/protobuf/wrappers.proto\032\027goog"
          + "le/rpc/status.proto\"\356\001\n\tSslConfig\022>\n\004typ"
          + "e\030\001 \001(\0162+.google.cloud.clouddms.v1.SslCo"
          + "nfig.SslTypeB\003\340A\003\022\027\n\nclient_key\030\002 \001(\tB\003\340"
          + "A\004\022\037\n\022client_certificate\030\003 \001(\tB\003\340A\004\022\036\n\016c"
          + "a_certificate\030\004 \001(\tB\006\340A\004\340A\002\"G\n\007SslType\022\030"
          + "\n\024SSL_TYPE_UNSPECIFIED\020\000\022\017\n\013SERVER_ONLY\020"
          + "\001\022\021\n\rSERVER_CLIENT\020\002\"\322\001\n\026MySqlConnection"
          + "Profile\022\021\n\004host\030\001 \001(\tB\003\340A\002\022\021\n\004port\030\002 \001(\005"
          + "B\003\340A\002\022\025\n\010username\030\003 \001(\tB\003\340A\002\022\030\n\010password"
          + "\030\004 \001(\tB\006\340A\004\340A\002\022\031\n\014password_set\030\005 \001(\010B\003\340A"
          + "\003\0220\n\003ssl\030\006 \001(\0132#.google.cloud.clouddms.v"
          + "1.SslConfig\022\024\n\014cloud_sql_id\030\007 \001(\t\"\327\001\n\033Po"
          + "stgreSqlConnectionProfile\022\021\n\004host\030\001 \001(\tB"
          + "\003\340A\002\022\021\n\004port\030\002 \001(\005B\003\340A\002\022\025\n\010username\030\003 \001("
          + "\tB\003\340A\002\022\030\n\010password\030\004 \001(\tB\006\340A\004\340A\002\022\031\n\014pass"
          + "word_set\030\005 \001(\010B\003\340A\003\0220\n\003ssl\030\006 \001(\0132#.googl"
          + "e.cloud.clouddms.v1.SslConfig\022\024\n\014cloud_s"
          + "ql_id\030\007 \001(\t\"\252\001\n\031CloudSqlConnectionProfil"
          + "e\022\031\n\014cloud_sql_id\030\001 \001(\tB\003\340A\003\022A\n\010settings"
          + "\030\002 \001(\0132*.google.cloud.clouddms.v1.CloudS"
          + "qlSettingsB\003\340A\005\022\027\n\nprivate_ip\030\003 \001(\tB\003\340A\003"
          + "\022\026\n\tpublic_ip\030\004 \001(\tB\003\340A\003\"\233\001\n\013SqlAclEntry"
          + "\022\r\n\005value\030\001 \001(\t\0221\n\013expire_time\030\n \001(\0132\032.g"
          + "oogle.protobuf.TimestampH\000\022-\n\003ttl\030\013 \001(\0132"
          + "\031.google.protobuf.DurationB\003\340A\004H\000\022\r\n\005lab"
          + "el\030\003 \001(\tB\014\n\nexpiration\"\314\001\n\013SqlIpConfig\022/"
          + "\n\013enable_ipv4\030\001 \001(\0132\032.google.protobuf.Bo"
          + "olValue\022\027\n\017private_network\030\002 \001(\t\022/\n\013requ"
          + "ire_ssl\030\003 \001(\0132\032.google.protobuf.BoolValu"
          + "e\022B\n\023authorized_networks\030\004 \003(\0132%.google."
          + "cloud.clouddms.v1.SqlAclEntry\"\372\t\n\020CloudS"
          + "qlSettings\022W\n\020database_version\030\001 \001(\0162=.g"
          + "oogle.cloud.clouddms.v1.CloudSqlSettings"
          + ".SqlDatabaseVersion\022O\n\013user_labels\030\002 \003(\013"
          + "2:.google.cloud.clouddms.v1.CloudSqlSett"
          + "ings.UserLabelsEntry\022\014\n\004tier\030\003 \001(\t\022>\n\031st"
          + "orage_auto_resize_limit\030\004 \001(\0132\033.google.p"
          + "rotobuf.Int64Value\022Y\n\021activation_policy\030"
          + "\005 \001(\0162>.google.cloud.clouddms.v1.CloudSq"
          + "lSettings.SqlActivationPolicy\0228\n\tip_conf"
          + "ig\030\006 \001(\0132%.google.cloud.clouddms.v1.SqlI"
          + "pConfig\0229\n\025auto_storage_increase\030\007 \001(\0132\032"
          + ".google.protobuf.BoolValue\022U\n\016database_f"
          + "lags\030\010 \003(\0132=.google.cloud.clouddms.v1.Cl"
          + "oudSqlSettings.DatabaseFlagsEntry\022R\n\016dat"
          + "a_disk_type\030\t \001(\0162:.google.cloud.clouddm"
          + "s.v1.CloudSqlSettings.SqlDataDiskType\0226\n"
          + "\021data_disk_size_gb\030\n \001(\0132\033.google.protob"
          + "uf.Int64Value\022\014\n\004zone\030\013 \001(\t\022\021\n\tsource_id"
          + "\030\014 \001(\t\022\032\n\rroot_password\030\r \001(\tB\003\340A\004\022\036\n\021ro"
          + "ot_password_set\030\016 \001(\010B\003\340A\003\022\021\n\tcollation\030"
          + "\017 \001(\t\0321\n\017UserLabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n"
          + "\005value\030\002 \001(\t:\0028\001\0324\n\022DatabaseFlagsEntry\022\013"
          + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"S\n\023SqlAct"
          + "ivationPolicy\022%\n!SQL_ACTIVATION_POLICY_U"
          + "NSPECIFIED\020\000\022\n\n\006ALWAYS\020\001\022\t\n\005NEVER\020\002\"M\n\017S"
          + "qlDataDiskType\022\"\n\036SQL_DATA_DISK_TYPE_UNS"
          + "PECIFIED\020\000\022\n\n\006PD_SSD\020\001\022\n\n\006PD_HDD\020\002\"\275\001\n\022S"
          + "qlDatabaseVersion\022$\n SQL_DATABASE_VERSIO"
          + "N_UNSPECIFIED\020\000\022\r\n\tMYSQL_5_6\020\001\022\r\n\tMYSQL_"
          + "5_7\020\002\022\020\n\014POSTGRES_9_6\020\003\022\017\n\013POSTGRES_11\020\004"
          + "\022\017\n\013POSTGRES_10\020\005\022\r\n\tMYSQL_8_0\020\006\022\017\n\013POST"
          + "GRES_12\020\007\022\017\n\013POSTGRES_13\020\010\"\026\n\024StaticIpCo"
          + "nnectivity\"[\n\026ReverseSshConnectivity\022\022\n\005"
          + "vm_ip\030\001 \001(\tB\003\340A\002\022\024\n\007vm_port\030\002 \001(\005B\003\340A\002\022\n"
          + "\n\002vm\030\003 \001(\t\022\013\n\003vpc\030\004 \001(\t\"%\n\026VpcPeeringCon"
          + "nectivity\022\013\n\003vpc\030\001 \001(\t\"\206\001\n\014DatabaseType\022"
          + "<\n\010provider\030\001 \001(\0162*.google.cloud.clouddm"
          + "s.v1.DatabaseProvider\0228\n\006engine\030\002 \001(\0162(."
          + "google.cloud.clouddms.v1.DatabaseEngine\""
          + "\354\014\n\014MigrationJob\022\014\n\004name\030\001 \001(\t\0224\n\013create"
          + "_time\030\002 \001(\0132\032.google.protobuf.TimestampB"
          + "\003\340A\003\0224\n\013update_time\030\003 \001(\0132\032.google.proto"
          + "buf.TimestampB\003\340A\003\022B\n\006labels\030\004 \003(\01322.goo"
          + "gle.cloud.clouddms.v1.MigrationJob.Label"
          + "sEntry\022\024\n\014display_name\030\005 \001(\t\022;\n\005state\030\006 "
          + "\001(\0162,.google.cloud.clouddms.v1.Migration"
          + "Job.State\022@\n\005phase\030\007 \001(\0162,.google.cloud."
          + "clouddms.v1.MigrationJob.PhaseB\003\340A\003\022>\n\004t"
          + "ype\030\010 \001(\0162+.google.cloud.clouddms.v1.Mig"
          + "rationJob.TypeB\003\340A\002\022\021\n\tdump_path\030\t \001(\t\022\023"
          + "\n\006source\030\n \001(\tB\003\340A\002\022\030\n\013destination\030\013 \001(\t"
          + "B\003\340A\002\022T\n\030reverse_ssh_connectivity\030e \001(\0132"
          + "0.google.cloud.clouddms.v1.ReverseSshCon"
          + "nectivityH\000\022T\n\030vpc_peering_connectivity\030"
          + "f \001(\01320.google.cloud.clouddms.v1.VpcPeer"
          + "ingConnectivityH\000\022P\n\026static_ip_connectiv"
          + "ity\030g \001(\0132..google.cloud.clouddms.v1.Sta"
          + "ticIpConnectivityH\000\0220\n\010duration\030\014 \001(\0132\031."
          + "google.protobuf.DurationB\003\340A\003\022&\n\005error\030\r"
          + " \001(\0132\022.google.rpc.StatusB\003\340A\003\022?\n\017source_"
          + "database\030\016 \001(\0132&.google.cloud.clouddms.v"
          + "1.DatabaseType\022D\n\024destination_database\030\017"
          + " \001(\0132&.google.cloud.clouddms.v1.Database"
          + "Type\0221\n\010end_time\030\020 \001(\0132\032.google.protobuf"
          + ".TimestampB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 "
          + "\001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\361\001\n\005State\022\025\n\021STAT"
          + "E_UNSPECIFIED\020\000\022\017\n\013MAINTENANCE\020\001\022\t\n\005DRAF"
          + "T\020\002\022\014\n\010CREATING\020\003\022\017\n\013NOT_STARTED\020\004\022\013\n\007RU"
          + "NNING\020\005\022\n\n\006FAILED\020\006\022\r\n\tCOMPLETED\020\007\022\014\n\010DE"
          + "LETING\020\010\022\014\n\010STOPPING\020\t\022\013\n\007STOPPED\020\n\022\013\n\007D"
          + "ELETED\020\013\022\014\n\010UPDATING\020\014\022\014\n\010STARTING\020\r\022\016\n\n"
          + "RESTARTING\020\016\022\014\n\010RESUMING\020\017\"\216\001\n\005Phase\022\025\n\021"
          + "PHASE_UNSPECIFIED\020\000\022\r\n\tFULL_DUMP\020\001\022\007\n\003CD"
          + "C\020\002\022\027\n\023PROMOTE_IN_PROGRESS\020\003\022%\n!WAITING_"
          + "FOR_SOURCE_WRITES_TO_STOP\020\004\022\026\n\022PREPARING"
          + "_THE_DUMP\020\005\":\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020"
          + "\000\022\014\n\010ONE_TIME\020\001\022\016\n\nCONTINUOUS\020\002:u\352Ar\n)da"
          + "tamigration.googleapis.com/MigrationJob\022"
          + "Eprojects/{project}/locations/{location}"
          + "/migrationJobs/{migration_job}B\016\n\014connec"
          + "tivity\"\263\007\n\021ConnectionProfile\022\014\n\004name\030\001 \001"
          + "(\t\0224\n\013create_time\030\002 \001(\0132\032.google.protobu"
          + "f.TimestampB\003\340A\003\0224\n\013update_time\030\003 \001(\0132\032."
          + "google.protobuf.TimestampB\003\340A\003\022G\n\006labels"
          + "\030\004 \003(\01327.google.cloud.clouddms.v1.Connec"
          + "tionProfile.LabelsEntry\022@\n\005state\030\005 \001(\01621"
          + ".google.cloud.clouddms.v1.ConnectionProf"
          + "ile.State\022\024\n\014display_name\030\006 \001(\t\022A\n\005mysql"
          + "\030d \001(\01320.google.cloud.clouddms.v1.MySqlC"
          + "onnectionProfileH\000\022K\n\npostgresql\030e \001(\01325"
          + ".google.cloud.clouddms.v1.PostgreSqlConn"
          + "ectionProfileH\000\022G\n\010cloudsql\030f \001(\01323.goog"
          + "le.cloud.clouddms.v1.CloudSqlConnectionP"
          + "rofileH\000\022&\n\005error\030\007 \001(\0132\022.google.rpc.Sta"
          + "tusB\003\340A\003\022<\n\010provider\030\010 \001(\0162*.google.clou"
          + "d.clouddms.v1.DatabaseProvider\032-\n\013Labels"
          + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"w\n"
          + "\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005DRAFT\020\001"
          + "\022\014\n\010CREATING\020\002\022\t\n\005READY\020\003\022\014\n\010UPDATING\020\004\022"
          + "\014\n\010DELETING\020\005\022\013\n\007DELETED\020\006\022\n\n\006FAILED\020\007:\205"
          + "\001\352A\201\001\n.datamigration.googleapis.com/Conn"
          + "ectionProfile\022Oprojects/{project}/locati"
          + "ons/{location}/connectionProfiles/{conne"
          + "ction_profile}B\024\n\022connection_profile\"\320\006\n"
          + "\035MigrationJobVerificationError\022Z\n\nerror_"
          + "code\030\001 \001(\0162A.google.cloud.clouddms.v1.Mi"
          + "grationJobVerificationError.ErrorCodeB\003\340"
          + "A\003\022\032\n\rerror_message\030\002 \001(\tB\003\340A\003\022!\n\024error_"
          + "detail_message\030\003 \001(\tB\003\340A\003\"\223\005\n\tErrorCode\022"
          + "\032\n\026ERROR_CODE_UNSPECIFIED\020\000\022\026\n\022CONNECTIO"
          + "N_FAILURE\020\001\022\032\n\026AUTHENTICATION_FAILURE\020\002\022"
          + "%\n!INVALID_CONNECTION_PROFILE_CONFIG\020\003\022\033"
          + "\n\027VERSION_INCOMPATIBILITY\020\004\022,\n(CONNECTIO"
          + "N_PROFILE_TYPES_INCOMPATIBILITY\020\005\022\032\n\026NO_"
          + "PGLOGICAL_INSTALLED\020\007\022!\n\035PGLOGICAL_NODE_"
          + "ALREADY_EXISTS\020\010\022\025\n\021INVALID_WAL_LEVEL\020\t\022"
          + "\"\n\036INVALID_SHARED_PRELOAD_LIBRARY\020\n\022&\n\"I"
          + "NSUFFICIENT_MAX_REPLICATION_SLOTS\020\013\022 \n\034I"
          + "NSUFFICIENT_MAX_WAL_SENDERS\020\014\022%\n!INSUFFI"
          + "CIENT_MAX_WORKER_PROCESSES\020\r\022\032\n\026UNSUPPOR"
          + "TED_EXTENSIONS\020\016\022\036\n\032UNSUPPORTED_MIGRATIO"
          + "N_TYPE\020\017\022#\n\037INVALID_RDS_LOGICAL_REPLICAT"
          + "ION\020\020\022\031\n\025UNSUPPORTED_GTID_MODE\020\021\022 \n\034UNSU"
          + "PPORTED_TABLE_DEFINITION\020\022\022\027\n\023UNSUPPORTE"
          + "D_DEFINER\020\023\022\"\n\036CANT_RESTART_RUNNING_MIGR"
          + "ATION\020\025*L\n\016DatabaseEngine\022\037\n\033DATABASE_EN"
          + "GINE_UNSPECIFIED\020\000\022\t\n\005MYSQL\020\001\022\016\n\nPOSTGRE"
          + "SQL\020\002*L\n\020DatabaseProvider\022!\n\035DATABASE_PR"
          + "OVIDER_UNSPECIFIED\020\000\022\014\n\010CLOUDSQL\020\001\022\007\n\003RD"
          + "S\020\002B\316\001\n\034com.google.cloud.clouddms.v1B\026Cl"
          + "ouddmsResourcesProtoP\001Z@google.golang.or"
          + "g/genproto/googleapis/cloud/clouddms/v1;"
          + "clouddms\252\002\030Google.Cloud.CloudDms.V1\312\002\030Go"
          + "ogle\\Cloud\\CloudDms\\V1\352\002\033Google::Cloud::"
          + "CloudDMS::V1b\006proto3"
    };
    descriptor =
        com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
            descriptorData,
            new com.google.protobuf.Descriptors.FileDescriptor[] {
              com.google.api.FieldBehaviorProto.getDescriptor(),
              com.google.api.ResourceProto.getDescriptor(),
              com.google.protobuf.DurationProto.getDescriptor(),
              com.google.protobuf.TimestampProto.getDescriptor(),
              com.google.protobuf.WrappersProto.getDescriptor(),
              com.google.rpc.StatusProto.getDescriptor(),
            });
    internal_static_google_cloud_clouddms_v1_SslConfig_descriptor =
        getDescriptor().getMessageTypes().get(0);
    internal_static_google_cloud_clouddms_v1_SslConfig_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_SslConfig_descriptor,
            new java.lang.String[] {
              "Type", "ClientKey", "ClientCertificate", "CaCertificate",
            });
    internal_static_google_cloud_clouddms_v1_MySqlConnectionProfile_descriptor =
        getDescriptor().getMessageTypes().get(1);
    internal_static_google_cloud_clouddms_v1_MySqlConnectionProfile_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_MySqlConnectionProfile_descriptor,
            new java.lang.String[] {
              "Host", "Port", "Username", "Password", "PasswordSet", "Ssl", "CloudSqlId",
            });
    internal_static_google_cloud_clouddms_v1_PostgreSqlConnectionProfile_descriptor =
        getDescriptor().getMessageTypes().get(2);
    internal_static_google_cloud_clouddms_v1_PostgreSqlConnectionProfile_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_PostgreSqlConnectionProfile_descriptor,
            new java.lang.String[] {
              "Host", "Port", "Username", "Password", "PasswordSet", "Ssl", "CloudSqlId",
            });
    internal_static_google_cloud_clouddms_v1_CloudSqlConnectionProfile_descriptor =
        getDescriptor().getMessageTypes().get(3);
    internal_static_google_cloud_clouddms_v1_CloudSqlConnectionProfile_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_CloudSqlConnectionProfile_descriptor,
            new java.lang.String[] {
              "CloudSqlId", "Settings", "PrivateIp", "PublicIp",
            });
    internal_static_google_cloud_clouddms_v1_SqlAclEntry_descriptor =
        getDescriptor().getMessageTypes().get(4);
    internal_static_google_cloud_clouddms_v1_SqlAclEntry_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_SqlAclEntry_descriptor,
            new java.lang.String[] {
              "Value", "ExpireTime", "Ttl", "Label", "Expiration",
            });
    internal_static_google_cloud_clouddms_v1_SqlIpConfig_descriptor =
        getDescriptor().getMessageTypes().get(5);
    internal_static_google_cloud_clouddms_v1_SqlIpConfig_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_SqlIpConfig_descriptor,
            new java.lang.String[] {
              "EnableIpv4", "PrivateNetwork", "RequireSsl", "AuthorizedNetworks",
            });
    internal_static_google_cloud_clouddms_v1_CloudSqlSettings_descriptor =
        getDescriptor().getMessageTypes().get(6);
    internal_static_google_cloud_clouddms_v1_CloudSqlSettings_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_CloudSqlSettings_descriptor,
            new java.lang.String[] {
              "DatabaseVersion",
              "UserLabels",
              "Tier",
              "StorageAutoResizeLimit",
              "ActivationPolicy",
              "IpConfig",
              "AutoStorageIncrease",
              "DatabaseFlags",
              "DataDiskType",
              "DataDiskSizeGb",
              "Zone",
              "SourceId",
              "RootPassword",
              "RootPasswordSet",
              "Collation",
            });
    internal_static_google_cloud_clouddms_v1_CloudSqlSettings_UserLabelsEntry_descriptor =
        internal_static_google_cloud_clouddms_v1_CloudSqlSettings_descriptor
            .getNestedTypes()
            .get(0);
    internal_static_google_cloud_clouddms_v1_CloudSqlSettings_UserLabelsEntry_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_CloudSqlSettings_UserLabelsEntry_descriptor,
            new java.lang.String[] {
              "Key", "Value",
            });
    internal_static_google_cloud_clouddms_v1_CloudSqlSettings_DatabaseFlagsEntry_descriptor =
        internal_static_google_cloud_clouddms_v1_CloudSqlSettings_descriptor
            .getNestedTypes()
            .get(1);
    internal_static_google_cloud_clouddms_v1_CloudSqlSettings_DatabaseFlagsEntry_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_CloudSqlSettings_DatabaseFlagsEntry_descriptor,
            new java.lang.String[] {
              "Key", "Value",
            });
    internal_static_google_cloud_clouddms_v1_StaticIpConnectivity_descriptor =
        getDescriptor().getMessageTypes().get(7);
    internal_static_google_cloud_clouddms_v1_StaticIpConnectivity_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_StaticIpConnectivity_descriptor,
            new java.lang.String[] {});
    internal_static_google_cloud_clouddms_v1_ReverseSshConnectivity_descriptor =
        getDescriptor().getMessageTypes().get(8);
    internal_static_google_cloud_clouddms_v1_ReverseSshConnectivity_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_ReverseSshConnectivity_descriptor,
            new java.lang.String[] {
              "VmIp", "VmPort", "Vm", "Vpc",
            });
    internal_static_google_cloud_clouddms_v1_VpcPeeringConnectivity_descriptor =
        getDescriptor().getMessageTypes().get(9);
    internal_static_google_cloud_clouddms_v1_VpcPeeringConnectivity_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_VpcPeeringConnectivity_descriptor,
            new java.lang.String[] {
              "Vpc",
            });
    internal_static_google_cloud_clouddms_v1_DatabaseType_descriptor =
        getDescriptor().getMessageTypes().get(10);
    internal_static_google_cloud_clouddms_v1_DatabaseType_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_DatabaseType_descriptor,
            new java.lang.String[] {
              "Provider", "Engine",
            });
    internal_static_google_cloud_clouddms_v1_MigrationJob_descriptor =
        getDescriptor().getMessageTypes().get(11);
    internal_static_google_cloud_clouddms_v1_MigrationJob_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_MigrationJob_descriptor,
            new java.lang.String[] {
              "Name",
              "CreateTime",
              "UpdateTime",
              "Labels",
              "DisplayName",
              "State",
              "Phase",
              "Type",
              "DumpPath",
              "Source",
              "Destination",
              "ReverseSshConnectivity",
              "VpcPeeringConnectivity",
              "StaticIpConnectivity",
              "Duration",
              "Error",
              "SourceDatabase",
              "DestinationDatabase",
              "EndTime",
              "Connectivity",
            });
    internal_static_google_cloud_clouddms_v1_MigrationJob_LabelsEntry_descriptor =
        internal_static_google_cloud_clouddms_v1_MigrationJob_descriptor.getNestedTypes().get(0);
    internal_static_google_cloud_clouddms_v1_MigrationJob_LabelsEntry_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_MigrationJob_LabelsEntry_descriptor,
            new java.lang.String[] {
              "Key", "Value",
            });
    internal_static_google_cloud_clouddms_v1_ConnectionProfile_descriptor =
        getDescriptor().getMessageTypes().get(12);
    internal_static_google_cloud_clouddms_v1_ConnectionProfile_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_ConnectionProfile_descriptor,
            new java.lang.String[] {
              "Name",
              "CreateTime",
              "UpdateTime",
              "Labels",
              "State",
              "DisplayName",
              "Mysql",
              "Postgresql",
              "Cloudsql",
              "Error",
              "Provider",
              "ConnectionProfile",
            });
    internal_static_google_cloud_clouddms_v1_ConnectionProfile_LabelsEntry_descriptor =
        internal_static_google_cloud_clouddms_v1_ConnectionProfile_descriptor
            .getNestedTypes()
            .get(0);
    internal_static_google_cloud_clouddms_v1_ConnectionProfile_LabelsEntry_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_ConnectionProfile_LabelsEntry_descriptor,
            new java.lang.String[] {
              "Key", "Value",
            });
    internal_static_google_cloud_clouddms_v1_MigrationJobVerificationError_descriptor =
        getDescriptor().getMessageTypes().get(13);
    internal_static_google_cloud_clouddms_v1_MigrationJobVerificationError_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_clouddms_v1_MigrationJobVerificationError_descriptor,
            new java.lang.String[] {
              "ErrorCode", "ErrorMessage", "ErrorDetailMessage",
            });
    com.google.protobuf.ExtensionRegistry registry =
        com.google.protobuf.ExtensionRegistry.newInstance();
    registry.add(com.google.api.FieldBehaviorProto.fieldBehavior);
    registry.add(com.google.api.ResourceProto.resource);
    com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
        descriptor, registry);
    com.google.api.FieldBehaviorProto.getDescriptor();
    com.google.api.ResourceProto.getDescriptor();
    com.google.protobuf.DurationProto.getDescriptor();
    com.google.protobuf.TimestampProto.getDescriptor();
    com.google.protobuf.WrappersProto.getDescriptor();
    com.google.rpc.StatusProto.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
require('must/register')
var states = require('../dist/index.js')

describe('.long', function() {
  tests('long', [
    'australian capital territory',
    'new south wales',
    'northern territory',
    'queensland',
    'south australia',
    'tasmania',
    'victoria',
    'western australia'
  ])
})

describe('.short', function() {
  tests('short', [
    'act',
    'nsw',
    'nt',
    'qld',
    'sa',
    'tas',
    'vic',
    'wa'
  ])
})

describe('.capitals', function() {
  tests('capitals', [
    'canberra',
    'sydney',
    'darwin',
    'brisbane',
    'adelaide',
    'hobart',
    'melbourne',
    'perth'
  ])
})

describe('.all', function() {
  it('must return array', function() {
    states.all().must.be.an.array()
  })

  it('must return items as objects', function() {
    states.all().forEach(function(item) {
      item.must.be.an.object()

      ;[
        'name',
        'abbreviation',
        'capital',
        'type'
      ].forEach(function(prop) {
        item.must.have.property(prop, item[prop])
      })
    })
  })
})

function tests(func, data) {
  it('must return array', function() {
    states[func]().must.be.an.array()
  })

  it('must return items in lowercase', function() {
    states[func]().forEach(function(item) {
      item.must.equal(item.toLowerCase())
    })
  })

  ;data.forEach(function(item) {
    it('must include ' + item, function() {
      states[func]().indexOf(item).must.be.gte(0)
    })
  })

  it('must return items capitalized if capitalize setting = true', function() {
    states[func]({capitalize: true}).forEach(function(item) {
      item.must.equal(item.replace(/\b\w/g, function(f) {
        return f.toUpperCase()
      }))
    })
  })

  it('must return items in lowercase if capitalize setting = false', function() {
    states[func]({capitalize: false}).forEach(function(item) {
      item.must.equal(item.toLowerCase())
    })
  })
}


text:
require 'spec_helper'

include Serverspec::Helper::Ssh

ssh = double

describe 'build command with sudo' do
  before :each do
    RSpec.configure do |c|
      ssh.stub(:options) { { :user => 'foo' } }
      c.ssh = ssh
      c.sudo_path = nil
    end
  end

  context 'command pattern 1' do
    subject { backend.build_command('test -f /etc/passwd') }
    it { should eq 'sudo test -f /etc/passwd' }
  end

  context 'command pattern 2' do
    subject { backend.build_command('test ! -f /etc/selinux/config || (getenforce | grep -i -- disabled && grep -i -- ^SELINUX=disabled$ /etc/selinux/config)') }
    it { should eq 'sudo test ! -f /etc/selinux/config || (sudo getenforce | grep -i -- disabled && sudo grep -i -- ^SELINUX=disabled$ /etc/selinux/config)' }
  end

  context 'command pattern 3' do
    subject { backend.build_command("dpkg -s apache2 && ! dpkg -s apache2 | grep -E '^Status: .+ not-installed$'") }
    it { should eq "sudo dpkg -s apache2 && ! sudo dpkg -s apache2 | grep -E '^Status: .+ not-installed$'" }
  end
end

# Alternate path for sudo command:
sudo_path = '/usr/local/bin'

describe 'build command with sudo on alternate path' do
  before :each do
    RSpec.configure do |c|
      ssh.stub(:options) { { :user => 'foo' } }
      c.ssh = ssh
      c.sudo_path = "#{sudo_path}"
    end
  end

  context 'command pattern 1a' do
    subject { backend.build_command('test -f /etc/passwd') }
    it { should eq "#{sudo_path}/sudo test -f /etc/passwd" }
  end

  context 'command pattern 2a' do
    subject { backend.build_command('test ! -f /etc/selinux/config || (getenforce | grep -i -- disabled && grep -i -- ^SELINUX=disabled$ /etc/selinux/config)') }
    it { should eq "#{sudo_path}/sudo test ! -f /etc/selinux/config || (#{sudo_path}/sudo getenforce | grep -i -- disabled && #{sudo_path}/sudo grep -i -- ^SELINUX=disabled$ /etc/selinux/config)" }
  end

  context 'command pattern 3a' do
    subject { backend.build_command("dpkg -s apache2 && ! dpkg -s apache2 | grep -E '^Status: .+ not-installed$'") }
    it { should eq "#{sudo_path}/sudo dpkg -s apache2 && ! #{sudo_path}/sudo dpkg -s apache2 | grep -E '^Status: .+ not-installed$'" }
  end

  after :each do
    RSpec.configure do |c|
      c.sudo_path = nil
    end
  end

end


text:
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2016, OpenNebula Project, OpenNebula Systems                */
/*                                                                            */
/* 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.                                             */
/* -------------------------------------------------------------------------- */

define(function(require){
  /*
    DEPENDENCIES
   */

  var Locale = require('utils/locale');
  var MarketPlaceAppsTable = require('tabs/marketplaceapps-tab/datatable');

  /*
    CONSTANTS
   */

  var PANEL_ID = require('./apps/panelId');
  var MARKETPLACEAPPS_TABLE_ID = PANEL_ID + "MarketPlaceAppsTable"
  var XML_ROOT = "MARKETPLACE"

  /*
    CONSTRUCTOR
   */

  function Panel(info) {
    this.title = Locale.tr("Apps");
    this.icon = "fa-shopping-cart";

    this.element = info[XML_ROOT.toUpperCase()];

    return this;
  };

  Panel.PANEL_ID = PANEL_ID;
  Panel.prototype.html = _html;
  Panel.prototype.setup = _setup;

  return Panel;

  /*
    FUNCTION DEFINITIONS
   */

  function _html() {
    var marketPlaceApps = [];

    if (this.element.MARKETPLACEAPPS.ID != undefined){
      marketPlaceApps = this.element.MARKETPLACEAPPS.ID;

      if (!$.isArray(marketPlaceApps)){
        marketPlaceApps = [marketPlaceApps];
      }
    }

    var opts = {
      info: true,
      select: true,
      selectOptions: {
        read_only: true,
        fixed_ids: marketPlaceApps
      }
    };

    this.marketPlaceAppsDataTable = new MarketPlaceAppsTable(MARKETPLACEAPPS_TABLE_ID, opts);

    return this.marketPlaceAppsDataTable.dataTableHTML;
  }

  function _setup(context) {
    this.marketPlaceAppsDataTable.initialize();
    this.marketPlaceAppsDataTable.refreshResourceTableSelect();

    return false;
  }
})


text:
var AppDispatcher = require('../dispatcher/AppDispatcher');
var FluxCartConstants = require('../constants/FluxCartConstants');
var EventEmitter = require('events').EventEmitter;
var _ = require('underscore');

// Define initial data points
var _product = {};
var _selected = null;

// Load product data from mock API
function loadProductData(data) {
  _product = data[0];
  _selected = data[0].variants[0];
}

// Set currently selected product variant
function setSelected(index) {
  _selected = _product.variants[index];
}

// Extend ProductStore with EventEmitter to add event capabilities
var ProductStore = _.extend({}, EventEmitter.prototype, {

  // Return product data
  getProduct: function() {
    return _product;
  },

  // Return selected product
  getSelected: function(){
    return _selected;
  },

  // Emit change event
  emitChange: function() {
    console.log('[ProductStore] Emitting change event');

    this.emit('change');
  },

  // Add change listener
  addChangeListener: function(callback) {
    this.on('change', callback);
  },

  // Remove change listener
  removeChangeListener: function(callback) {
    this.removeListener('change', callback);
  }

});

// Register callback with AppDispatcher
AppDispatcher.register(function(payload) {
  var action = payload.action;
  var text;

  switch(action.actionType) {
    case FluxCartConstants.RECEIVE_DATA:
      console.log('[ProductStore] Received RECEIVE_DATA action', action.data);
      loadProductData(action.data);
      break;

    case FluxCartConstants.SELECT_PRODUCT:
      console.log('[ProductStore] Received SELECT_PRODUCT action', action.data);
      setSelected(action.data);
      break;

    default:
      return true;
  }

  // If action was responded to, emit change event
  ProductStore.emitChange();

  return true;
});

module.exports = ProductStore;


text:
namespace cpsm {

std::vector<boost::string_ref> str_split(boost::string_ref str,
                                         char const delimiter) {
  std::vector<boost::string_ref> splits;
  while (true) {
    auto const dpos = str.find_first_of(delimiter);
    if (dpos == boost::string_ref::npos) {
      break;
    }
    splits.push_back(str.substr(0, dpos));
    str.remove_prefix(dpos+1);
  }
  splits.push_back(str);
  return splits;
}

}  // namespace cpsm


text:
<?php

namespace Magento\SwatchesSampleData\Setup;

use Magento\Framework\Setup;

class Installer implements Setup\SampleData\InstallerInterface
{
    /**
     * @var \Magento\SwatchesSampleData\Model\Swatches;
     */
    protected $swatches;

    /**
     * @param \Magento\SwatchesSampleData\Model\Swatches $swatches
     */
    public function __construct(\Magento\SwatchesSampleData\Model\Swatches $swatches)
    {
        $this->swatches = $swatches;
    }

    /**
     * @inheritdoc
     */
    public function install()
    {
        $this->swatches->install();
    }
}


text:
package com.kskkbys.android_dagger_sample.di;

import android.content.Context;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by keisuke on 15/04/24.
 */
@Module
public class ContextModule {

    private Context mContext;

    public ContextModule(Context context) {
        mContext = context;
    }

    @Singleton
    @Provides
    Context provideContext() {
        return mContext;
    }
}


text:
ZAppWindow::ZAppWindow()
	: m_instance(nullptr)
	, m_handle(nullptr)
	, m_nWidth(800)
	, m_nHeight(600)
	, m_bFullScreen(false)
{

}

ZAppWindow::~ZAppWindow()
{

}

bool ZAppWindow::Init()
{
	WNDCLASSEX wc;
	ZeroMemory(&wc, sizeof(WNDCLASSEX));

	DEVMODE dmScreenSettings;
	int posX, posY;

	// Get the instance of this application.
	m_instance = GetModuleHandle(nullptr);

	m_sWindowClass = L"Engine";

	// Setup the windows class with default settings.
	wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
	wc.lpfnWndProc = HandleMessage;
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	wc.hInstance = m_instance;
	wc.hIcon = LoadIcon(nullptr, IDI_WINLOGO);
	wc.hIconSm = wc.hIcon;
	wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
	wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
	wc.lpszMenuName = nullptr;
	wc.lpszClassName = m_sWindowClass.c_str();
	wc.cbSize = sizeof(WNDCLASSEX);

	// Register the window class.
	RegisterClassEx(&wc);

	// Determine the resolution of the clients desktop screen.
	m_nHeight = GetSystemMetrics(SM_CXSCREEN);
	m_nWidth = GetSystemMetrics(SM_CYSCREEN);

	m_bFullScreen = GetApp()->GetApplicationOption("FULLSCREEN", false);

	m_nWidth = GetApp()->GetApplicationOption("RESOLUTION_WIDTH", 800);
	m_nHeight = GetApp()->GetApplicationOption("RESOLUTION_HEIGHT", 600);
	// Setup the screen settings depending on whether it is running in full screen or in windowed mode.
	if (m_bFullScreen)
	{
		// If full screen set the screen to maximum size of the users desktop and 32bit.
		memset(&dmScreenSettings, 0, sizeof(dmScreenSettings));
		dmScreenSettings.dmSize = sizeof(dmScreenSettings);
		dmScreenSettings.dmPelsWidth = (unsigned long)m_nHeight;
		dmScreenSettings.dmPelsHeight = (unsigned long)m_nWidth;
		dmScreenSettings.dmBitsPerPel = 32;
		dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;

		// Change the display settings to full screen.
		ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN);

		// Set the position of the window to the top left corner.
		posX = posY = 0;
	}
	else
	{
		// Place the window in the middle of the screen.
		posX = (GetSystemMetrics(SM_CXSCREEN) - m_nWidth) / 2;
		posY = (GetSystemMetrics(SM_CYSCREEN) - m_nHeight) / 2;
	}

	// Create the window with the screen settings and get the handle to it.
	m_handle = CreateWindowEx(WS_EX_APPWINDOW, m_sWindowClass.c_str(), m_sWindowClass.c_str(),
		WS_OVERLAPPEDWINDOW,
		posX, posY, m_nWidth, m_nHeight, nullptr, nullptr, m_instance, nullptr);

	if (m_handle == nullptr)
	{
		ZTRACE_MESSAGE("appwindow", "Create window error %lu", GetLastError());
		return false;
	}

	// Bring the window up on the screen and set it as main focus.
	ShowWindow(m_handle, SW_SHOW);
	SetForegroundWindow(m_handle);
	SetFocus(m_handle);

	// Hide the mouse cursor.
	ShowCursor(false);

	return ZAppWindowBase::Init();
}

void ZAppWindow::Uninit()
{
	ShowCursor(true);

	// Fix the display settings if leaving full screen mode.
	if (m_bFullScreen)
	{
		ChangeDisplaySettings(nullptr, 0);
	}

	// Remove the window.
	DestroyWindow(m_handle);
	m_handle = nullptr;

	// Remove the application instance.
	UnregisterClass(m_sWindowClass.c_str(), m_instance);
	m_instance = nullptr;

	ZAppWindowBase::Uninit();
}

bool ZAppWindow::Update(const STime& time)
{
	// Loop until there is a quit message from the window or the user.
	MSG msg;
	ZeroMemory(&msg, sizeof(MSG));

	// Handle the windows messages.
	if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}

	// If windows signals to end the application then exit out.
	if (msg.message == WM_QUIT)
	{
		return false;
	}
	else
	{
		return true;
	}

	ZAppWindowBase::Update(time);
}

//-----------------------------------------------------------------------------

uint32 ZAppWindow::GetHeight() const
{
	return m_nHeight;
}

uint32 ZAppWindow::GetWidth() const
{
	return m_nWidth;
}

HWND ZAppWindow::GetHandle() const
{
	return m_handle;
}

bool ZAppWindow::IsFullScreen() const
{
	return m_bFullScreen;
}

LRESULT ZAppWindow::HandleMessage(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam)
{
	switch (umessage)
	{
		// Check if the window is being destroyed.
		case WM_DESTROY:
		{
			PostQuitMessage(0);
			return 0;
		}

		// Check if the window is being closed.
		case WM_CLOSE:
		{
			PostQuitMessage(0);
			return 0;
		}

		default:
		{
			return DefWindowProc(hwnd, umessage, wparam, lparam);
		}
	}
}


text:
package play.modules.morphia.utils;

import java.lang.reflect.Type;

import org.bson.types.ObjectId;

import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

public class ObjectIdGsonAdapter implements JsonSerializer<ObjectId>,
        JsonDeserializer<ObjectId> {

    @Override
    public ObjectId deserialize(JsonElement json, Type typeOfT  ,
            JsonDeserializationContext context) throws JsonParseException {
        return new ObjectId(json.getAsJsonPrimitive().getAsString());
    }

    @Override
    public JsonElement serialize(ObjectId src, Type typeOfSrc,
            JsonSerializationContext context) {
        return new JsonPrimitive(src.toString());
    }

}


text:
package org.locationtech.geomesa.utils.iterators

import org.junit.runner.RunWith
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner

@RunWith(classOf[JUnitRunner])
class InfiniteIteratorTest extends Specification with Mockito {

  "stop after" should {

    import InfiniteIterator._

    "delegate until stop" >> {

      val end = mock[Iterator[String]]
      end.hasNext throws new IllegalArgumentException("You should have stopped.")
      end.next throws new IllegalArgumentException("You should have stopped.")

      val delegate = Iterator("A", "B") ++ end

      val result: Iterator[String] = delegate.stopAfter(_ == "B")

      result.hasNext must beTrue
      result.next() mustEqual "A"

      result.hasNext must beTrue
      result.next() mustEqual "B"

      result.hasNext must beFalse
      result.next() must throwA[NoSuchElementException]
    }

    "or the iterator is exhausted" >> {

      val delegate = Iterator("A", "B", "C")

      val result: Iterator[String] = delegate.stopAfter(_ == "D")

      result.hasNext must beTrue
      result.next() mustEqual "A"

      result.hasNext must beTrue
      result.next() mustEqual "B"

      result.hasNext must beTrue
      result.next() mustEqual "C"

      result.hasNext must beFalse
      result.next() must throwA[NoSuchElementException]
    }
  }
}