text:
package com.thefinestartist.royal;

import android.support.annotation.NonNull;

import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.thefinestartist.royal.util.DateUtil;

import java.util.Arrays;
import java.util.Date;

import io.realm.Realm;
import io.realm.RealmObject;
import io.realm.RoyalAccess;
import io.realm.internal.ColumnType;
import io.realm.internal.LinkView;
import io.realm.internal.Row;
import io.realm.internal.Table;

/**
 * Created by TheFinestArtist on 7/8/15.
 */
public class Rson {

    private static final Object lock = new Object();
    private static Gson gson;

    public static Gson getGson() {
        synchronized (lock) {
            if (gson != null)
                return gson;
            gson = new GsonBuilder()
                    .setExclusionStrategies(new ExclusionStrategy() {
                        @Override
                        public boolean shouldSkipField(FieldAttributes f) {
                            return f.getDeclaringClass().equals(RealmObject.class);
                        }

                        @Override
                        public boolean shouldSkipClass(Class<?> clazz) {
                            return false;
                        }
                    })
                    .create();
            return gson;
        }
    }

    public static String toJsonString(@NonNull RealmObject object) {
        return toJsonString(object, 1);
    }

    @SuppressWarnings("ConstantConditions")
    public static String toJsonString(@NonNull RealmObject object, int depth) {
        if (!RoyalAccess.isProxy(object)) {
            return getGson().toJson(object);
        } else {
            Realm realm = RoyalAccess.getRealm(object);
            Row row = RoyalAccess.getRow(object);
            Table table = RoyalAccess.getTable(object);
            long columnCount = table.getColumnCount();

            StringBuilder builder = new StringBuilder();
            if (columnCount > 0)
                builder.append("{");
            String prefix = "";
            for (int i = 0; i < columnCount; i++) {
                ColumnType columnType = table.getColumnType(i);

                switch (columnType) {
                    case BOOLEAN:
                        builder
                                .append(prefix)
                                .append("\"")
                                .append(table.getColumnName(i))
                                .append("\":")
                                .append(row.getBoolean(i));
                        prefix = ",";
                        break;
                    case INTEGER:
                        builder
                                .append(prefix)
                                .append("\"")
                                .append(table.getColumnName(i))
                                .append("\":")
                                .append(row.getLong(i));
                        prefix = ",";
                        break;
                    case FLOAT:
                        builder
                                .append(prefix)
                                .append("\"")
                                .append(table.getColumnName(i))
                                .append("\":")
                                .append(row.getFloat(i));
                        prefix = ",";
                        break;
                    case DOUBLE:
                        builder
                                .append(prefix)
                                .append("\"")
                                .append(table.getColumnName(i))
                                .append("\":")
                                .append(row.getDouble(i));
                        prefix = ",";
                        break;
                    case STRING:
                        String string = row.getString(i);
                        if (string != null) {
                            builder
                                    .append(prefix)
                                    .append("\"")
                                    .append(table.getColumnName(i))
                                    .append("\":\"")
                                    .append(string).append("\"");
                            prefix = ",";
                        }
                        break;
                    case BINARY:
                        builder
                                .append(prefix)
                                .append("\"")
                                .append(table.getColumnName(i))
                                .append("\":")
                                .append(Arrays.toString(row.getBinaryByteArray(i)));
                        prefix = ",";
                        break;
                    case DATE:
                        Date date = row.getDate(i);
                        // TODO: date.getTime() != 0 to better option
                        if (date != null && date.getTime() != 0) {
                            // Gson gson = new GsonBuilder().setDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz").create();
                            // Gson gson = new GsonBuilder().setDateFormat(DateFormat.FULL, DateFormat.FULL).create();
                            // TODO: Current "Sun Jul 12 03:50:05 GMT+09:00 2015"
                            builder
                                    .append(prefix)
                                    .append("\"")
                                    .append(table.getColumnName(i))
                                    .append("\":\"")
                                    .append(DateUtil.getDateFormat(date))
                                    .append("\"");
                            prefix = ",";
                        }
                        break;
                    case TABLE:
                        break;
                    case MIXED:
                        break;
                    case LINK:
                        if (depth > 0) {
                            RealmObject linkedObject = RoyalAccess.get(realm, table.getLinkTarget(i), row.getLink(i));
                            if (linkedObject != null) {
                                builder.append(prefix);
                                builder
                                        .append("\"")
                                        .append(table.getColumnName(i))
                                        .append("\":")
                                        .append(Rson.toJsonString(linkedObject, depth - 1));
                                prefix = ",";
                            }
                        }
                        break;
                    case LINK_LIST:
                        LinkView linkView = row.getLinkList(i);
                        if (depth > 0 && linkView.size() > 0) {
                            builder
                                    .append(prefix)
                                    .append("\"")
                                    .append(table.getColumnName(i))
                                    .append("\":");

                            Table linkTable = table.getLinkTarget(i);

                            builder.append("[");
                            String prefix2 = "";
                            for (int j = 0; j < linkView.size(); j++) {
                                RealmObject linkedObject = RoyalAccess.get(realm, linkTable, linkView.getTargetRowIndex(j));
                                builder
                                        .append(prefix2)
                                        .append(Rson.toJsonString(linkedObject, depth - 1));
                                prefix2 = ",";
                            }
                            builder.append("]");
                            prefix = ",";
                        }
                        break;
                }
            }
            if (columnCount > 0)
                builder.append("}");
            return builder.toString();
        }
    }
}


text:
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@inria.fr>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef SPARSE_COLETREE_H
#define SPARSE_COLETREE_H

namespace Eigen {

namespace internal {

/** Find the root of the tree/set containing the vertex i : Use Path halving */
template<typename Index, typename IndexVector>
Index etree_find (Index i, IndexVector& pp)
{
  Index p = pp(i); // Parent
  Index gp = pp(p); // Grand parent
  while (gp != p)
  {
    pp(i) = gp; // Parent pointer on find path is changed to former grand parent
    i = gp;
    p = pp(i);
    gp = pp(p);
  }
  return p;
}

/** Compute the column elimination tree of a sparse matrix
  * \param mat The matrix in column-major format.
  * \param parent The elimination tree
  * \param firstRowElt The column index of the first element in each row
  * \param perm The permutation to apply to the column of \b mat
  */
template <typename MatrixType, typename IndexVector>
int coletree(const MatrixType& mat, IndexVector& parent, IndexVector& firstRowElt, typename MatrixType::Index *perm=0)
{
  typedef typename MatrixType::Index Index;
  Index nc = mat.cols(); // Number of columns
  Index m = mat.rows();
  IndexVector root(nc); // root of subtree of etree
  root.setZero();
  IndexVector pp(nc); // disjoint sets
  pp.setZero(); // Initialize disjoint sets
  parent.resize(mat.cols());
  //Compute first nonzero column in each row
  Index row,col;
  firstRowElt.resize(m);
  firstRowElt.setConstant(nc);
  firstRowElt.segment(0, nc).setLinSpaced(nc, 0, nc-1);
  bool found_diag;
  for (col = 0; col < nc; col++)
  {
    Index pcol = col;
    if(perm) pcol  = perm[col];
    for (typename MatrixType::InnerIterator it(mat, pcol); it; ++it)
    {
      row = it.row();
      firstRowElt(row) = (std::min)(firstRowElt(row), col);
    }
  }
  /* Compute etree by Liu's algorithm for symmetric matrices,
          except use (firstRowElt[r],c) in place of an edge (r,c) of A.
    Thus each row clique in A'*A is replaced by a star
    centered at its first vertex, which has the same fill. */
  Index rset, cset, rroot;
  for (col = 0; col < nc; col++)
  {
    found_diag = false;
    pp(col) = col;
    cset = col;
    root(cset) = col;
    parent(col) = nc;
    /* The diagonal element is treated here even if it does not exist in the matrix
     * hence the loop is executed once more */
    Index pcol = col;
    if(perm) pcol  = perm[col];
    for (typename MatrixType::InnerIterator it(mat, pcol); it||!found_diag; ++it)
    { //  A sequence of interleaved find and union is performed
      Index i = col;
      if(it) i = it.index();
      if (i == col) found_diag = true;
      row = firstRowElt(i);
      if (row >= col) continue;
      rset = internal::etree_find(row, pp); // Find the name of the set containing row
      rroot = root(rset);
      if (rroot != col)
      {
        parent(rroot) = col;
        pp(cset) = rset;
        cset = rset;
        root(cset) = col;
      }
    }
  }
  return 0;
}

/**
  * Depth-first search from vertex n.  No recursion.
  * This routine was contributed by Cédric Doucet, CEDRAT Group, Meylan, France.
*/
template <typename Index, typename IndexVector>
void nr_etdfs (Index n, IndexVector& parent, IndexVector& first_kid, IndexVector& next_kid, IndexVector& post, Index postnum)
{
  Index current = n, first, next;
  while (postnum != n)
  {
    // No kid for the current node
    first = first_kid(current);

    // no kid for the current node
    if (first == -1)
    {
      // Numbering this node because it has no kid
      post(current) = postnum++;

      // looking for the next kid
      next = next_kid(current);
      while (next == -1)
      {
        // No more kids : back to the parent node
        current = parent(current);
        // numbering the parent node
        post(current) = postnum++;

        // Get the next kid
        next = next_kid(current);
      }
      // stopping criterion
      if (postnum == n+1) return;

      // Updating current node
      current = next;
    }
    else
    {
      current = first;
    }
  }
}

/**
  * \brief Post order a tree
  * \param n the number of nodes
  * \param parent Input tree
  * \param post postordered tree
  */
template <typename Index, typename IndexVector>
void treePostorder(Index n, IndexVector& parent, IndexVector& post)
{
  IndexVector first_kid, next_kid; // Linked list of children
  Index postnum;
  // Allocate storage for working arrays and results
  first_kid.resize(n+1);
  next_kid.setZero(n+1);
  post.setZero(n+1);

  // Set up structure describing children
  Index v, dad;
  first_kid.setConstant(-1);
  for (v = n-1; v >= 0; v--)
  {
    dad = parent(v);
    next_kid(v) = first_kid(dad);
    first_kid(dad) = v;
  }

  // Depth-first search from dummy root vertex #n
  postnum = 0;
  internal::nr_etdfs(n, parent, first_kid, next_kid, post, postnum);
}

} // end namespace internal

} // end namespace Eigen

#endif // SPARSE_COLETREE_H

redpajama_set_name: RedPajamaGithub


text:
package org.echoice.ums.service;

import org.echoice.ums.service.bean.AccssModeSoapResp;
import org.echoice.ums.service.bean.ObjectsSoapResp;
import org.echoice.ums.service.bean.OperatorSoapResp;

public interface UmsSoapWebservice {
	public boolean auth(String userName,String password);
	/**
	 * ÅжÏÓû§£¬¶Ô¸ø¶¨¶ÔÏó±êʶ+²Ù×÷±êʶÊÇ·ñÓÐÏàÓ¦µÄȨÏÞ
	 * @param userName
	 * @param objAlias
	 * @param accessAlias
	 * @return
	 */
	public boolean isAssignPermission(String userName,String objAlias,String accessAlias);

	/**
	 * ¸ù¾ÝÓû§Ãû£¬²éѯÓû§·ÖÅäµÄ¶ÔÏó²Ù×÷ȨÏÞÁбí
	 * @param userName
	 * @param accessAlias
	 * @return
	 */
	public OperatorSoapResp findAssignPermissionList(String userAlias);
	/**
	 * ¸ù¾ÝÓû§Ãû+²Ù×÷Ìõ¼þ£¬²éѯÓû§·ÖÅä²Ù×÷¶ÔÏóÁбí
	 * @param userName
	 * @param accessAlias
	 * @return
	 */
	public ObjectsSoapResp findAssignPermissionObjectList(String userAlias,String accessAlias);
	/**
	 * ¸ù¾Ý¡±Óû§Ãû+²Ù×÷+¶ÔÏ󸸽ڵã±êʶ¡±Ìõ¼þ£¬²éѯ¸ÃÓû§·ÖÅä²Ù×÷¶ÔÏóÁбí
	 * @param userName
	 * @param accessAlias
	 * @param parentObjName
	 * @return
	 */
	public ObjectsSoapResp findAssignPermissionObjectList(String userAlias,String accessAlias,String parentAlias);
	/**
	 * ¸ù¾ÝÓû§Ãû+¶ÔÏóÌõ¼þ£¬²éѯÓû§·ÖÅäµÄ¶ÔÏó²Ù×÷Áбí
	 * @param userName
	 * @param objName
	 * @return
	 */
	public AccssModeSoapResp findAssignPermissionAccessModeList(String userAlias,String objAlias);

}


text:
module Tak
  class Board
    attr_accessor :size
    attr_accessor :board

    attr_reader :white_piece_set
    attr_reader :black_piece_set

    # What constitutes a road-forming piece
    ROAD = {
      white: %w(w Cw),
      black: %w(b Cb)
    }

    # Creates a new Tak Board
    #
    # @param size [Integer]       Size of the board
    # @param ptn  [Array[String]] Previous game moveset to reconstruct from
    def initialize(size, ptn = nil)
      @size  = size
      @board = generate_board(ptn)

      @white_piece_set = Tak::PieceSet.new(board_size: size)
      @black_piece_set = Tak::PieceSet.new(board_size: size)

      @piece_sets = {
        white: white_piece_set,
        black: black_piece_set
      }
    end

    # Gets the current visible flat counts on the board
    #
    # @return [Hash[Symbol, Integer]]
    def flat_counts
      count_hash = Hash.new { |h,k| h[k] = 0 }

      @board.each_with_object(count_hash) do |row, counts|
        row.each do |cell|
          counts[:white] += 1 if cell.last == 'w'
          counts[:black] += 1 if cell.last == 'b'
        end
      end
    end

    # Checks to see if any piece sets are empty
    #
    # @return [Boolean]
    def empty_piece_set?
      @piece_sets.any? { |c, piece_set| piece_set.empty? }
    end

    # Returns who the flat winner is, or false if there is none yet
    #
    # Not a fan of the Bool/Sym response, consider refactor later.
    #
    # @return [Boolean || Symbol]
    def flat_winner
      return false unless empty_piece_set?

      white_flats, black_flats = flat_counts.values
      case white_flats <=> black_flats
      when  0 then :tie
      when  1 then :white
      when -1 then :black
      end
    end

    # Converts the current board into a bit variant in which viable
    # road pieces for `color` are represented as 1s
    #
    # @param color [Symbol]
    #
    # @return [Array[Array[Integer]]]
    def bit_board(color)
      @board.map { |row|
        row.map { |cell| ROAD[color].include?(cell.last) ? 1 : 0 }
      }
    end

    # Checks if a road win for `color` is present
    #
    # @param color [Symbol] Color to check for a win
    #
    # @return [Boolean]
    def road_win?(color)
      current_bit_board = bit_board(color)

      # Begin traversing through the board for potential roads.
      path_search(0, 0, nil, current_bit_board) || !!@size.times.find { |n|
        path_search(1, n, :horizontal, current_bit_board) ||
        path_search(n, 1, :vertical, current_bit_board)
      }
    end

    # Checks which color player currently owns a square
    #
    # @param x [Integer]
    # @param y [Integer]
    #
    # @return [Symbol]
    def square_owner(x, y)
      return true if @board[x][y].empty?

      @board[x][y].last == 'b' ? :black : :white
    end

    # Retrieves the pieces present at a coordinate
    #
    # @param x [Integer]
    # @param y [Integer]
    #
    # @return [Array[String]]
    def pieces_at(x, y)
      @board[x][y]
    end

    # Moves pieces according to PTN notation
    #
    # @param ptn [String]
    #   String representation of a Tak move
    #
    # @param color [Symbol]
    #   Which player is making the move
    #
    # @return [Boolean]
    #   Success status
    def move!(ptn, color)
      move = Tak::Move.new(ptn, self, color)

      return false unless move.valid? && square_owner(*move.origin)

      case move.type
      when 'movement'
        distribute_pieces(move)
      when 'placement'
        place_piece(move, color)
      end
    end

    # Distributes pieces from a stack move across the board
    #
    # @param move [Tak::Move]
    #
    # @return [Boolean]
    def distribute_pieces(move)
      stack = pieces_at(*move.origin).pop(move.size)

      move.coordinates.each do |(x, y)|
        @board[x][y].push(stack.pop)
      end

      true
    end

    # Places a piece at a given move coordinate
    #
    # @param move [Tak::Move]
    # @param color [Symbol]
    #
    # @return [Boolean]
    #   Success of placement
    def place_piece(move, color)
      square = pieces_at(*move.origin)

      return false unless square.empty? && @piece_sets[color].remove(move.piece_type)

      square.push(move.piece)

      true
    end

    # Consider moving this all out into a board formatter later. It'd be cleaner.
    #
    # May Matz forgive me for my debugging code here.
    def to_s
      max_size = board.flatten(1).max.join(' ').size + 1

      counts = flat_counts.map { |c, i|
        set = @piece_sets[c]
        "#{c}: #{i} flats, #{set.flats} remaining pieces, #{set.capstones} remaining capstones"
      }.join("\n")

      board_state = board.reverse.map.with_index { |row, i|
        row_head = "  #{size - i} "

        row_head + row.map { |cell|
          "[%#{max_size}s]" % cell.join(' ')
        }.join(' ')
      }.join("\n")

      footer = ('a'..'h').take(size).map { |c| "%#{max_size + 2}s" % c }.join(' ')

      "#{counts}\n\n#{board_state}\n   #{footer}"
    end

    private

    # Checks whether a given coordinate pair is out of bounds
    #
    # @param x [Integer]
    # @param y [Integer]
    #
    # @return [Boolean]
    def out_of_bounds?(x,y)
      x < 0 || y < 0 || x > @size - 1 || y > @size - 1
    end

    # Does a DFS variant to locate a potential road.
    #
    # @param x         [Integer] Start X coordinate
    # @param y         [Integer] Start Y coordinate
    # @param direction [Symbol]  Direction the search completes on
    #
    # @param bit_board [Array[Array[Integer]]] Board to parse against
    # @param traversed [Array[Array[Boolean]]] Traversal tracker
    #
    # @return [Boolean] Whether or not a road was round
    def path_search(x, y, direction, bit_board, traversed = visited_board)
      return false if out_of_bounds?(x,y) || traversed[x][y]

      piece_value = bit_board[x][y]
      return false if piece_value == 0 # Non-road piece
      return true  if road_end?(direction, x, y)

      traversed[x][y] = true

      # Recurse in all four directions. While this may retrace steps it is
      # necessary as roads in Tak can curve wildly.
      path_search(x + 1, y,     direction, bit_board, traversed) ||
      path_search(x - 1, y,     direction, bit_board, traversed) ||
      path_search(x,     y + 1, direction, bit_board, traversed) ||
      path_search(x,     y - 1, direction, bit_board, traversed)
    end

    # Checks to see if a given x y coordinate pair is counted as a road win
    # by being on the appropriate opposite end from the starting direction
    # of the road.
    #
    # @param direction [Symbol]  Starting direction of the road
    # @param x         [Integer]
    # @param y         [Integer]
    #
    # @return [Boolean]
    def road_end?(direction, x, y)
      case direction
      when :horizontal
        x == @size - 1
      when :vertical
        y == @size - 1
      else
        x == @size - 1 || y == @size - 1
      end
    end

    # Creates a board to mark previous traversals of the path search
    #
    # @return [Array[Array[Boolean]]]
    def visited_board
      Array.new(@size) { Array.new(@size, false) }
    end

    def generate_board(ptn)
      return Array.new(size) { Array.new(size) { [] } } unless ptn
    end
  end
end


text:
"""
15. Transactions

Django handles transactions in three different ways. The default is to commit
each transaction upon a write, but you can decorate a function to get
commit-on-success behavior. Alternatively, you can manage the transaction
manually.
"""

from django.db import models

class Reporter(models.Model):
    first_name = models.CharField(max_length=30)
    last_name = models.CharField(max_length=30)
    email = models.EmailField()

    def __unicode__(self):
        return u"%s %s" % (self.first_name, self.last_name)

__test__ = {'API_TESTS':"""
>>> from django.db import connection, transaction
"""}

from django.conf import settings

building_docs = getattr(settings, 'BUILDING_DOCS', False)

if building_docs or settings.DATABASE_ENGINE not in ('mysql', 'mysql_old'):
    __test__['API_TESTS'] += """
# the default behavior is to autocommit after each save() action
>>> def create_a_reporter_then_fail(first, last):
...     a = Reporter(first_name=first, last_name=last)
...     a.save()
...     raise Exception("I meant to do that")
...
>>> create_a_reporter_then_fail("Alice", "Smith")
Traceback (most recent call last):
    ...
Exception: I meant to do that

# The object created before the exception still exists
>>> Reporter.objects.all()
[<Reporter: Alice Smith>]

# the autocommit decorator works exactly the same as the default behavior
>>> autocomitted_create_then_fail = transaction.autocommit(create_a_reporter_then_fail)
>>> autocomitted_create_then_fail("Ben", "Jones")
Traceback (most recent call last):
    ...
Exception: I meant to do that

# Same behavior as before
>>> Reporter.objects.all()
[<Reporter: Alice Smith>, <Reporter: Ben Jones>]

# With the commit_on_success decorator, the transaction is only comitted if the
# function doesn't throw an exception
>>> committed_on_success = transaction.commit_on_success(create_a_reporter_then_fail)
>>> committed_on_success("Carol", "Doe")
Traceback (most recent call last):
    ...
Exception: I meant to do that

# This time the object never got saved
>>> Reporter.objects.all()
[<Reporter: Alice Smith>, <Reporter: Ben Jones>]

# If there aren't any exceptions, the data will get saved
>>> def remove_a_reporter():
...     r = Reporter.objects.get(first_name="Alice")
...     r.delete()
...
>>> remove_comitted_on_success = transaction.commit_on_success(remove_a_reporter)
>>> remove_comitted_on_success()
>>> Reporter.objects.all()
[<Reporter: Ben Jones>]

# You can manually manage transactions if you really want to, but you
# have to remember to commit/rollback
>>> def manually_managed():
...     r = Reporter(first_name="Carol", last_name="Doe")
...     r.save()
...     transaction.commit()
>>> manually_managed = transaction.commit_manually(manually_managed)
>>> manually_managed()
>>> Reporter.objects.all()
[<Reporter: Ben Jones>, <Reporter: Carol Doe>]

# If you forget, you'll get bad errors
>>> def manually_managed_mistake():
...     r = Reporter(first_name="David", last_name="Davidson")
...     r.save()
...     # oops, I forgot to commit/rollback!
>>> manually_managed_mistake = transaction.commit_manually(manually_managed_mistake)
>>> manually_managed_mistake()
Traceback (most recent call last):
    ...
TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK
"""


text:
require "test_helper"

# <lib:library
#    xmlns:lib="http://eric.van-der-vlist.com/ns/library"
#    xmlns:hr="http://eric.van-der-vlist.com/ns/person">
#   <lib:book id="b0836217462" available="true">
#    <lib:isbn>0836217462</lib:isbn>
#    <lib:title xml:lang="en">Being a Dog Is a Full-Time Job</lib:title>
#    <hr:author id="CMS">
#     <hr:name>Charles M Schulz</hr:name>
#     <hr:born>1922-11-26</hr:born>
#     <hr:dead>2000-02-12</hr:dead>
#    </hr:author>
#    <lib:character id="PP">
#     <hr:name>Peppermint Patty</hr:name>
#     <hr:born>1966-08-22</hr:born>
#     <lib:qualification>bold, brash and tomboyish</lib:qualification>
#     </lib:character>
#    <lib:character id="Snoopy">
#     <hr:name>Snoopy</hr:name>
#     <hr:born>1950-10-04</hr:born>
#     <lib:qualification>extroverted beagle</lib:qualification>
#    </lib:character>
#    <lib:character id="Schroeder">
#     <hr:name>Schroeder</hr:name>
#     <hr:born>1951-05-30</hr:born>
#     <lib:qualification>brought classical music to the Peanuts strip
#                   </lib:qualification>
#    </lib:character>
#    <lib:character id="Lucy">
#     <hr:name>Lucy</hr:name>
#     <hr:born>1952-03-03</hr:born>
#     <lib:qualification>bossy, crabby and selfish</lib:qualification>
#    </lib:character>
#   </lib:book>
#  </lib:library>

  # Theoretically, every property (scalar) needs/should have a namespace.
  # property :name, namespace: "http://eric.van-der-vlist.com/ns/person"
  # # This is implicit if contained:
  # class Person < Decorator
  #   namespace: "http://eric.van-der-vlist.com/ns/person"
  #   property :name #, namespace: "http://eric.van-der-vlist.com/ns/person"
  # end
  # class Library
  #   namespace "http://eric.van-der-vlist.com/ns/library"

  #   namespace_def lib:    "http://eric.van-der-vlist.com/ns/library"
  #   namespace_def person: "http://eric.van-der-vlist.com/ns/person"
  #   # namespace_def person: Person

  #   property :person, decorator: Person
  # end
class NamespaceXMLTest < Minitest::Spec
  module Model
    Library = Struct.new(:book)
    Book = Struct.new(:id, :isbn)
  end

  let (:book) { Model::Book.new(1, 666) }

  #:simple-class
  class Library < Representable::Decorator
    feature Representable::XML
    feature Representable::XML::Namespace

    namespace "http://eric.van-der-vlist.com/ns/library"

    property :book do
      namespace "http://eric.van-der-vlist.com/ns/library"

      property :id,  attribute: true
      property :isbn
    end
  end
  #:simple-class end

  # default namespace for library
  it "what" do
    Library.new(Model::Library.new(book)).to_xml.must_xml(

    #:simple-xml
    %{<library xmlns="http://eric.van-der-vlist.com/ns/library">
      <book id="1">
        <isbn>666</isbn>
      </book>
    </library>}
    #:simple-xml end
    )
  end
end

class Namespace2XMLTest < Minitest::Spec
  module Model
    Library   = Struct.new(:book)
    Book      = Struct.new(:id, :isbn, :author, :character)
    Character = Struct.new(:name, :born, :qualification)
  end

  let (:book) { Model::Book.new(1, 666, Model::Character.new("Fowler"), [Model::Character.new("Frau Java", 1991, "typed")]) }

  #:map-class
  class Library < Representable::Decorator
    feature Representable::XML
    feature Representable::XML::Namespace

    namespace "http://eric.van-der-vlist.com/ns/library"
    namespace_def lib: "http://eric.van-der-vlist.com/ns/library"
    namespace_def hr: "http://eric.van-der-vlist.com/ns/person"

    property :book, class: Model::Book do
      namespace "http://eric.van-der-vlist.com/ns/library"

      property :id,  attribute: true
      property :isbn

      property :author, class: Model::Character do
        namespace "http://eric.van-der-vlist.com/ns/person"

        property :name
        property :born
      end

      collection :character, class: Model::Character do
        namespace "http://eric.van-der-vlist.com/ns/library"

        property :qualification

        property :name, namespace: "http://eric.van-der-vlist.com/ns/person"
        property :born, namespace: "http://eric.van-der-vlist.com/ns/person"
      end
    end
  end
  #:map-class end

  it "renders" do
    Library.new(Model::Library.new(book)).to_xml.must_xml(
#:map-xml
%{<lib:library xmlns:lib=\"http://eric.van-der-vlist.com/ns/library\" xmlns:hr=\"http://eric.van-der-vlist.com/ns/person\">
  <lib:book id=\"1\">
    <lib:isbn>666</lib:isbn>
    <hr:author>
      <hr:name>Fowler</hr:name>
    </hr:author>
    <lib:character>
      <lib:qualification>typed</lib:qualification>
      <hr:name>Frau Java</hr:name>
      <hr:born>1991</hr:born>
    </lib:character>
  </lib:book>
</lib:library>}
#:map-xml end
    )
  end

  it "parses" do
    lib  = Model::Library.new
    #:parse-call
    Library.new(lib).from_xml(%{<lib:library
  xmlns:lib="http://eric.van-der-vlist.com/ns/library"
  xmlns:hr="http://eric.van-der-vlist.com/ns/person">
  <lib:book id="1">
    <lib:isbn>666</lib:isbn>
    <hr:author>
      <hr:name>Fowler</hr:name>
    </hr:author>
    <lib:character>
      <lib:qualification>typed</lib:qualification>
      <hr:name>Frau Java</hr:name>
      <bogus:name>Mr. Ruby</hr:name>
      <name>Dr. Elixir</hr:name>
      <hr:born>1991</hr:born>
    </lib:character>
  </lib:book>
</lib:library>}
    #:parse-call end
    )

    _(lib.book.inspect).must_equal %{#<struct Namespace2XMLTest::Model::Book id=\"1\", isbn=\"666\", author=#<struct Namespace2XMLTest::Model::Character name=\"Fowler\", born=nil, qualification=nil>, character=[#<struct Namespace2XMLTest::Model::Character name=\"Frau Java\", born=\"1991\", qualification=\"typed\">]>}

    #:parse-res
    lib.book.character[0].name #=> "Frau Java"
    #:parse-res end
  end
end


text:
#include <aws/core/utils/Outcome.h>
#include <aws/core/auth/AWSAuthSigner.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/core/client/RetryStrategy.h>
#include <aws/core/http/HttpClient.h>
#include <aws/core/http/HttpResponse.h>
#include <aws/core/http/HttpClientFactory.h>
#include <aws/core/auth/AWSCredentialsProviderChain.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/threading/Executor.h>
#include <aws/core/utils/DNS.h>
#include <aws/core/utils/logging/LogMacros.h>

#include <aws/devops-guru/DevOpsGuruClient.h>
#include <aws/devops-guru/DevOpsGuruEndpoint.h>
#include <aws/devops-guru/DevOpsGuruErrorMarshaller.h>
#include <aws/devops-guru/model/AddNotificationChannelRequest.h>
#include <aws/devops-guru/model/DeleteInsightRequest.h>
#include <aws/devops-guru/model/DescribeAccountHealthRequest.h>
#include <aws/devops-guru/model/DescribeAccountOverviewRequest.h>
#include <aws/devops-guru/model/DescribeAnomalyRequest.h>
#include <aws/devops-guru/model/DescribeEventSourcesConfigRequest.h>
#include <aws/devops-guru/model/DescribeFeedbackRequest.h>
#include <aws/devops-guru/model/DescribeInsightRequest.h>
#include <aws/devops-guru/model/DescribeOrganizationHealthRequest.h>
#include <aws/devops-guru/model/DescribeOrganizationOverviewRequest.h>
#include <aws/devops-guru/model/DescribeOrganizationResourceCollectionHealthRequest.h>
#include <aws/devops-guru/model/DescribeResourceCollectionHealthRequest.h>
#include <aws/devops-guru/model/DescribeServiceIntegrationRequest.h>
#include <aws/devops-guru/model/GetCostEstimationRequest.h>
#include <aws/devops-guru/model/GetResourceCollectionRequest.h>
#include <aws/devops-guru/model/ListAnomaliesForInsightRequest.h>
#include <aws/devops-guru/model/ListEventsRequest.h>
#include <aws/devops-guru/model/ListInsightsRequest.h>
#include <aws/devops-guru/model/ListNotificationChannelsRequest.h>
#include <aws/devops-guru/model/ListOrganizationInsightsRequest.h>
#include <aws/devops-guru/model/ListRecommendationsRequest.h>
#include <aws/devops-guru/model/PutFeedbackRequest.h>
#include <aws/devops-guru/model/RemoveNotificationChannelRequest.h>
#include <aws/devops-guru/model/SearchInsightsRequest.h>
#include <aws/devops-guru/model/SearchOrganizationInsightsRequest.h>
#include <aws/devops-guru/model/StartCostEstimationRequest.h>
#include <aws/devops-guru/model/UpdateEventSourcesConfigRequest.h>
#include <aws/devops-guru/model/UpdateResourceCollectionRequest.h>
#include <aws/devops-guru/model/UpdateServiceIntegrationRequest.h>

using namespace Aws;
using namespace Aws::Auth;
using namespace Aws::Client;
using namespace Aws::DevOpsGuru;
using namespace Aws::DevOpsGuru::Model;
using namespace Aws::Http;
using namespace Aws::Utils::Json;

static const char* SERVICE_NAME = "devops-guru";
static const char* ALLOCATION_TAG = "DevOpsGuruClient";

DevOpsGuruClient::DevOpsGuruClient(const Client::ClientConfiguration& clientConfiguration) :
  BASECLASS(clientConfiguration,
    Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
        SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
    Aws::MakeShared<DevOpsGuruErrorMarshaller>(ALLOCATION_TAG)),
    m_executor(clientConfiguration.executor)
{
  init(clientConfiguration);
}

DevOpsGuruClient::DevOpsGuruClient(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
  BASECLASS(clientConfiguration,
    Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
         SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
    Aws::MakeShared<DevOpsGuruErrorMarshaller>(ALLOCATION_TAG)),
    m_executor(clientConfiguration.executor)
{
  init(clientConfiguration);
}

DevOpsGuruClient::DevOpsGuruClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
  const Client::ClientConfiguration& clientConfiguration) :
  BASECLASS(clientConfiguration,
    Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider,
         SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
    Aws::MakeShared<DevOpsGuruErrorMarshaller>(ALLOCATION_TAG)),
    m_executor(clientConfiguration.executor)
{
  init(clientConfiguration);
}

DevOpsGuruClient::~DevOpsGuruClient()
{
}

void DevOpsGuruClient::init(const Client::ClientConfiguration& config)
{
  SetServiceClientName("DevOps Guru");
  m_configScheme = SchemeMapper::ToString(config.scheme);
  if (config.endpointOverride.empty())
  {
      m_uri = m_configScheme + "://" + DevOpsGuruEndpoint::ForRegion(config.region, config.useDualStack);
  }
  else
  {
      OverrideEndpoint(config.endpointOverride);
  }
}

void DevOpsGuruClient::OverrideEndpoint(const Aws::String& endpoint)
{
  if (endpoint.compare(0, 7, "http://") == 0 || endpoint.compare(0, 8, "https://") == 0)
  {
      m_uri = endpoint;
  }
  else
  {
      m_uri = m_configScheme + "://" + endpoint;
  }
}

AddNotificationChannelOutcome DevOpsGuruClient::AddNotificationChannel(const AddNotificationChannelRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/channels");
  return AddNotificationChannelOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER));
}

AddNotificationChannelOutcomeCallable DevOpsGuruClient::AddNotificationChannelCallable(const AddNotificationChannelRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< AddNotificationChannelOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->AddNotificationChannel(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::AddNotificationChannelAsync(const AddNotificationChannelRequest& request, const AddNotificationChannelResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->AddNotificationChannelAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::AddNotificationChannelAsyncHelper(const AddNotificationChannelRequest& request, const AddNotificationChannelResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, AddNotificationChannel(request), context);
}

DeleteInsightOutcome DevOpsGuruClient::DeleteInsight(const DeleteInsightRequest& request) const
{
  if (!request.IdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("DeleteInsight", "Required field: Id, is not set");
    return DeleteInsightOutcome(Aws::Client::AWSError<DevOpsGuruErrors>(DevOpsGuruErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Id]", false));
  }
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/insights/");
  uri.AddPathSegment(request.GetId());
  return DeleteInsightOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER));
}

DeleteInsightOutcomeCallable DevOpsGuruClient::DeleteInsightCallable(const DeleteInsightRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DeleteInsightOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteInsight(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DeleteInsightAsync(const DeleteInsightRequest& request, const DeleteInsightResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DeleteInsightAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DeleteInsightAsyncHelper(const DeleteInsightRequest& request, const DeleteInsightResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DeleteInsight(request), context);
}

DescribeAccountHealthOutcome DevOpsGuruClient::DescribeAccountHealth(const DescribeAccountHealthRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/accounts/health");
  return DescribeAccountHealthOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

DescribeAccountHealthOutcomeCallable DevOpsGuruClient::DescribeAccountHealthCallable(const DescribeAccountHealthRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeAccountHealthOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeAccountHealth(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeAccountHealthAsync(const DescribeAccountHealthRequest& request, const DescribeAccountHealthResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeAccountHealthAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeAccountHealthAsyncHelper(const DescribeAccountHealthRequest& request, const DescribeAccountHealthResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeAccountHealth(request), context);
}

DescribeAccountOverviewOutcome DevOpsGuruClient::DescribeAccountOverview(const DescribeAccountOverviewRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/accounts/overview");
  return DescribeAccountOverviewOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

DescribeAccountOverviewOutcomeCallable DevOpsGuruClient::DescribeAccountOverviewCallable(const DescribeAccountOverviewRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeAccountOverviewOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeAccountOverview(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeAccountOverviewAsync(const DescribeAccountOverviewRequest& request, const DescribeAccountOverviewResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeAccountOverviewAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeAccountOverviewAsyncHelper(const DescribeAccountOverviewRequest& request, const DescribeAccountOverviewResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeAccountOverview(request), context);
}

DescribeAnomalyOutcome DevOpsGuruClient::DescribeAnomaly(const DescribeAnomalyRequest& request) const
{
  if (!request.IdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("DescribeAnomaly", "Required field: Id, is not set");
    return DescribeAnomalyOutcome(Aws::Client::AWSError<DevOpsGuruErrors>(DevOpsGuruErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Id]", false));
  }
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/anomalies/");
  uri.AddPathSegment(request.GetId());
  return DescribeAnomalyOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

DescribeAnomalyOutcomeCallable DevOpsGuruClient::DescribeAnomalyCallable(const DescribeAnomalyRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeAnomalyOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeAnomaly(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeAnomalyAsync(const DescribeAnomalyRequest& request, const DescribeAnomalyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeAnomalyAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeAnomalyAsyncHelper(const DescribeAnomalyRequest& request, const DescribeAnomalyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeAnomaly(request), context);
}

DescribeEventSourcesConfigOutcome DevOpsGuruClient::DescribeEventSourcesConfig(const DescribeEventSourcesConfigRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/event-sources");
  return DescribeEventSourcesConfigOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

DescribeEventSourcesConfigOutcomeCallable DevOpsGuruClient::DescribeEventSourcesConfigCallable(const DescribeEventSourcesConfigRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeEventSourcesConfigOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeEventSourcesConfig(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeEventSourcesConfigAsync(const DescribeEventSourcesConfigRequest& request, const DescribeEventSourcesConfigResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeEventSourcesConfigAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeEventSourcesConfigAsyncHelper(const DescribeEventSourcesConfigRequest& request, const DescribeEventSourcesConfigResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeEventSourcesConfig(request), context);
}

DescribeFeedbackOutcome DevOpsGuruClient::DescribeFeedback(const DescribeFeedbackRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/feedback");
  return DescribeFeedbackOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

DescribeFeedbackOutcomeCallable DevOpsGuruClient::DescribeFeedbackCallable(const DescribeFeedbackRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeFeedbackOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeFeedback(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeFeedbackAsync(const DescribeFeedbackRequest& request, const DescribeFeedbackResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeFeedbackAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeFeedbackAsyncHelper(const DescribeFeedbackRequest& request, const DescribeFeedbackResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeFeedback(request), context);
}

DescribeInsightOutcome DevOpsGuruClient::DescribeInsight(const DescribeInsightRequest& request) const
{
  if (!request.IdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("DescribeInsight", "Required field: Id, is not set");
    return DescribeInsightOutcome(Aws::Client::AWSError<DevOpsGuruErrors>(DevOpsGuruErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Id]", false));
  }
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/insights/");
  uri.AddPathSegment(request.GetId());
  return DescribeInsightOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

DescribeInsightOutcomeCallable DevOpsGuruClient::DescribeInsightCallable(const DescribeInsightRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeInsightOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeInsight(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeInsightAsync(const DescribeInsightRequest& request, const DescribeInsightResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeInsightAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeInsightAsyncHelper(const DescribeInsightRequest& request, const DescribeInsightResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeInsight(request), context);
}

DescribeOrganizationHealthOutcome DevOpsGuruClient::DescribeOrganizationHealth(const DescribeOrganizationHealthRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/organization/health");
  return DescribeOrganizationHealthOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

DescribeOrganizationHealthOutcomeCallable DevOpsGuruClient::DescribeOrganizationHealthCallable(const DescribeOrganizationHealthRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeOrganizationHealthOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeOrganizationHealth(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeOrganizationHealthAsync(const DescribeOrganizationHealthRequest& request, const DescribeOrganizationHealthResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeOrganizationHealthAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeOrganizationHealthAsyncHelper(const DescribeOrganizationHealthRequest& request, const DescribeOrganizationHealthResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeOrganizationHealth(request), context);
}

DescribeOrganizationOverviewOutcome DevOpsGuruClient::DescribeOrganizationOverview(const DescribeOrganizationOverviewRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/organization/overview");
  return DescribeOrganizationOverviewOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

DescribeOrganizationOverviewOutcomeCallable DevOpsGuruClient::DescribeOrganizationOverviewCallable(const DescribeOrganizationOverviewRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeOrganizationOverviewOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeOrganizationOverview(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeOrganizationOverviewAsync(const DescribeOrganizationOverviewRequest& request, const DescribeOrganizationOverviewResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeOrganizationOverviewAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeOrganizationOverviewAsyncHelper(const DescribeOrganizationOverviewRequest& request, const DescribeOrganizationOverviewResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeOrganizationOverview(request), context);
}

DescribeOrganizationResourceCollectionHealthOutcome DevOpsGuruClient::DescribeOrganizationResourceCollectionHealth(const DescribeOrganizationResourceCollectionHealthRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/organization/health/resource-collection");
  return DescribeOrganizationResourceCollectionHealthOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

DescribeOrganizationResourceCollectionHealthOutcomeCallable DevOpsGuruClient::DescribeOrganizationResourceCollectionHealthCallable(const DescribeOrganizationResourceCollectionHealthRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeOrganizationResourceCollectionHealthOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeOrganizationResourceCollectionHealth(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeOrganizationResourceCollectionHealthAsync(const DescribeOrganizationResourceCollectionHealthRequest& request, const DescribeOrganizationResourceCollectionHealthResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeOrganizationResourceCollectionHealthAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeOrganizationResourceCollectionHealthAsyncHelper(const DescribeOrganizationResourceCollectionHealthRequest& request, const DescribeOrganizationResourceCollectionHealthResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeOrganizationResourceCollectionHealth(request), context);
}

DescribeResourceCollectionHealthOutcome DevOpsGuruClient::DescribeResourceCollectionHealth(const DescribeResourceCollectionHealthRequest& request) const
{
  if (!request.ResourceCollectionTypeHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("DescribeResourceCollectionHealth", "Required field: ResourceCollectionType, is not set");
    return DescribeResourceCollectionHealthOutcome(Aws::Client::AWSError<DevOpsGuruErrors>(DevOpsGuruErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceCollectionType]", false));
  }
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/accounts/health/resource-collection/");
  uri.AddPathSegment(ResourceCollectionTypeMapper::GetNameForResourceCollectionType(request.GetResourceCollectionType()));
  return DescribeResourceCollectionHealthOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

DescribeResourceCollectionHealthOutcomeCallable DevOpsGuruClient::DescribeResourceCollectionHealthCallable(const DescribeResourceCollectionHealthRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeResourceCollectionHealthOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeResourceCollectionHealth(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeResourceCollectionHealthAsync(const DescribeResourceCollectionHealthRequest& request, const DescribeResourceCollectionHealthResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeResourceCollectionHealthAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeResourceCollectionHealthAsyncHelper(const DescribeResourceCollectionHealthRequest& request, const DescribeResourceCollectionHealthResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeResourceCollectionHealth(request), context);
}

DescribeServiceIntegrationOutcome DevOpsGuruClient::DescribeServiceIntegration(const DescribeServiceIntegrationRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/service-integrations");
  return DescribeServiceIntegrationOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

DescribeServiceIntegrationOutcomeCallable DevOpsGuruClient::DescribeServiceIntegrationCallable(const DescribeServiceIntegrationRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< DescribeServiceIntegrationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeServiceIntegration(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::DescribeServiceIntegrationAsync(const DescribeServiceIntegrationRequest& request, const DescribeServiceIntegrationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->DescribeServiceIntegrationAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::DescribeServiceIntegrationAsyncHelper(const DescribeServiceIntegrationRequest& request, const DescribeServiceIntegrationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, DescribeServiceIntegration(request), context);
}

GetCostEstimationOutcome DevOpsGuruClient::GetCostEstimation(const GetCostEstimationRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/cost-estimation");
  return GetCostEstimationOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

GetCostEstimationOutcomeCallable DevOpsGuruClient::GetCostEstimationCallable(const GetCostEstimationRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< GetCostEstimationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetCostEstimation(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::GetCostEstimationAsync(const GetCostEstimationRequest& request, const GetCostEstimationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->GetCostEstimationAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::GetCostEstimationAsyncHelper(const GetCostEstimationRequest& request, const GetCostEstimationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, GetCostEstimation(request), context);
}

GetResourceCollectionOutcome DevOpsGuruClient::GetResourceCollection(const GetResourceCollectionRequest& request) const
{
  if (!request.ResourceCollectionTypeHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("GetResourceCollection", "Required field: ResourceCollectionType, is not set");
    return GetResourceCollectionOutcome(Aws::Client::AWSError<DevOpsGuruErrors>(DevOpsGuruErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceCollectionType]", false));
  }
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/resource-collections/");
  uri.AddPathSegment(ResourceCollectionTypeMapper::GetNameForResourceCollectionType(request.GetResourceCollectionType()));
  return GetResourceCollectionOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}

GetResourceCollectionOutcomeCallable DevOpsGuruClient::GetResourceCollectionCallable(const GetResourceCollectionRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< GetResourceCollectionOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetResourceCollection(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::GetResourceCollectionAsync(const GetResourceCollectionRequest& request, const GetResourceCollectionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->GetResourceCollectionAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::GetResourceCollectionAsyncHelper(const GetResourceCollectionRequest& request, const GetResourceCollectionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, GetResourceCollection(request), context);
}

ListAnomaliesForInsightOutcome DevOpsGuruClient::ListAnomaliesForInsight(const ListAnomaliesForInsightRequest& request) const
{
  if (!request.InsightIdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("ListAnomaliesForInsight", "Required field: InsightId, is not set");
    return ListAnomaliesForInsightOutcome(Aws::Client::AWSError<DevOpsGuruErrors>(DevOpsGuruErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [InsightId]", false));
  }
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/anomalies/insight/");
  uri.AddPathSegment(request.GetInsightId());
  return ListAnomaliesForInsightOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

ListAnomaliesForInsightOutcomeCallable DevOpsGuruClient::ListAnomaliesForInsightCallable(const ListAnomaliesForInsightRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< ListAnomaliesForInsightOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListAnomaliesForInsight(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::ListAnomaliesForInsightAsync(const ListAnomaliesForInsightRequest& request, const ListAnomaliesForInsightResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->ListAnomaliesForInsightAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::ListAnomaliesForInsightAsyncHelper(const ListAnomaliesForInsightRequest& request, const ListAnomaliesForInsightResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ListAnomaliesForInsight(request), context);
}

ListEventsOutcome DevOpsGuruClient::ListEvents(const ListEventsRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/events");
  return ListEventsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

ListEventsOutcomeCallable DevOpsGuruClient::ListEventsCallable(const ListEventsRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< ListEventsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListEvents(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::ListEventsAsync(const ListEventsRequest& request, const ListEventsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->ListEventsAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::ListEventsAsyncHelper(const ListEventsRequest& request, const ListEventsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ListEvents(request), context);
}

ListInsightsOutcome DevOpsGuruClient::ListInsights(const ListInsightsRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/insights");
  return ListInsightsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

ListInsightsOutcomeCallable DevOpsGuruClient::ListInsightsCallable(const ListInsightsRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< ListInsightsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListInsights(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::ListInsightsAsync(const ListInsightsRequest& request, const ListInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->ListInsightsAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::ListInsightsAsyncHelper(const ListInsightsRequest& request, const ListInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ListInsights(request), context);
}

ListNotificationChannelsOutcome DevOpsGuruClient::ListNotificationChannels(const ListNotificationChannelsRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/channels");
  return ListNotificationChannelsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

ListNotificationChannelsOutcomeCallable DevOpsGuruClient::ListNotificationChannelsCallable(const ListNotificationChannelsRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< ListNotificationChannelsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListNotificationChannels(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::ListNotificationChannelsAsync(const ListNotificationChannelsRequest& request, const ListNotificationChannelsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->ListNotificationChannelsAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::ListNotificationChannelsAsyncHelper(const ListNotificationChannelsRequest& request, const ListNotificationChannelsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ListNotificationChannels(request), context);
}

ListOrganizationInsightsOutcome DevOpsGuruClient::ListOrganizationInsights(const ListOrganizationInsightsRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/organization/insights");
  return ListOrganizationInsightsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

ListOrganizationInsightsOutcomeCallable DevOpsGuruClient::ListOrganizationInsightsCallable(const ListOrganizationInsightsRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< ListOrganizationInsightsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListOrganizationInsights(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::ListOrganizationInsightsAsync(const ListOrganizationInsightsRequest& request, const ListOrganizationInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->ListOrganizationInsightsAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::ListOrganizationInsightsAsyncHelper(const ListOrganizationInsightsRequest& request, const ListOrganizationInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ListOrganizationInsights(request), context);
}

ListRecommendationsOutcome DevOpsGuruClient::ListRecommendations(const ListRecommendationsRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/recommendations");
  return ListRecommendationsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

ListRecommendationsOutcomeCallable DevOpsGuruClient::ListRecommendationsCallable(const ListRecommendationsRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< ListRecommendationsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListRecommendations(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::ListRecommendationsAsync(const ListRecommendationsRequest& request, const ListRecommendationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->ListRecommendationsAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::ListRecommendationsAsyncHelper(const ListRecommendationsRequest& request, const ListRecommendationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, ListRecommendations(request), context);
}

PutFeedbackOutcome DevOpsGuruClient::PutFeedback(const PutFeedbackRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/feedback");
  return PutFeedbackOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER));
}

PutFeedbackOutcomeCallable DevOpsGuruClient::PutFeedbackCallable(const PutFeedbackRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< PutFeedbackOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutFeedback(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::PutFeedbackAsync(const PutFeedbackRequest& request, const PutFeedbackResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->PutFeedbackAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::PutFeedbackAsyncHelper(const PutFeedbackRequest& request, const PutFeedbackResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, PutFeedback(request), context);
}

RemoveNotificationChannelOutcome DevOpsGuruClient::RemoveNotificationChannel(const RemoveNotificationChannelRequest& request) const
{
  if (!request.IdHasBeenSet())
  {
    AWS_LOGSTREAM_ERROR("RemoveNotificationChannel", "Required field: Id, is not set");
    return RemoveNotificationChannelOutcome(Aws::Client::AWSError<DevOpsGuruErrors>(DevOpsGuruErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Id]", false));
  }
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/channels/");
  uri.AddPathSegment(request.GetId());
  return RemoveNotificationChannelOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER));
}

RemoveNotificationChannelOutcomeCallable DevOpsGuruClient::RemoveNotificationChannelCallable(const RemoveNotificationChannelRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< RemoveNotificationChannelOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->RemoveNotificationChannel(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::RemoveNotificationChannelAsync(const RemoveNotificationChannelRequest& request, const RemoveNotificationChannelResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->RemoveNotificationChannelAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::RemoveNotificationChannelAsyncHelper(const RemoveNotificationChannelRequest& request, const RemoveNotificationChannelResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, RemoveNotificationChannel(request), context);
}

SearchInsightsOutcome DevOpsGuruClient::SearchInsights(const SearchInsightsRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/insights/search");
  return SearchInsightsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

SearchInsightsOutcomeCallable DevOpsGuruClient::SearchInsightsCallable(const SearchInsightsRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< SearchInsightsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->SearchInsights(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::SearchInsightsAsync(const SearchInsightsRequest& request, const SearchInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->SearchInsightsAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::SearchInsightsAsyncHelper(const SearchInsightsRequest& request, const SearchInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, SearchInsights(request), context);
}

SearchOrganizationInsightsOutcome DevOpsGuruClient::SearchOrganizationInsights(const SearchOrganizationInsightsRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/organization/insights/search");
  return SearchOrganizationInsightsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}

SearchOrganizationInsightsOutcomeCallable DevOpsGuruClient::SearchOrganizationInsightsCallable(const SearchOrganizationInsightsRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< SearchOrganizationInsightsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->SearchOrganizationInsights(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::SearchOrganizationInsightsAsync(const SearchOrganizationInsightsRequest& request, const SearchOrganizationInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->SearchOrganizationInsightsAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::SearchOrganizationInsightsAsyncHelper(const SearchOrganizationInsightsRequest& request, const SearchOrganizationInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, SearchOrganizationInsights(request), context);
}

StartCostEstimationOutcome DevOpsGuruClient::StartCostEstimation(const StartCostEstimationRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/cost-estimation");
  return StartCostEstimationOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER));
}

StartCostEstimationOutcomeCallable DevOpsGuruClient::StartCostEstimationCallable(const StartCostEstimationRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< StartCostEstimationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->StartCostEstimation(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::StartCostEstimationAsync(const StartCostEstimationRequest& request, const StartCostEstimationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->StartCostEstimationAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::StartCostEstimationAsyncHelper(const StartCostEstimationRequest& request, const StartCostEstimationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, StartCostEstimation(request), context);
}

UpdateEventSourcesConfigOutcome DevOpsGuruClient::UpdateEventSourcesConfig(const UpdateEventSourcesConfigRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/event-sources");
  return UpdateEventSourcesConfigOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER));
}

UpdateEventSourcesConfigOutcomeCallable DevOpsGuruClient::UpdateEventSourcesConfigCallable(const UpdateEventSourcesConfigRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< UpdateEventSourcesConfigOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateEventSourcesConfig(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::UpdateEventSourcesConfigAsync(const UpdateEventSourcesConfigRequest& request, const UpdateEventSourcesConfigResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->UpdateEventSourcesConfigAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::UpdateEventSourcesConfigAsyncHelper(const UpdateEventSourcesConfigRequest& request, const UpdateEventSourcesConfigResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, UpdateEventSourcesConfig(request), context);
}

UpdateResourceCollectionOutcome DevOpsGuruClient::UpdateResourceCollection(const UpdateResourceCollectionRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/resource-collections");
  return UpdateResourceCollectionOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER));
}

UpdateResourceCollectionOutcomeCallable DevOpsGuruClient::UpdateResourceCollectionCallable(const UpdateResourceCollectionRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< UpdateResourceCollectionOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateResourceCollection(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::UpdateResourceCollectionAsync(const UpdateResourceCollectionRequest& request, const UpdateResourceCollectionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->UpdateResourceCollectionAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::UpdateResourceCollectionAsyncHelper(const UpdateResourceCollectionRequest& request, const UpdateResourceCollectionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, UpdateResourceCollection(request), context);
}

UpdateServiceIntegrationOutcome DevOpsGuruClient::UpdateServiceIntegration(const UpdateServiceIntegrationRequest& request) const
{
  Aws::Http::URI uri = m_uri;
  uri.AddPathSegments("/service-integrations");
  return UpdateServiceIntegrationOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER));
}

UpdateServiceIntegrationOutcomeCallable DevOpsGuruClient::UpdateServiceIntegrationCallable(const UpdateServiceIntegrationRequest& request) const
{
  auto task = Aws::MakeShared< std::packaged_task< UpdateServiceIntegrationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateServiceIntegration(request); } );
  auto packagedFunction = [task]() { (*task)(); };
  m_executor->Submit(packagedFunction);
  return task->get_future();
}

void DevOpsGuruClient::UpdateServiceIntegrationAsync(const UpdateServiceIntegrationRequest& request, const UpdateServiceIntegrationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  m_executor->Submit( [this, request, handler, context](){ this->UpdateServiceIntegrationAsyncHelper( request, handler, context ); } );
}

void DevOpsGuruClient::UpdateServiceIntegrationAsyncHelper(const UpdateServiceIntegrationRequest& request, const UpdateServiceIntegrationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
  handler(this, request, UpdateServiceIntegration(request), context);
}


text:
<?php

declare(strict_types=1);

namespace App\Orchid\Layouts\User;

use Orchid\Screen\Field;
use Orchid\Screen\Fields\Input;
use Orchid\Screen\Layouts\Rows;

class UserEditLayout extends Rows
{
    /**
     * Views.
     *
     * @return Field[]
     */
    public function fields(): array
    {
        return [
            Input::make('user.name')
                ->type('text')
                ->max(255)
                ->required()
                ->title(__('Name'))
                ->placeholder(__('Name')),

            Input::make('user.email')
                ->type('email')
                ->required()
                ->title(__('Email'))
                ->placeholder(__('Email')),
        ];
    }
}


text:
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.RecoveryServicesBackup.Models
{
    public partial class ProtectionIntent : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            writer.WritePropertyName("protectionIntentItemType");
            writer.WriteStringValue(ProtectionIntentItemType.ToString());
            if (Optional.IsDefined(BackupManagementType))
            {
                writer.WritePropertyName("backupManagementType");
                writer.WriteStringValue(BackupManagementType.Value.ToString());
            }
            if (Optional.IsDefined(SourceResourceId))
            {
                writer.WritePropertyName("sourceResourceId");
                writer.WriteStringValue(SourceResourceId);
            }
            if (Optional.IsDefined(ItemId))
            {
                writer.WritePropertyName("itemId");
                writer.WriteStringValue(ItemId);
            }
            if (Optional.IsDefined(PolicyId))
            {
                writer.WritePropertyName("policyId");
                writer.WriteStringValue(PolicyId);
            }
            if (Optional.IsDefined(ProtectionState))
            {
                writer.WritePropertyName("protectionState");
                writer.WriteStringValue(ProtectionState.Value.ToString());
            }
            writer.WriteEndObject();
        }

        internal static ProtectionIntent DeserializeProtectionIntent(JsonElement element)
        {
            if (element.TryGetProperty("protectionIntentItemType", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                    case "AzureResourceItem": return AzureResourceProtectionIntent.DeserializeAzureResourceProtectionIntent(element);
                    case "AzureWorkloadAutoProtectionIntent": return AzureWorkloadAutoProtectionIntent.DeserializeAzureWorkloadAutoProtectionIntent(element);
                    case "AzureWorkloadContainerAutoProtectionIntent": return AzureWorkloadContainerAutoProtectionIntent.DeserializeAzureWorkloadContainerAutoProtectionIntent(element);
                    case "AzureWorkloadSQLAutoProtectionIntent": return AzureWorkloadSQLAutoProtectionIntent.DeserializeAzureWorkloadSQLAutoProtectionIntent(element);
                    case "RecoveryServiceVaultItem": return AzureRecoveryServiceVaultProtectionIntent.DeserializeAzureRecoveryServiceVaultProtectionIntent(element);
                }
            }
            return UnknownProtectionIntent.DeserializeUnknownProtectionIntent(element);
        }
    }
}


text:
namespace webss
{
	//skips junk and valid junk operators (line escape and comments)
	various::SmartIterator& skipJunk(various::SmartIterator& it);

	//skips line junk and valid junk operators (line escape and comments)
	various::SmartIterator& skipLineJunk(various::SmartIterator& it);

	//if it points to a valid junk operator, then skips it and returns true, else returns false
	//throws an error if there is a junk operator, but its operand is invalid
	bool checkJunkOperators(various::SmartIterator& it);

	//skips junk and valid junk operators (line escape and comments) until valid non-junk char is met
	//throws an error if eof is met
	various::SmartIterator& skipJunkToValid(various::SmartIterator& it);

	//return true if c is end of line, separator or end of container, else false
	bool isLineEnd(char c, ConType con);

	//skips line-junk, then returns true if it is at the end or equals newline, else false
	bool checkLineEmpty(various::SmartIterator& it);

	//returns a name; it must point to a name-start char
	std::string parseName(various::SmartIterator& it);

	//skips the char currently pointed by it, skips junk, then parses a name
	std::string parseNameExplicit(TagIterator& tagit);
}


text:
Rundll32 iesetup.dll, IEHardenLMSettings, 1, True
Rundll32 iesetup.dll, IEHardenUser, 1, True
Rundll32 iesetup.dll, IEHardenAdmin, 1, True
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 -Force
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force
# restart Explorer process
$ieProcess = Get-Process -Name Explorer -ErrorAction Ignore
if ($ieProcess) {
    Stop-Process -Name Explorer -Force -ErrorAction Ignore
}
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled."


text:
#ifndef GAMSSYMBOLDOMAINVIOLATION_H
#define GAMSSYMBOLDOMAINVIOLATION_H

#include "gamslib_global.h"
#include "gamssymbolrecord.h"

namespace gams {

/// This class describes a domain violation of a GAMSSymbol.
class LIBSPEC GAMSSymbolDomainViolation
{
public:
    /// Standard constructor.
    GAMSSymbolDomainViolation();

    /// Assigns a GAMSSymbolDomainViolation.
    /// \param other Another GAMSSymbolDomainViolation used as data source.
    /// \return Returns the assigned GAMSSymbolDomainViolation (*this).
    GAMSSymbolDomainViolation& operator=(const GAMSSymbolDomainViolation& other);

    ///Checks if a GAMSSymbolDomainViolation is valid.
    /// \return Returns <c>true</c> if the GAMSSymbolDomainViolation is valid; otherwise <c>false</c>.
    bool isValid() const;

    /// Compares two GAMSSymbolDomainViolation objects.
    /// \param other Another GAMSSymbolDomainViolation to compare to.
    /// \return Returns <c>true</c> if the two GAMSSymbolDomainViolation are different; otherwise <c>false</c>.
    bool operator!=(const GAMSSymbolDomainViolation& other) const;

    /// Compares two GAMSSymbolDomainViolation objects.
    /// \param other Another GAMSSymbolDomainViolation to compare to.
    /// \return Returns <c>true</c> if the two GAMSSymbolDomainViolation are equal; otherwise <c>false</c>.
    bool operator==(const GAMSSymbolDomainViolation& other) const;

    /// GAMSSymbolRecord that has a domain violation.
    /// \return Returns the GAMSSymbolRecord.
    GAMSSymbolRecord violRec();

    /// Array indicating which position of a record has a domain violation.
    std::vector<bool> violInd();

private:
    friend class GAMSSymbolImpl;
    GAMSSymbolDomainViolation(const std::shared_ptr<GAMSSymbolDomainViolationImpl> impl);
    GAMSSymbolDomainViolation(const std::vector<bool>& violInd, const GAMSSymbolRecord& violRec);
private:
    std::shared_ptr<GAMSSymbolDomainViolationImpl> mImpl;
};

} // namespace gams

#endif // GAMSSYMBOLDOMAINVIOLATION_H


text:
package com.iaskdata.interceptor;

import java.util.Arrays;

import com.iaskdata.util.Constant;
import com.jfinal.aop.Invocation;
import com.jfinal.aop.PrototypeInterceptor;
import com.jfinal.core.Controller;

/**
 * 接口方法验证拦截器
 * @author jiangzhx@gmail.com
 * @date 2015年7月16日
 */
public class MethodInterceptor extends PrototypeInterceptor {

	@Override
	public void doIntercept(Invocation invocation) {
	    String actionKey = invocation.getActionKey();

		Controller controller = invocation.getController();

        String method = controller.getPara();

        boolean result = false;
        if ("/rest".equals(actionKey)) {
            result = contains(Constant.rest, method);
            if (! result ) {
                controller.setAttr("message", "The REST sdk available method: " + Arrays.toString(Constant.rest));
            }
        }  else {
            result = true;
        }

        if (result) {
            invocation.invoke();
        } else {
            controller.setAttr("status", -1);
            controller.render("", 404);
        }
	}

	private boolean contains(String[] arr, String targetValue) {
        if (Arrays.binarySearch(arr, targetValue) >= 0)
            return true;
        else
            return false;
    }
}


text:
CGImageRef CGImageFromJPEGData(CFDataRef data) {
    CFRetain(data);
    CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, CFDataGetBytePtr(data), CFDataGetLength(data), NULL);;
    CGImageSourceRef source = CGImageSourceCreateWithDataProvider(provider, NULL);

    NSDictionary *options = @{(NSString *)kCGImageSourceCreateThumbnailFromImageAlways : @YES,
                              (NSString *)kCGImageSourceCreateThumbnailWithTransform : @YES,
                             };
    CGImageRef imageRef = CGImageSourceCreateThumbnailAtIndex(source, 0, (__bridge CFDictionaryRef)options);
    CFRelease(source);
    CFRelease(provider);
    CFRelease(data);
    return imageRef;
}

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *yolo;

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.yolo.image = [UIImage imageWithWebPNamed:@"4"];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)benchmarkPressed:(id)sender {
    NSString *webPFile = [[NSBundle mainBundle] pathForResource:@"4" ofType:@"webp"];
    NSData *webPData = [NSData dataWithContentsOfFile:webPFile];

    uint64_t startTime = mach_absolute_time();
    for (NSInteger i=0; i < 100; i++) {
        CGImageRef img = CGImageFromWebPData((__bridge CFDataRef)(webPData));
        CGImageRelease(img);
    }

    uint64_t endTime = mach_absolute_time();
    mach_timebase_info_data_t info;
    mach_timebase_info(&info);

    double elapsedNSWebP = (double)(endTime - startTime) * (double)info.numer / (double)info.denom;
    NSLog(@"Decoding WebP 100 times: %f ms", elapsedNSWebP / 1000.0 / 1000.0);

    NSString *jpegFile = [[NSBundle mainBundle] pathForResource:@"4" ofType:@"jpg"];
    NSData *jpegData = [NSData dataWithContentsOfFile:jpegFile];

    startTime = mach_absolute_time();
    for (NSInteger i = 0; i < 100; i++) {
        CGImageRef img = CGImageFromJPEGData((__bridge CFDataRef)(jpegData));
        CGImageRelease(img);
    }
    endTime = mach_absolute_time();

    double elapsedNSJPEG = (double)(endTime - startTime) * (double)info.numer / (double)info.denom;
    NSLog(@"Decoding JPEG 100 times: %f ms", elapsedNSJPEG / 1000.0 / 1000.0);
}

@end


text:
"""Base Spout classes."""
from ipc import read_handshake, read_command, send_message, json, _stdout
from base import Component

class Spout(Component):
    """Base class for all streamparse spouts.

    For more information on spouts, consult Storm's
    `Concepts documentation <http://storm.incubator.apache.org/documentation/Concepts.html>`_.
    """

    def initialize(self, storm_conf, context):
        """Called immediately after the initial handshake with Storm and before
        the main run loop. A good place to initialize connections to data
        sources.

        :param storm_conf: the Storm configuration for this Bolt.  This is the
                           configuration provided to the topology, merged in
                           with cluster configuration on the worker node.
        :type storm_conf: dict
        :param context: information about the component's place within the
                        topology such as: task IDs, inputs, outputs etc.
        :type context: dict
        """
        pass

    def ack(self, tup_id):
        """Called when a bolt acknowledges a tuple in the topology.

        :param tup_id: the ID of the tuple that has been fully acknowledged in
                       the topology.
        :type tup_id: str
        """
        pass

    def fail(self, tup_id):
        """Called when a tuple fails in the topology

        A Spout can choose to emit the tuple again or ignore the fail. The
        default is to ignore.

        :param tup_id: the ID of the tuple that has failed in the topology
                       either due to a bolt calling ``fail()`` or a tuple
                       timing out.
        :type tup_id: str
        """
        pass

    def next_tuple(self):
        """Implement this function to emit tuples as necessary.

        This function should not block, or Storm will think the
        spout is dead. Instead, let it return and streamparse will
        send a noop to storm, which lets it know the spout is functioning.
        """
        raise NotImplementedError()

    def emit(self, tup, tup_id=None, stream=None, direct_task=None):
        """Emit a spout tuple message.

        :param tup: the tuple to send to Storm.  Should contain only
                    JSON-serializable data.
        :type tup: list
        :param tup_id: the ID for the tuple. Leave this blank for an
                       unreliable emit.
        :type tup_id: str
        :param stream: ID of the stream this tuple should be emitted to.
                       Leave empty to emit to the default stream.
        :type stream: str
        :param direct_task: the task to send the tuple to if performing a
                            direct emit.
        :type direct_task: int
        """
        if not isinstance(tup, list):
            raise TypeError('All tuples must be lists, received {!r} instead'
                            .format(type(tup)))

        msg = {'command': 'emit', 'tuple': tup}
        if tup_id is not None:
            msg['id'] = tup_id
        if stream is not None:
            msg['stream'] = stream
        if direct_task is not None:
            msg['task'] = direct_task

        send_message(msg)

    def emit_many(self, tuples, tup_id=None, stream=None, direct_task=None):
        """A more efficient way to send many tuples.

        Dumps out all tuples to STDOUT instead of writing one at a time.

        :param tuples: a two-dimensional ``list`` representing the tuples to
                       send to Storm.  Tuples should contain only
                       JSON-serializable data.
        :type tuples: list
        :param tup_id: the id for the tuple.  Leave this blank for unreliable
                       emits.
        :type tup_id: str
        :param stream: ID of the stream these tuples should be emitted to.
                       Leave empty to emit to the default stream.
        :type stream: str
        :param direct_task: the task to send the tuple to if
                            performing a direct emit.
        :type direct_task: int
        """
        msg = {
            'command': 'emit',
        }
        if tup_id is not None:
            msg['id'] = tup_id
        if stream is not None:
            msg['stream'] = stream
        if direct_task is not None:
            msg['task'] = direct_task

        lines = []
        for tup in tuples:
            msg['tuple'] = tup
            lines.append(json.dumps(msg))
        _stdout.write("{}\nend\n".format("\nend\n".join(lines)))
        _stdout.flush()

    def run(self):
        """Main run loop for all spouts.

        Performs initial handshake with Storm and reads tuples handing them off
        to subclasses.  Any exceptions are caught and logged back to Storm
        prior to the Python process exiting.

        Subclasses should **not** override this method.
        """
        storm_conf, context = read_handshake()
        try:
            self.initialize(storm_conf, context)
            while True:
                cmd = read_command()
                if cmd['command'] == 'next':
                    self.next_tuple()
                if cmd['command'] == 'ack':
                    self.ack(cmd['id'])
                if cmd['command'] == 'fail':
                    self.fail(cmd['id'])
                send_message({'command': 'sync'})
        except Exception as e:
            self.raise_exception(e)


text:
//Literal tokens scanner graph classes definition.

#ifndef SYN_CORE_CONCRETESCAN_H_INCLUDED
#define SYN_CORE_CONCRETESCAN_H_INCLUDED

#include <list>
#include <memory>
#include <ostream>

#include "descriptor.h"
#include "util_mptr.h"

namespace synbin {

	class ConcreteScanGenerator;
	class ConcreteScanEdge;

	//
	//ConcreteScanNode
	//

	//Literal tokens scanner state graph node.
	class ConcreteScanNode {
		friend class ConcreteScanGenerator;

	public:
		typedef std::list<ConcreteScanEdge> EdgeList;

	private:
		//Pointer to the token accepted in this state, or nullptr, if the state does not accept any tokens.
		const StrTrDescriptor* m_token;

		//List of edges.
		EdgeList m_edges;

	public:
		ConcreteScanNode() : m_token(){}

		const StrTrDescriptor* get_token() const;
		const EdgeList& get_edges() const;

		void print(std::ostream& out, std::size_t indent) const;

	private:
		ConcreteScanNode* add_edge(char ch);
		void set_token(const StrTrDescriptor* token);
	};

	//
	//ConcreteScanEdge
	//

	//Literal tokens scanner state graph edge.
	class ConcreteScanEdge {
		friend class ConcreteScanNode;

		//The character associated with the edge.
		const char m_ch;

		//The destination state node.
		ConcreteScanNode m_node;

	public:
		ConcreteScanEdge(char ch);

		char get_ch() const;
		const ConcreteScanNode* get_node() const;

		void print(std::ostream& out, std::size_t indent) const;

	private:
		ConcreteScanNode* get_node_mutable();
	};

	//
	//build_concrete_scan_tree()
	//

	std::unique_ptr<ConcreteScanNode> build_concrete_scan_tree(const std::vector<const StrTrDescriptor*>& tokens);

}

#endif//SYN_CORE_CONCRETESCAN_H_INCLUDED


text:
'use strict'

// var distance = require('./centimeter')

// distance.set('link', 'centimeter', 1 / 0.049709695)

// module.exports = distance

module.exports = ['link', 'centimeter', 1 / 0.049709695]