text:
from gi.repository import Gtk
from gi.repository import Gdk

import pyatspi
from queue import Queue
from time import time

class _CommandsQueue(Queue):
  def __init__(self):
    Queue.__init__(self)
    self.virgin = True
  def put(self, item, block=True, timeout=None):
    Queue.put(self, item, block, timeout)
    self.virgin = False

class ScriptFactory(object):
  '''
  Abstract class for a script factory. Classes of specific platforms like
  dogtail are derived from this.

  @cvar intepreter_line: The top intepreter line
  @type intepreter_line: string
  @cvar import_line: The import line for the specific platform
  @type import_line: strin
  @cvar MODIFIERS: Key symbols that are considered modifiers.
  @type MODIFIERS: list

  @ivar commands_queue: The commands that are being produced by the facory.
  @type commands_queue: Queue.Queue
  @ivar app_name: The last focused application name
  @type app_name: string
  @ivar frame_name: The last focused window frame name.
  @type frame_name: string.
  '''
  intepreter_line = '#!/usr/bin/python3.2'
  import_line = ''
  MODIFIERS = [Gdk.KEY_Control_L, Gdk.KEY_Control_R,
               Gdk.KEY_Alt_L, Gdk.KEY_Alt_R,
               Gdk.KEY_Super_L, Gdk.KEY_Super_R,
               Gdk.KEY_Shift_L, Gdk.KEY_Shift_R]

  def __init__(self):
    '''
    Initialize the script factory.
    '''
    self.commands_queue = _CommandsQueue()
    self.app_name = ''
    self.frame_name = ''

  def keyPressCommand(self, event):
    '''
    Processing key presses in to commands

    @param event: The keypress at-spi event.
    @type event: Accessibility.DeviceEvent
    '''
    pass

  def keyReleaseCommand(self, event):
    '''
    Processing key releases in to commands

    @param event: The key release at-spi event.
    @type event: Accessibility.DeviceEvent
    '''
    pass

  def windowActivateCommand(self, event):
    '''
    Store the focus event source's application name and frame name.

    @param event: The at-spi focus event.
    @type event: Accessibility.Event
    '''
    app = event.source.getApplication()
    if app:
      self.app_name = app.name
    self.frame_name = event.source.name

  def focusCommand(self):
    pass

  def docLoadCommand(self):
    pass

  def terminateScript(self):
    self.commands_queue.virgin = True

class SequenceFactory(ScriptFactory):
  import_line = \
      'from macaroon.playback import *\n\nsequence = MacroSequence()'
  def __init__(self, wait_for_focus=False):
    '''
    Initialize the object.
    '''
    ScriptFactory.__init__(self)
    self._time = 0
    if wait_for_focus:
      self._focus_comment = ''
    else:
      self._focus_comment = '#'
  def _getDelta(self):
    current_time = time()
    delta = current_time - self._time
    self._time = current_time
    if delta == current_time: delta = 0
    return int(delta*1000)
  def terminateScript(self):
    self.commands_queue.put_nowait('\nsequence.start()\n')
    ScriptFactory.terminateScript(self)

class Level2SequenceFactory(SequenceFactory):
  def __init__(self, wait_for_focus=False):
    SequenceFactory.__init__(self, wait_for_focus)
    self.typed_text = ''
    self.last_focused = None
    self.frame_name = ''
    self._last_app = None

  def keyPressCommand(self, event):
    if event.id in self.MODIFIERS or \
          (event.event_string.startswith('ISO') and \
             event.event_string != 'ISO_Left_Tab'):
      return
    if isinstance(event, pyatspi.deviceevent.DeviceEvent):
      # If it's a fake one, then it is a global WM hotkey, no need for context.
      self._prependContext()
    if event.modifiers in (0, Gdk.ModifierType.SHIFT_MASK) and \
          Gdk.keyval_to_unicode(event.id):
      self.typed_text += chr(Gdk.keyval_to_unicode(event.id))
    else:
      if self.frame_name:
        if isinstance(event, pyatspi.deviceevent.DeviceEvent):
          self.commands_queue.put_nowait(
            'sequence.append(WaitForWindowActivate("%s", None))\n' % \
              self.frame_name.replace('"','\"'))
        self.frame_name = ''
      if self.last_focused:
        name, path, role = self.last_focused
        self.commands_queue.put_nowait(
            '%ssequence.append(WaitForFocus("%s", acc_role=pyatspi.%s))\n' % \
            (self._focus_comment, name.replace('"','\"'), repr(role)))
        self.last_focused = None
      if self.typed_text:
        self.commands_queue.put_nowait(
          'sequence.append(TypeAction("%s"))\n' % \
            self.typed_text.replace('"','\"'))
        self.typed_text = ''
      self.commands_queue.put_nowait(
        'sequence.append(KeyComboAction("%s"))\n' % \
          Gtk.accelerator_name(event.id, Gdk.ModifierType(event.modifiers)))

  def focusCommand(self, event):
    try:
      path = pyatspi.getPath(event.source)
    except RuntimeError:
      path = []
    self.last_focused = (event.source.name,
                         path,
                         event.source.getRole())

  def windowActivateCommand(self, event):
    app = event.source.getApplication()
    if app is None:
      self.frame_name = event.source.name
      return
    if self._last_app == app.name:
      return
    else:
      self._last_app = app.name
    self.frame_name = event.source.name

  def docLoadCommand(self):
    print('factory thing')
    self.commands_queue.put_nowait(
      'sequence.append(WaitForDocLoad())\n')

  def _prependContext(self):
    if not self.frame_name and self.commands_queue.virgin:
      self.frame_name = self._getActiveFrameName()
    if self.frame_name:
      self.commands_queue.put_nowait(
        'sequence.append(WaitForWindowActivate("%s",None))\n' % \
          self.frame_name)
      self.frame_name = ''

  def _getActiveFrameName(self):
    desktop = pyatspi.Registry.getDesktop(0)
    active_frame = None
    for app in desktop:
      if not app: continue
      for acc in app:
        if acc is None: continue
        if acc.getRole() == pyatspi.ROLE_FRAME:
          state_set = acc.getState()
          if state_set.contains(pyatspi.STATE_ACTIVE):
            active_frame = acc
          state_set.unref()
          if active_frame is not None:
            return active_frame.name
    return ''

  def terminateScript(self):
    if self.typed_text:
      self._prependContext()
      self.commands_queue.put_nowait(
        'sequence.append(TypeAction           ("%s"))\n' % self.typed_text)
    SequenceFactory.terminateScript(self)

class Level1SequenceFactory(SequenceFactory):
  def keyPressCommand(self, event):
    delta = self._getDelta()
    self.commands_queue.put_nowait(
      'sequence.append(KeyPressAction(%d, %d, "%s")) # Press %s\n' % \
        (delta, event.hw_code, event.event_string, event.event_string))
  def keyReleaseCommand(self, event):
    delta = self._getDelta()
    self.commands_queue.put_nowait(
      'sequence.append(KeyReleaseAction(%d, %d, "%s")) # Release %s\n' % \
        (delta, event.hw_code, event.event_string, event.event_string))
  def windowActivateCommand(self, event):
    self.commands_queue.put_nowait(
      'sequence.append(WaitForWindowActivate("%s", None))\n' % \
        event.source.name)
  def focusCommand(self, event):
    self.commands_queue.put_nowait(
      '%ssequence.append(WaitForFocus("%s", acc_role=pyatspi.%s))\n' % \
        (self._focus_comment, event.source.name,
         event.source.getRole().value_name.replace("ATSPI_", "")))

class DogtailFactory(ScriptFactory):
  '''
  Script factory for dogtail scripts.

  @ivar typed_text: Plain text that has been typed so far.
  @type typed_text: string
  '''
  import_line = 'from dogtail.procedural import *'
  def __init__(self):
    '''
    Initialize the object.
    '''
    ScriptFactory.__init__(self)
    self.typed_text = ''

  def keyPressCommand(self, event):
    '''
    Create command lines for variuos key presses.

    @param event: Key press at-spi event.
    @type event: Accessibility.DeviceEvent
    '''
    if event.id in self.MODIFIERS or \
          event.event_string.startswith('ISO'):
      return
    if event.modifiers in (0, Gdk.ModifierType.SHIFT_MASK) and \
          Gdk.keyval_to_unicode(event.id):
      self.typed_text += chr(Gdk.keyval_to_unicode(event.id))
    else:
      if self.app_name:
        self.commands_queue.put_nowait('focus.application("%s")\n' % \
                                         self.app_name)
        self.app_name = ''
      if self.frame_name:
        self.commands_queue.put_nowait('focus.frame("%s")\n' % \
                                         self.frame_name)
        self.frame_name = ''
      if self.typed_text:
        self.commands_queue.put_nowait('type("%s")\n' % \
                                         self.typed_text)
        self.typed_text = ''
      self.commands_queue.put_nowait('keyCombo("%s")\n' % \
                                       Gtk.accelerator_name(event.id,
                                                            Gdk.ModifierType(event.modifiers)))

class NativeFactory(DogtailFactory):
  '''
  Script factory for native scripts. Besides the import line,
  it should be identical to dogtail scripts.
  '''
  import_line = 'from accerciser.script_playback import *'

class LDTPFactory(DogtailFactory):
  '''
  Script factory for LDTP scripts.

  @ivar typed_text: Plain text that has been typed so far.
  @type typed_text: string
  '''
  import_line = 'from ldtp import *'
  def __init__(self):
    '''
    Initialize the object.
    '''
    ScriptFactory.__init__(self)
    self.typed_text = ''

  def keyPressCommand(self, event):
    '''
    Create command lines for variuos key presses.

    @param event: Key press at-spi event.
    @type event: Accessibility.DeviceEvent
    '''
    if event.id in self.MODIFIERS or \
          event.event_string.startswith('ISO'):
      return
    if event.modifiers in (0, Gdk.ModifierType.SHIFT_MASK) and \
          Gdk.keyval_to_unicode(event.id):
      self.typed_text += chr(Gdk.keyval_to_unicode(event.id))
    else:
      if self.frame_name:
        self.commands_queue.put_nowait('waittillguiexist("%s")\n' % \
                                         self.frame_name)
        self.frame_name = ''
      if self.typed_text:
        self.commands_queue.put_nowait('generatekeyevent("%s")\n' % \
                                         self.typed_text)
        self.typed_text = ''
      self.commands_queue.put_nowait('generatekeyevent("%s")\n' % \
                                       Gtk.accelerator_name(event.id,
                                                            Gdk.ModifierType(event.modifiers)))


text:
begin
  require 'kgio'
  puts "Using kgio socket IO" if $TESTING

  class Dalli::Server::KSocket < Kgio::Socket
    attr_accessor :options

    def kgio_wait_readable
      IO.select([self], nil, nil, options[:timeout]) || raise(Timeout::Error, "IO timeout")
    end

    def kgio_wait_writable
      IO.select(nil, [self], nil, options[:timeout]) || raise(Timeout::Error, "IO timeout")
    end

    def self.open(host, port, options = {})
      addr = Socket.pack_sockaddr_in(port, host)
      sock = start(addr)
      sock.options = options
      sock.kgio_wait_writable
      sock
    end

    alias :write :kgio_write

    def readfull(count)
      value = ''
      loop do
        value << kgio_read!(count - value.bytesize)
        break if value.bytesize == count
      end
      value
    end

  end

  if ::Kgio.respond_to?(:wait_readable=)
    ::Kgio.wait_readable = :kgio_wait_readable
    ::Kgio.wait_writable = :kgio_wait_writable
  end

rescue LoadError

  puts "Using standard socket IO (#{RUBY_DESCRIPTION})" if $TESTING
  if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'

    class Dalli::Server::KSocket < TCPSocket
      def self.open(host, port, options = {})
        new(host, port)
      end

      def readfull(count)
        value = ''
        begin
          loop do
            value << sysread(count - value.bytesize)
            break if value.bytesize == count
          end
        rescue Errno::EAGAIN, Errno::EWOULDBLOCK
          if IO.select([self], nil, nil, options[:timeout])
            retry
          else
            raise Timeout::Error, "IO timeout"
          end
        end
        value
      end

    end

  else

    class Dalli::Server::KSocket < Socket
      attr_accessor :options

      def self.open(host, port, options = {})
        # All this ugly code to ensure proper Socket connect timeout
        addr = Socket.getaddrinfo(host, nil)
        sock = new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0)
        sock.options = options
        begin
          sock.connect_nonblock(Socket.pack_sockaddr_in(port, addr[0][3]))
        rescue Errno::EINPROGRESS
          resp = IO.select(nil, [sock], nil, sock.options[:timeout])
          begin
            sock.connect_nonblock(Socket.pack_sockaddr_in(port, addr[0][3]))
          rescue Errno::EISCONN
          end
        end
        sock
      end

      def readfull(count)
        value = ''
        begin
          loop do
            value << sysread(count - value.bytesize)
            break if value.bytesize == count
          end
        rescue Errno::EAGAIN, Errno::EWOULDBLOCK
          if IO.select([self], nil, nil, options[:timeout])
            retry
          else
            raise Timeout::Error, "IO timeout"
          end
        end
        value
      end
    end

  end

end

redpajama_set_name: RedPajamaGithub


text:
export LD_LIBRARY_PATH=../../src
export DYLD_FALLBACK_LIBRARY_PATH=../../src
./qlcphysical_test


text:
var PMP = PMP || {};

(function() {
    var $ = jQuery;

    PMP.instances = PMP.instances || {};

    PMP.DeleteSavedSearchModal = PMP.Modal.extend({
        action: 'pmp_delete_saved_query',

        content: 'Are you sure you want to delete this saved search query?',

        actions: {
            'Yes': 'deleteQuery',
            'Cancel': 'close'
        },

        initialize: function(options) {
            this.search_id = options.search_id;
            PMP.Modal.prototype.initialize.apply(this, arguments);
        },

        deleteQuery: function() {
            if (typeof this.ongoing !== 'undefined' && $.inArray(this.ongoing.state(), ['resolved', 'rejected']) == -1)
                return false;

            var self = this,
                data = {
                    action: this.action,
                    security: PMP.ajax_nonce,
                    data: JSON.stringify({
                        search_id: this.search_id
                    })
                };

            var opts = {
                url: ajaxurl,
                dataType: 'json',
                data: data,
                method: 'post',
                success: function(data) {
                    self.hideSpinner();
                    self.close();
                    $('div[data-search-id="' + self.search_id + '"]').remove();
                },
                error: function() {
                    self.hideSpinner();
                    alert('Something went wrong. Please try again.');
                }
            };

            this.showSpinner();
            this.ongoing = $.ajax(opts);
            return this.ongoing;
        }
    });

    $(document).ready(function() {
        $('a.pmp-delete-saved-search').click(function() {
            var search_id = $(this).data('search-id');
            PMP.instances.delete_saved_search_modal = new PMP.DeleteSavedSearchModal({
                search_id: search_id
            });
            PMP.instances.delete_saved_search_modal.render();
        });
    });
})();


text:
<?php
  require_once 'partials/_header.php';
  setcookie('remember', NULL, -1);
  unset($_SESSION['auth']);
  unset($_SESSION['csrf']);
  $_SESSION['flash']['success'] = 'Vous êtes maintenant déconnecté';
  redirection_link('login');
?>


text:
    <input
        type="text"
        ppSearchInput
        placeholder="search pTxId"
        class="l-search-input"
        [useEnter]="searchUseEnter"
        (outSearch)="onSearchId($event)"
        #searchInput>
    <button class="l-search-button fas fa-search" (click)="onSearchId(searchInput.value.trim())"></button>
    <ng-container *ngIf="coord">

    </ng-container>


text:
#pragma once
#include <aws/amplify/Amplify_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <aws/amplify/model/Platform.h>
#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/amplify/model/ProductionBranch.h>
#include <aws/amplify/model/AutoBranchCreationConfig.h>
#include <aws/amplify/model/RepositoryCloneMethod.h>
#include <aws/amplify/model/CustomRule.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace Amplify
{
namespace Model
{

  /**
   *
 Represents the different branches of a repository for building, deploying,
   * and hosting an Amplify app.

See Also:
   AWS API
   * Reference

   */
  class AWS_AMPLIFY_API App
  {
  public:
    App();
    App(Aws::Utils::Json::JsonView jsonValue);
    App& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
 The unique ID of the Amplify app.

     */
    inline const Aws::String& GetAppId() const{ return m_appId; }

    /**
     *
 The unique ID of the Amplify app.

     */
    inline bool AppIdHasBeenSet() const { return m_appIdHasBeenSet; }

    /**
     *
 The unique ID of the Amplify app.

     */
    inline void SetAppId(const Aws::String& value) { m_appIdHasBeenSet = true; m_appId = value; }

    /**
     *
 The unique ID of the Amplify app.

     */
    inline void SetAppId(Aws::String&& value) { m_appIdHasBeenSet = true; m_appId = std::move(value); }

    /**
     *
 The unique ID of the Amplify app.

     */
    inline void SetAppId(const char* value) { m_appIdHasBeenSet = true; m_appId.assign(value); }

    /**
     *
 The unique ID of the Amplify app.

     */
    inline App& WithAppId(const Aws::String& value) { SetAppId(value); return *this;}

    /**
     *
 The unique ID of the Amplify app.

     */
    inline App& WithAppId(Aws::String&& value) { SetAppId(std::move(value)); return *this;}

    /**
     *
 The unique ID of the Amplify app.

     */
    inline App& WithAppId(const char* value) { SetAppId(value); return *this;}

    /**
     *
 The Amazon Resource Name (ARN) of the Amplify app.

     */
    inline const Aws::String& GetAppArn() const{ return m_appArn; }

    /**
     *
 The Amazon Resource Name (ARN) of the Amplify app.

     */
    inline bool AppArnHasBeenSet() const { return m_appArnHasBeenSet; }

    /**
     *
 The Amazon Resource Name (ARN) of the Amplify app.

     */
    inline void SetAppArn(const Aws::String& value) { m_appArnHasBeenSet = true; m_appArn = value; }

    /**
     *
 The Amazon Resource Name (ARN) of the Amplify app.

     */
    inline void SetAppArn(Aws::String&& value) { m_appArnHasBeenSet = true; m_appArn = std::move(value); }

    /**
     *
 The Amazon Resource Name (ARN) of the Amplify app.

     */
    inline void SetAppArn(const char* value) { m_appArnHasBeenSet = true; m_appArn.assign(value); }

    /**
     *
 The Amazon Resource Name (ARN) of the Amplify app.

     */
    inline App& WithAppArn(const Aws::String& value) { SetAppArn(value); return *this;}

    /**
     *
 The Amazon Resource Name (ARN) of the Amplify app.

     */
    inline App& WithAppArn(Aws::String&& value) { SetAppArn(std::move(value)); return *this;}

    /**
     *
 The Amazon Resource Name (ARN) of the Amplify app.

     */
    inline App& WithAppArn(const char* value) { SetAppArn(value); return *this;}

    /**
     *
 The name for the Amplify app.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
 The name for the Amplify app.

     */
    inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }

    /**
     *
 The name for the Amplify app.

     */
    inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }

    /**
     *
 The name for the Amplify app.

     */
    inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }

    /**
     *
 The name for the Amplify app.

     */
    inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }

    /**
     *
 The name for the Amplify app.

     */
    inline App& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
 The name for the Amplify app.

     */
    inline App& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}

    /**
     *
 The name for the Amplify app.

     */
    inline App& WithName(const char* value) { SetName(value); return *this;}

    /**
     *
 The tag for the Amplify app.

     */
    inline const Aws::Map<Aws::String, Aws::String>& GetTags() const{ return m_tags; }

    /**
     *
 The tag for the Amplify app.

     */
    inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }

    /**
     *
 The tag for the Amplify app.

     */
    inline void SetTags(const Aws::Map<Aws::String, Aws::String>& value) { m_tagsHasBeenSet = true; m_tags = value; }

    /**
     *
 The tag for the Amplify app.

     */
    inline void SetTags(Aws::Map<Aws::String, Aws::String>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }

    /**
     *
 The tag for the Amplify app.

     */
    inline App& WithTags(const Aws::Map<Aws::String, Aws::String>& value) { SetTags(value); return *this;}

    /**
     *
 The tag for the Amplify app.

     */
    inline App& WithTags(Aws::Map<Aws::String, Aws::String>&& value) { SetTags(std::move(value)); return *this;}

    /**
     *
 The tag for the Amplify app.

     */
    inline App& AddTags(const Aws::String& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; }

    /**
     *
 The tag for the Amplify app.

     */
    inline App& AddTags(Aws::String&& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; }

    /**
     *
 The tag for the Amplify app.

     */
    inline App& AddTags(const Aws::String& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; }

    /**
     *
 The tag for the Amplify app.

     */
    inline App& AddTags(Aws::String&& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), std::move(value)); return *this; }

    /**
     *
 The tag for the Amplify app.

     */
    inline App& AddTags(const char* key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; }

    /**
     *
 The tag for the Amplify app.

     */
    inline App& AddTags(Aws::String&& key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; }

    /**
     *
 The tag for the Amplify app.

     */
    inline App& AddTags(const char* key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; }

    /**
     *
 The description for the Amplify app.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
 The description for the Amplify app.

     */
    inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }

    /**
     *
 The description for the Amplify app.

     */
    inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }

    /**
     *
 The description for the Amplify app.

     */
    inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); }

    /**
     *
 The description for the Amplify app.

     */
    inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }

    /**
     *
 The description for the Amplify app.

     */
    inline App& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
 The description for the Amplify app.

     */
    inline App& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}

    /**
     *
 The description for the Amplify app.

     */
    inline App& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
 The Git repository for the Amplify app.

     */
    inline const Aws::String& GetRepository() const{ return m_repository; }

    /**
     *
 The Git repository for the Amplify app.

     */
    inline bool RepositoryHasBeenSet() const { return m_repositoryHasBeenSet; }

    /**
     *
 The Git repository for the Amplify app.

     */
    inline void SetRepository(const Aws::String& value) { m_repositoryHasBeenSet = true; m_repository = value; }

    /**
     *
 The Git repository for the Amplify app.

     */
    inline void SetRepository(Aws::String&& value) { m_repositoryHasBeenSet = true; m_repository = std::move(value); }

    /**
     *
 The Git repository for the Amplify app.

     */
    inline void SetRepository(const char* value) { m_repositoryHasBeenSet = true; m_repository.assign(value); }

    /**
     *
 The Git repository for the Amplify app.

     */
    inline App& WithRepository(const Aws::String& value) { SetRepository(value); return *this;}

    /**
     *
 The Git repository for the Amplify app.

     */
    inline App& WithRepository(Aws::String&& value) { SetRepository(std::move(value)); return *this;}

    /**
     *
 The Git repository for the Amplify app.

     */
    inline App& WithRepository(const char* value) { SetRepository(value); return *this;}

    /**
     *
 The platform for the Amplify app. For a static app, set the platform type to
     * WEB. For a dynamic server-side rendered (SSR) app, set the platform
     * type to WEB_COMPUTE. For an app requiring Amplify Hosting's
     * original SSR support only, set the platform type to
     * WEB_DYNAMIC.

     */
    inline const Platform& GetPlatform() const{ return m_platform; }

    /**
     *
 The platform for the Amplify app. For a static app, set the platform type to
     * WEB. For a dynamic server-side rendered (SSR) app, set the platform
     * type to WEB_COMPUTE. For an app requiring Amplify Hosting's
     * original SSR support only, set the platform type to
     * WEB_DYNAMIC.

     */
    inline bool PlatformHasBeenSet() const { return m_platformHasBeenSet; }

    /**
     *
 The platform for the Amplify app. For a static app, set the platform type to
     * WEB. For a dynamic server-side rendered (SSR) app, set the platform
     * type to WEB_COMPUTE. For an app requiring Amplify Hosting's
     * original SSR support only, set the platform type to
     * WEB_DYNAMIC.

     */
    inline void SetPlatform(const Platform& value) { m_platformHasBeenSet = true; m_platform = value; }

    /**
     *
 The platform for the Amplify app. For a static app, set the platform type to
     * WEB. For a dynamic server-side rendered (SSR) app, set the platform
     * type to WEB_COMPUTE. For an app requiring Amplify Hosting's
     * original SSR support only, set the platform type to
     * WEB_DYNAMIC.

     */
    inline void SetPlatform(Platform&& value) { m_platformHasBeenSet = true; m_platform = std::move(value); }

    /**
     *
 The platform for the Amplify app. For a static app, set the platform type to
     * WEB. For a dynamic server-side rendered (SSR) app, set the platform
     * type to WEB_COMPUTE. For an app requiring Amplify Hosting's
     * original SSR support only, set the platform type to
     * WEB_DYNAMIC.

     */
    inline App& WithPlatform(const Platform& value) { SetPlatform(value); return *this;}

    /**
     *
 The platform for the Amplify app. For a static app, set the platform type to
     * WEB. For a dynamic server-side rendered (SSR) app, set the platform
     * type to WEB_COMPUTE. For an app requiring Amplify Hosting's
     * original SSR support only, set the platform type to
     * WEB_DYNAMIC.

     */
    inline App& WithPlatform(Platform&& value) { SetPlatform(std::move(value)); return *this;}

    /**
     *
 Creates a date and time for the Amplify app.

     */
    inline const Aws::Utils::DateTime& GetCreateTime() const{ return m_createTime; }

    /**
     *
 Creates a date and time for the Amplify app.

     */
    inline bool CreateTimeHasBeenSet() const { return m_createTimeHasBeenSet; }

    /**
     *
 Creates a date and time for the Amplify app.

     */
    inline void SetCreateTime(const Aws::Utils::DateTime& value) { m_createTimeHasBeenSet = true; m_createTime = value; }

    /**
     *
 Creates a date and time for the Amplify app.

     */
    inline void SetCreateTime(Aws::Utils::DateTime&& value) { m_createTimeHasBeenSet = true; m_createTime = std::move(value); }

    /**
     *
 Creates a date and time for the Amplify app.

     */
    inline App& WithCreateTime(const Aws::Utils::DateTime& value) { SetCreateTime(value); return *this;}

    /**
     *
 Creates a date and time for the Amplify app.

     */
    inline App& WithCreateTime(Aws::Utils::DateTime&& value) { SetCreateTime(std::move(value)); return *this;}

    /**
     *
 Updates the date and time for the Amplify app.

     */
    inline const Aws::Utils::DateTime& GetUpdateTime() const{ return m_updateTime; }

    /**
     *
 Updates the date and time for the Amplify app.

     */
    inline bool UpdateTimeHasBeenSet() const { return m_updateTimeHasBeenSet; }

    /**
     *
 Updates the date and time for the Amplify app.

     */
    inline void SetUpdateTime(const Aws::Utils::DateTime& value) { m_updateTimeHasBeenSet = true; m_updateTime = value; }

    /**
     *
 Updates the date and time for the Amplify app.

     */
    inline void SetUpdateTime(Aws::Utils::DateTime&& value) { m_updateTimeHasBeenSet = true; m_updateTime = std::move(value); }

    /**
     *
 Updates the date and time for the Amplify app.

     */
    inline App& WithUpdateTime(const Aws::Utils::DateTime& value) { SetUpdateTime(value); return *this;}

    /**
     *
 Updates the date and time for the Amplify app.

     */
    inline App& WithUpdateTime(Aws::Utils::DateTime&& value) { SetUpdateTime(std::move(value)); return *this;}

    /**
     *
 The AWS Identity and Access Management (IAM) service role for the Amazon
     * Resource Name (ARN) of the Amplify app.

     */
    inline const Aws::String& GetIamServiceRoleArn() const{ return m_iamServiceRoleArn; }

    /**
     *
 The AWS Identity and Access Management (IAM) service role for the Amazon
     * Resource Name (ARN) of the Amplify app.

     */
    inline bool IamServiceRoleArnHasBeenSet() const { return m_iamServiceRoleArnHasBeenSet; }

    /**
     *
 The AWS Identity and Access Management (IAM) service role for the Amazon
     * Resource Name (ARN) of the Amplify app.

     */
    inline void SetIamServiceRoleArn(const Aws::String& value) { m_iamServiceRoleArnHasBeenSet = true; m_iamServiceRoleArn = value; }

    /**
     *
 The AWS Identity and Access Management (IAM) service role for the Amazon
     * Resource Name (ARN) of the Amplify app.

     */
    inline void SetIamServiceRoleArn(Aws::String&& value) { m_iamServiceRoleArnHasBeenSet = true; m_iamServiceRoleArn = std::move(value); }

    /**
     *
 The AWS Identity and Access Management (IAM) service role for the Amazon
     * Resource Name (ARN) of the Amplify app.

     */
    inline void SetIamServiceRoleArn(const char* value) { m_iamServiceRoleArnHasBeenSet = true; m_iamServiceRoleArn.assign(value); }

    /**
     *
 The AWS Identity and Access Management (IAM) service role for the Amazon
     * Resource Name (ARN) of the Amplify app.

     */
    inline App& WithIamServiceRoleArn(const Aws::String& value) { SetIamServiceRoleArn(value); return *this;}

    /**
     *
 The AWS Identity and Access Management (IAM) service role for the Amazon
     * Resource Name (ARN) of the Amplify app.

     */
    inline App& WithIamServiceRoleArn(Aws::String&& value) { SetIamServiceRoleArn(std::move(value)); return *this;}

    /**
     *
 The AWS Identity and Access Management (IAM) service role for the Amazon
     * Resource Name (ARN) of the Amplify app.

     */
    inline App& WithIamServiceRoleArn(const char* value) { SetIamServiceRoleArn(value); return *this;}

    /**
     *
 The environment variables for the Amplify app.

     */
    inline const Aws::Map<Aws::String, Aws::String>& GetEnvironmentVariables() const{ return m_environmentVariables; }

    /**
     *
 The environment variables for the Amplify app.

     */
    inline bool EnvironmentVariablesHasBeenSet() const { return m_environmentVariablesHasBeenSet; }

    /**
     *
 The environment variables for the Amplify app.

     */
    inline void SetEnvironmentVariables(const Aws::Map<Aws::String, Aws::String>& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables = value; }

    /**
     *
 The environment variables for the Amplify app.

     */
    inline void SetEnvironmentVariables(Aws::Map<Aws::String, Aws::String>&& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables = std::move(value); }

    /**
     *
 The environment variables for the Amplify app.

     */
    inline App& WithEnvironmentVariables(const Aws::Map<Aws::String, Aws::String>& value) { SetEnvironmentVariables(value); return *this;}

    /**
     *
 The environment variables for the Amplify app.

     */
    inline App& WithEnvironmentVariables(Aws::Map<Aws::String, Aws::String>&& value) { SetEnvironmentVariables(std::move(value)); return *this;}

    /**
     *
 The environment variables for the Amplify app.

     */
    inline App& AddEnvironmentVariables(const Aws::String& key, const Aws::String& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(key, value); return *this; }

    /**
     *
 The environment variables for the Amplify app.

     */
    inline App& AddEnvironmentVariables(Aws::String&& key, const Aws::String& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(std::move(key), value); return *this; }

    /**
     *
 The environment variables for the Amplify app.

     */
    inline App& AddEnvironmentVariables(const Aws::String& key, Aws::String&& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(key, std::move(value)); return *this; }

    /**
     *
 The environment variables for the Amplify app.

     */
    inline App& AddEnvironmentVariables(Aws::String&& key, Aws::String&& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(std::move(key), std::move(value)); return *this; }

    /**
     *
 The environment variables for the Amplify app.

     */
    inline App& AddEnvironmentVariables(const char* key, Aws::String&& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(key, std::move(value)); return *this; }

    /**
     *
 The environment variables for the Amplify app.

     */
    inline App& AddEnvironmentVariables(Aws::String&& key, const char* value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(std::move(key), value); return *this; }

    /**
     *
 The environment variables for the Amplify app.

     */
    inline App& AddEnvironmentVariables(const char* key, const char* value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(key, value); return *this; }

    /**
     *
 The default domain for the Amplify app.

     */
    inline const Aws::String& GetDefaultDomain() const{ return m_defaultDomain; }

    /**
     *
 The default domain for the Amplify app.

     */
    inline bool DefaultDomainHasBeenSet() const { return m_defaultDomainHasBeenSet; }

    /**
     *
 The default domain for the Amplify app.

     */
    inline void SetDefaultDomain(const Aws::String& value) { m_defaultDomainHasBeenSet = true; m_defaultDomain = value; }

    /**
     *
 The default domain for the Amplify app.

     */
    inline void SetDefaultDomain(Aws::String&& value) { m_defaultDomainHasBeenSet = true; m_defaultDomain = std::move(value); }

    /**
     *
 The default domain for the Amplify app.

     */
    inline void SetDefaultDomain(const char* value) { m_defaultDomainHasBeenSet = true; m_defaultDomain.assign(value); }

    /**
     *
 The default domain for the Amplify app.

     */
    inline App& WithDefaultDomain(const Aws::String& value) { SetDefaultDomain(value); return *this;}

    /**
     *
 The default domain for the Amplify app.

     */
    inline App& WithDefaultDomain(Aws::String&& value) { SetDefaultDomain(std::move(value)); return *this;}

    /**
     *
 The default domain for the Amplify app.

     */
    inline App& WithDefaultDomain(const char* value) { SetDefaultDomain(value); return *this;}

    /**
     *
 Enables the auto-building of branches for the Amplify app.

     */
    inline bool GetEnableBranchAutoBuild() const{ return m_enableBranchAutoBuild; }

    /**
     *
 Enables the auto-building of branches for the Amplify app.

     */
    inline bool EnableBranchAutoBuildHasBeenSet() const { return m_enableBranchAutoBuildHasBeenSet; }

    /**
     *
 Enables the auto-building of branches for the Amplify app.

     */
    inline void SetEnableBranchAutoBuild(bool value) { m_enableBranchAutoBuildHasBeenSet = true; m_enableBranchAutoBuild = value; }

    /**
     *
 Enables the auto-building of branches for the Amplify app.

     */
    inline App& WithEnableBranchAutoBuild(bool value) { SetEnableBranchAutoBuild(value); return *this;}

    /**
     *
 Automatically disconnect a branch in the Amplify Console when you delete a
     * branch from your Git repository.

     */
    inline bool GetEnableBranchAutoDeletion() const{ return m_enableBranchAutoDeletion; }

    /**
     *
 Automatically disconnect a branch in the Amplify Console when you delete a
     * branch from your Git repository.

     */
    inline bool EnableBranchAutoDeletionHasBeenSet() const { return m_enableBranchAutoDeletionHasBeenSet; }

    /**
     *
 Automatically disconnect a branch in the Amplify Console when you delete a
     * branch from your Git repository.

     */
    inline void SetEnableBranchAutoDeletion(bool value) { m_enableBranchAutoDeletionHasBeenSet = true; m_enableBranchAutoDeletion = value; }

    /**
     *
 Automatically disconnect a branch in the Amplify Console when you delete a
     * branch from your Git repository.

     */
    inline App& WithEnableBranchAutoDeletion(bool value) { SetEnableBranchAutoDeletion(value); return *this;}

    /**
     *
 Enables basic authorization for the Amplify app's branches.

     */
    inline bool GetEnableBasicAuth() const{ return m_enableBasicAuth; }

    /**
     *
 Enables basic authorization for the Amplify app's branches.

     */
    inline bool EnableBasicAuthHasBeenSet() const { return m_enableBasicAuthHasBeenSet; }

    /**
     *
 Enables basic authorization for the Amplify app's branches.

     */
    inline void SetEnableBasicAuth(bool value) { m_enableBasicAuthHasBeenSet = true; m_enableBasicAuth = value; }

    /**
     *
 Enables basic authorization for the Amplify app's branches.

     */
    inline App& WithEnableBasicAuth(bool value) { SetEnableBasicAuth(value); return *this;}

    /**
     *
 The basic authorization credentials for branches for the Amplify app. You
     * must base64-encode the authorization credentials and provide them in the format
     * user:password.

     */
    inline const Aws::String& GetBasicAuthCredentials() const{ return m_basicAuthCredentials; }

    /**
     *
 The basic authorization credentials for branches for the Amplify app. You
     * must base64-encode the authorization credentials and provide them in the format
     * user:password.

     */
    inline bool BasicAuthCredentialsHasBeenSet() const { return m_basicAuthCredentialsHasBeenSet; }

    /**
     *
 The basic authorization credentials for branches for the Amplify app. You
     * must base64-encode the authorization credentials and provide them in the format
     * user:password.

     */
    inline void SetBasicAuthCredentials(const Aws::String& value) { m_basicAuthCredentialsHasBeenSet = true; m_basicAuthCredentials = value; }

    /**
     *
 The basic authorization credentials for branches for the Amplify app. You
     * must base64-encode the authorization credentials and provide them in the format
     * user:password.

     */
    inline void SetBasicAuthCredentials(Aws::String&& value) { m_basicAuthCredentialsHasBeenSet = true; m_basicAuthCredentials = std::move(value); }

    /**
     *
 The basic authorization credentials for branches for the Amplify app. You
     * must base64-encode the authorization credentials and provide them in the format
     * user:password.

     */
    inline void SetBasicAuthCredentials(const char* value) { m_basicAuthCredentialsHasBeenSet = true; m_basicAuthCredentials.assign(value); }

    /**
     *
 The basic authorization credentials for branches for the Amplify app. You
     * must base64-encode the authorization credentials and provide them in the format
     * user:password.

     */
    inline App& WithBasicAuthCredentials(const Aws::String& value) { SetBasicAuthCredentials(value); return *this;}

    /**
     *
 The basic authorization credentials for branches for the Amplify app. You
     * must base64-encode the authorization credentials and provide them in the format
     * user:password.

     */
    inline App& WithBasicAuthCredentials(Aws::String&& value) { SetBasicAuthCredentials(std::move(value)); return *this;}

    /**
     *
 The basic authorization credentials for branches for the Amplify app. You
     * must base64-encode the authorization credentials and provide them in the format
     * user:password.

     */
    inline App& WithBasicAuthCredentials(const char* value) { SetBasicAuthCredentials(value); return *this;}

    /**
     *
 Describes the custom redirect and rewrite rules for the Amplify app.

     */
    inline const Aws::Vector<CustomRule>& GetCustomRules() const{ return m_customRules; }

    /**
     *
 Describes the custom redirect and rewrite rules for the Amplify app.

     */
    inline bool CustomRulesHasBeenSet() const { return m_customRulesHasBeenSet; }

    /**
     *
 Describes the custom redirect and rewrite rules for the Amplify app.

     */
    inline void SetCustomRules(const Aws::Vector<CustomRule>& value) { m_customRulesHasBeenSet = true; m_customRules = value; }

    /**
     *
 Describes the custom redirect and rewrite rules for the Amplify app.

     */
    inline void SetCustomRules(Aws::Vector<CustomRule>&& value) { m_customRulesHasBeenSet = true; m_customRules = std::move(value); }

    /**
     *
 Describes the custom redirect and rewrite rules for the Amplify app.

     */
    inline App& WithCustomRules(const Aws::Vector<CustomRule>& value) { SetCustomRules(value); return *this;}

    /**
     *
 Describes the custom redirect and rewrite rules for the Amplify app.

     */
    inline App& WithCustomRules(Aws::Vector<CustomRule>&& value) { SetCustomRules(std::move(value)); return *this;}

    /**
     *
 Describes the custom redirect and rewrite rules for the Amplify app.

     */
    inline App& AddCustomRules(const CustomRule& value) { m_customRulesHasBeenSet = true; m_customRules.push_back(value); return *this; }

    /**
     *
 Describes the custom redirect and rewrite rules for the Amplify app.

     */
    inline App& AddCustomRules(CustomRule&& value) { m_customRulesHasBeenSet = true; m_customRules.push_back(std::move(value)); return *this; }

    /**
     *
 Describes the information about a production branch of the Amplify app.

     */
    inline const ProductionBranch& GetProductionBranch() const{ return m_productionBranch; }

    /**
     *
 Describes the information about a production branch of the Amplify app.

     */
    inline bool ProductionBranchHasBeenSet() const { return m_productionBranchHasBeenSet; }

    /**
     *
 Describes the information about a production branch of the Amplify app.

     */
    inline void SetProductionBranch(const ProductionBranch& value) { m_productionBranchHasBeenSet = true; m_productionBranch = value; }

    /**
     *
 Describes the information about a production branch of the Amplify app.

     */
    inline void SetProductionBranch(ProductionBranch&& value) { m_productionBranchHasBeenSet = true; m_productionBranch = std::move(value); }

    /**
     *
 Describes the information about a production branch of the Amplify app.

     */
    inline App& WithProductionBranch(const ProductionBranch& value) { SetProductionBranch(value); return *this;}

    /**
     *
 Describes the information about a production branch of the Amplify app.

     */
    inline App& WithProductionBranch(ProductionBranch&& value) { SetProductionBranch(std::move(value)); return *this;}

    /**
     *
 Describes the content of the build specification (build spec) for the
     * Amplify app.

     */
    inline const Aws::String& GetBuildSpec() const{ return m_buildSpec; }

    /**
     *
 Describes the content of the build specification (build spec) for the
     * Amplify app.

     */
    inline bool BuildSpecHasBeenSet() const { return m_buildSpecHasBeenSet; }

    /**
     *
 Describes the content of the build specification (build spec) for the
     * Amplify app.

     */
    inline void SetBuildSpec(const Aws::String& value) { m_buildSpecHasBeenSet = true; m_buildSpec = value; }

    /**
     *
 Describes the content of the build specification (build spec) for the
     * Amplify app.

     */
    inline void SetBuildSpec(Aws::String&& value) { m_buildSpecHasBeenSet = true; m_buildSpec = std::move(value); }

    /**
     *
 Describes the content of the build specification (build spec) for the
     * Amplify app.

     */
    inline void SetBuildSpec(const char* value) { m_buildSpecHasBeenSet = true; m_buildSpec.assign(value); }

    /**
     *
 Describes the content of the build specification (build spec) for the
     * Amplify app.

     */
    inline App& WithBuildSpec(const Aws::String& value) { SetBuildSpec(value); return *this;}

    /**
     *
 Describes the content of the build specification (build spec) for the
     * Amplify app.

     */
    inline App& WithBuildSpec(Aws::String&& value) { SetBuildSpec(std::move(value)); return *this;}

    /**
     *
 Describes the content of the build specification (build spec) for the
     * Amplify app.

     */
    inline App& WithBuildSpec(const char* value) { SetBuildSpec(value); return *this;}

    /**
     *
Describes the custom HTTP headers for the Amplify app.

     */
    inline const Aws::String& GetCustomHeaders() const{ return m_customHeaders; }

    /**
     *
Describes the custom HTTP headers for the Amplify app.

     */
    inline bool CustomHeadersHasBeenSet() const { return m_customHeadersHasBeenSet; }

    /**
     *
Describes the custom HTTP headers for the Amplify app.

     */
    inline void SetCustomHeaders(const Aws::String& value) { m_customHeadersHasBeenSet = true; m_customHeaders = value; }

    /**
     *
Describes the custom HTTP headers for the Amplify app.

     */
    inline void SetCustomHeaders(Aws::String&& value) { m_customHeadersHasBeenSet = true; m_customHeaders = std::move(value); }

    /**
     *
Describes the custom HTTP headers for the Amplify app.

     */
    inline void SetCustomHeaders(const char* value) { m_customHeadersHasBeenSet = true; m_customHeaders.assign(value); }

    /**
     *
Describes the custom HTTP headers for the Amplify app.

     */
    inline App& WithCustomHeaders(const Aws::String& value) { SetCustomHeaders(value); return *this;}

    /**
     *
Describes the custom HTTP headers for the Amplify app.

     */
    inline App& WithCustomHeaders(Aws::String&& value) { SetCustomHeaders(std::move(value)); return *this;}

    /**
     *
Describes the custom HTTP headers for the Amplify app.

     */
    inline App& WithCustomHeaders(const char* value) { SetCustomHeaders(value); return *this;}

    /**
     *
 Enables automated branch creation for the Amplify app.

     */
    inline bool GetEnableAutoBranchCreation() const{ return m_enableAutoBranchCreation; }

    /**
     *
 Enables automated branch creation for the Amplify app.

     */
    inline bool EnableAutoBranchCreationHasBeenSet() const { return m_enableAutoBranchCreationHasBeenSet; }

    /**
     *
 Enables automated branch creation for the Amplify app.

     */
    inline void SetEnableAutoBranchCreation(bool value) { m_enableAutoBranchCreationHasBeenSet = true; m_enableAutoBranchCreation = value; }

    /**
     *
 Enables automated branch creation for the Amplify app.

     */
    inline App& WithEnableAutoBranchCreation(bool value) { SetEnableAutoBranchCreation(value); return *this;}

    /**
     *
 Describes the automated branch creation glob patterns for the Amplify app.
     *

     */
    inline const Aws::Vector<Aws::String>& GetAutoBranchCreationPatterns() const{ return m_autoBranchCreationPatterns; }

    /**
     *
 Describes the automated branch creation glob patterns for the Amplify app.
     *

     */
    inline bool AutoBranchCreationPatternsHasBeenSet() const { return m_autoBranchCreationPatternsHasBeenSet; }

    /**
     *
 Describes the automated branch creation glob patterns for the Amplify app.
     *

     */
    inline void SetAutoBranchCreationPatterns(const Aws::Vector<Aws::String>& value) { m_autoBranchCreationPatternsHasBeenSet = true; m_autoBranchCreationPatterns = value; }

    /**
     *
 Describes the automated branch creation glob patterns for the Amplify app.
     *

     */
    inline void SetAutoBranchCreationPatterns(Aws::Vector<Aws::String>&& value) { m_autoBranchCreationPatternsHasBeenSet = true; m_autoBranchCreationPatterns = std::move(value); }

    /**
     *
 Describes the automated branch creation glob patterns for the Amplify app.
     *

     */
    inline App& WithAutoBranchCreationPatterns(const Aws::Vector<Aws::String>& value) { SetAutoBranchCreationPatterns(value); return *this;}

    /**
     *
 Describes the automated branch creation glob patterns for the Amplify app.
     *

     */
    inline App& WithAutoBranchCreationPatterns(Aws::Vector<Aws::String>&& value) { SetAutoBranchCreationPatterns(std::move(value)); return *this;}

    /**
     *
 Describes the automated branch creation glob patterns for the Amplify app.
     *

     */
    inline App& AddAutoBranchCreationPatterns(const Aws::String& value) { m_autoBranchCreationPatternsHasBeenSet = true; m_autoBranchCreationPatterns.push_back(value); return *this; }

    /**
     *
 Describes the automated branch creation glob patterns for the Amplify app.
     *

     */
    inline App& AddAutoBranchCreationPatterns(Aws::String&& value) { m_autoBranchCreationPatternsHasBeenSet = true; m_autoBranchCreationPatterns.push_back(std::move(value)); return *this; }

    /**
     *
 Describes the automated branch creation glob patterns for the Amplify app.
     *

     */
    inline App& AddAutoBranchCreationPatterns(const char* value) { m_autoBranchCreationPatternsHasBeenSet = true; m_autoBranchCreationPatterns.push_back(value); return *this; }

    /**
     *
 Describes the automated branch creation configuration for the Amplify app.
     *

     */
    inline const AutoBranchCreationConfig& GetAutoBranchCreationConfig() const{ return m_autoBranchCreationConfig; }

    /**
     *
 Describes the automated branch creation configuration for the Amplify app.
     *

     */
    inline bool AutoBranchCreationConfigHasBeenSet() const { return m_autoBranchCreationConfigHasBeenSet; }

    /**
     *
 Describes the automated branch creation configuration for the Amplify app.
     *

     */
    inline void SetAutoBranchCreationConfig(const AutoBranchCreationConfig& value) { m_autoBranchCreationConfigHasBeenSet = true; m_autoBranchCreationConfig = value; }

    /**
     *
 Describes the automated branch creation configuration for the Amplify app.
     *

     */
    inline void SetAutoBranchCreationConfig(AutoBranchCreationConfig&& value) { m_autoBranchCreationConfigHasBeenSet = true; m_autoBranchCreationConfig = std::move(value); }

    /**
     *
 Describes the automated branch creation configuration for the Amplify app.
     *

     */
    inline App& WithAutoBranchCreationConfig(const AutoBranchCreationConfig& value) { SetAutoBranchCreationConfig(value); return *this;}

    /**
     *
 Describes the automated branch creation configuration for the Amplify app.
     *

     */
    inline App& WithAutoBranchCreationConfig(AutoBranchCreationConfig&& value) { SetAutoBranchCreationConfig(std::move(value)); return *this;}

    /**
     *
This is for internal use.

The Amplify service uses this
     * parameter to specify the authentication protocol to use to access the Git
     * repository for an Amplify app. Amplify specifies TOKEN for a GitHub
     * repository, SIGV4 for an Amazon Web Services CodeCommit repository,
     * and SSH for GitLab and Bitbucket repositories.

     */
    inline const RepositoryCloneMethod& GetRepositoryCloneMethod() const{ return m_repositoryCloneMethod; }

    /**
     *
This is for internal use.

The Amplify service uses this
     * parameter to specify the authentication protocol to use to access the Git
     * repository for an Amplify app. Amplify specifies TOKEN for a GitHub
     * repository, SIGV4 for an Amazon Web Services CodeCommit repository,
     * and SSH for GitLab and Bitbucket repositories.

     */
    inline bool RepositoryCloneMethodHasBeenSet() const { return m_repositoryCloneMethodHasBeenSet; }

    /**
     *
This is for internal use.

The Amplify service uses this
     * parameter to specify the authentication protocol to use to access the Git
     * repository for an Amplify app. Amplify specifies TOKEN for a GitHub
     * repository, SIGV4 for an Amazon Web Services CodeCommit repository,
     * and SSH for GitLab and Bitbucket repositories.

     */
    inline void SetRepositoryCloneMethod(const RepositoryCloneMethod& value) { m_repositoryCloneMethodHasBeenSet = true; m_repositoryCloneMethod = value; }

    /**
     *
This is for internal use.

The Amplify service uses this
     * parameter to specify the authentication protocol to use to access the Git
     * repository for an Amplify app. Amplify specifies TOKEN for a GitHub
     * repository, SIGV4 for an Amazon Web Services CodeCommit repository,
     * and SSH for GitLab and Bitbucket repositories.

     */
    inline void SetRepositoryCloneMethod(RepositoryCloneMethod&& value) { m_repositoryCloneMethodHasBeenSet = true; m_repositoryCloneMethod = std::move(value); }

    /**
     *
This is for internal use.

The Amplify service uses this
     * parameter to specify the authentication protocol to use to access the Git
     * repository for an Amplify app. Amplify specifies TOKEN for a GitHub
     * repository, SIGV4 for an Amazon Web Services CodeCommit repository,
     * and SSH for GitLab and Bitbucket repositories.

     */
    inline App& WithRepositoryCloneMethod(const RepositoryCloneMethod& value) { SetRepositoryCloneMethod(value); return *this;}

    /**
     *
This is for internal use.

The Amplify service uses this
     * parameter to specify the authentication protocol to use to access the Git
     * repository for an Amplify app. Amplify specifies TOKEN for a GitHub
     * repository, SIGV4 for an Amazon Web Services CodeCommit repository,
     * and SSH for GitLab and Bitbucket repositories.

     */
    inline App& WithRepositoryCloneMethod(RepositoryCloneMethod&& value) { SetRepositoryCloneMethod(std::move(value)); return *this;}

  private:

    Aws::String m_appId;
    bool m_appIdHasBeenSet = false;

    Aws::String m_appArn;
    bool m_appArnHasBeenSet = false;

    Aws::String m_name;
    bool m_nameHasBeenSet = false;

    Aws::Map<Aws::String, Aws::String> m_tags;
    bool m_tagsHasBeenSet = false;

    Aws::String m_description;
    bool m_descriptionHasBeenSet = false;

    Aws::String m_repository;
    bool m_repositoryHasBeenSet = false;

    Platform m_platform;
    bool m_platformHasBeenSet = false;

    Aws::Utils::DateTime m_createTime;
    bool m_createTimeHasBeenSet = false;

    Aws::Utils::DateTime m_updateTime;
    bool m_updateTimeHasBeenSet = false;

    Aws::String m_iamServiceRoleArn;
    bool m_iamServiceRoleArnHasBeenSet = false;

    Aws::Map<Aws::String, Aws::String> m_environmentVariables;
    bool m_environmentVariablesHasBeenSet = false;

    Aws::String m_defaultDomain;
    bool m_defaultDomainHasBeenSet = false;

    bool m_enableBranchAutoBuild;
    bool m_enableBranchAutoBuildHasBeenSet = false;

    bool m_enableBranchAutoDeletion;
    bool m_enableBranchAutoDeletionHasBeenSet = false;

    bool m_enableBasicAuth;
    bool m_enableBasicAuthHasBeenSet = false;

    Aws::String m_basicAuthCredentials;
    bool m_basicAuthCredentialsHasBeenSet = false;

    Aws::Vector<CustomRule> m_customRules;
    bool m_customRulesHasBeenSet = false;

    ProductionBranch m_productionBranch;
    bool m_productionBranchHasBeenSet = false;

    Aws::String m_buildSpec;
    bool m_buildSpecHasBeenSet = false;

    Aws::String m_customHeaders;
    bool m_customHeadersHasBeenSet = false;

    bool m_enableAutoBranchCreation;
    bool m_enableAutoBranchCreationHasBeenSet = false;

    Aws::Vector<Aws::String> m_autoBranchCreationPatterns;
    bool m_autoBranchCreationPatternsHasBeenSet = false;

    AutoBranchCreationConfig m_autoBranchCreationConfig;
    bool m_autoBranchCreationConfigHasBeenSet = false;

    RepositoryCloneMethod m_repositoryCloneMethod;
    bool m_repositoryCloneMethodHasBeenSet = false;
  };

} // namespace Model
} // namespace Amplify
} // namespace Aws


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../../hyper/header/struct.Raw.html">

Redirecting to ../../../hyper/header/struct.Raw.html...


text:
package com.damaja.whatsup;

import android.app.Activity;
import android.content.Context;
import android.support.v4.app.FragmentManager;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.damaja.whatsup.Model.DataBus;

public class MainActivity extends Activity {
    ListView mCategorys, mHomescreenItems;
    DataBus mDataBus;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mCategorys = (ListView) findViewById(R.id.main_categorys);
        mHomescreenItems = (ListView) findViewById(R.id.main_homescreen);
        mDataBus = DataBus.getInstance();
        mCategorys.setAdapter(new CategoryAdapter());
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_actionbaritems, menu);
        return super.onCreateOptionsMenu(menu);

    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    public class CategoryAdapter extends BaseAdapter {
        Context mContext;
        private LayoutInflater mInflater;

        public CategoryAdapter() {
            this.mInflater = getLayoutInflater();
        }

        @Override
        public int getCount() {
            return DataBus.getInstance().getCategroys().size();
        }

        @Override
        public Object getItem(int i) {
            return DataBus.getInstance().getCategroys().get(i);
        }

        @Override
        public long getItemId(int i) {
            return i;
        }

        @Override
        public View getView(final int position, View convertView, ViewGroup parent) {
            View item = mInflater.inflate(R.layout.category_list_item, parent, false);
            TextView contact = (TextView)item.findViewById(R.id.category_txtcategory);
            ImageView icon = (ImageView)item.findViewById(R.id.category_img_icon);
            contact.setText(DataBus.getInstance().getCategroys().get(position).getName());
            icon.setImageResource(DataBus.getInstance().getCategroys().get(position).getIcon());
            return item;
        }

    }
    public class EventAdapter extends BaseAdapter {
        Context mContext;
        private LayoutInflater mInflater;

        public EventAdapter() {
            this.mInflater = getLayoutInflater();
        }

        @Override
        public int getCount() {
            return DataBus.getInstance().getCategroys().size();
        }

        @Override
        public Object getItem(int i) {
            return DataBus.getInstance().getCategroys().get(i);
        }

        @Override
        public long getItemId(int i) {
            return i;
        }

        @Override
        public View getView(final int position, View convertView, ViewGroup parent) {
            View item = mInflater.inflate(R.layout.category_list_item, parent, false);
            TextView name = (TextView)item.findViewById(R.id.category_txtcategory);
            TextView rating = (TextView)item.findViewById(R.id.category_txtcategory);
            TextView infotext = (TextView)item.findViewById(R.id.category_txtcategory);

            return item;
        }

    }

}


text:
from net.wyun.mer.ink.scg import Scg
from xlsx import Excel

'''
process data/xlsx/hw_record.xlsx file, and save its record to DB
New data will be available in sql form. And it can be dumped into DB directly
'''

class Excel2DB(object):
    '''
    This class is used to dump the original scg data into a database. Because all these data has been
    verified for its latex output. So the processed flag is set to 1
    '''

    def __init__(self, dbBatch, xlsx_file_path ='data/scg/test.xlsx'):
        self.excel = Excel(xlsx_file_path)
        self.dbBatch = dbBatch

    def saveScg2db(self, scg):
        hw_record = scg.id, scg.content, scg.response, 1, scg.request_at, scg.response_at
        self.dbBatch.insert_hw_record(hw_record)

    def saveRow2db(self, row):
        scg_id, scg_content, truth, req_at, resp_at = self.excel.get_scg_record(row)
        if len(truth.strip()) == 0:
            print '' + str(id) + ' ' + 'no latex\n'
            return
        scg = Scg(scg_id, scg_content, truth, req_at, resp_at)
        self.saveScg2db(scg)


text:
package org.ethereum.android;

import android.content.Context;

import org.ethereum.android.di.modules.EthereumModule;
import org.ethereum.android.di.components.DaggerEthereumComponent;
import org.ethereum.config.SystemProperties;
import org.ethereum.facade.Ethereum;
import org.ethereum.listener.EthereumListenerAdapter;
import org.ethereum.android.manager.BlockLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.ethereum.android.jsonrpc.JsonRpcServer;

public class EthereumManager {

    private static final Logger logger = LoggerFactory.getLogger("manager");

    public static Ethereum ethereum = null;

    private JsonRpcServer jsonRpcServer;

    public EthereumManager(Context context, String databaseFolder) {

        System.setProperty("sun.arch.data.model", "32");
        System.setProperty("leveldb.mmap", "false");

        if (databaseFolder != null) {
            System.out.println("Database folder: " + databaseFolder);
            SystemProperties.CONFIG.setDataBaseDir(databaseFolder);
        }

        ethereum = DaggerEthereumComponent.builder()
                .ethereumModule(new EthereumModule(context))
                .build().ethereum();

        //TODO: add here switch between full and light version
        jsonRpcServer = new org.ethereum.android.jsonrpc.light.JsonRpcServer(ethereum);
    }

    public void start() {

    }

    public long connect(String dumpFile) {

        long duration = 0;
        if (dumpFile == null) {
            ethereum.connect(SystemProperties.CONFIG.activePeerIP(),
                    SystemProperties.CONFIG.activePeerPort(),
                    SystemProperties.CONFIG.activePeerNodeid());
        } else {
            BlockLoader blockLoader = (BlockLoader)ethereum.getBlockLoader();
            blockLoader.loadBlocks(dumpFile);
        }
        return duration;
    }

    public void startPeerDiscovery() {

        ethereum.startPeerDiscovery();
    }

    public void addListener(EthereumListenerAdapter listener) {

        ethereum.addListener(listener);
    }

    public void startJsonRpc() throws Exception {

        jsonRpcServer.start();
    }

	public void onDestroy() {
        close();
    }

    public void close() {

        ethereum.close();
    }

}


text:
#include "tensorflow/compiler/xla/service/while_loop_trip_count_annotator.h"

#include "tensorflow/compiler/xla/service/pattern_matcher.h"
#include "tensorflow/compiler/xla/service/while_loop_simplifier.h"
#include "tensorflow/compiler/xla/status_macros.h"
#include "tensorflow/compiler/xla/test.h"
#include "tensorflow/compiler/xla/tests/hlo_test_base.h"
#include "tensorflow/core/lib/core/status_test_util.h"

namespace xla {
namespace {

class TripCountAnnotatorTest : public HloTestBase {};

TEST_F(TripCountAnnotatorTest, KnownSmallTripCount) {
  const char* kModuleStr = R"(
    HloModule test
    Body {
      param = (s32[]) parameter(0)
      i = s32[] get-tuple-element(param), index=0
      one = s32[] constant(1)
      i_plus_one = s32[] add(i, one)
      ROOT tuple = (s32[]) tuple(i_plus_one)
    }

    Cond {
      param = (s32[]) parameter(0)
      i = s32[] get-tuple-element(param), index=0
      trip_count = s32[] constant(10)
      ROOT done = pred[] compare(i, trip_count), direction=LT
    }

    ENTRY test {
      i_start = s32[] constant(0)
      initial_tuple = (s32[]) tuple(i_start)
      ROOT while = (s32[]) while(initial_tuple), condition=Cond, body=Body
    })";

  TF_ASSERT_OK_AND_ASSIGN(auto m, ParseAndReturnVerifiedModule(kModuleStr));
  WhileLoopTripCountAnnotator pass;
  TF_ASSERT_OK_AND_ASSIGN(bool changed, RunHloPass(&pass, m.get()));
  ASSERT_TRUE(changed);

  TF_ASSERT_OK_AND_ASSIGN(auto config,
                          m->entry_computation()
                              ->root_instruction()
                              ->backend_config<WhileLoopBackendConfig>());
  EXPECT_EQ(10, config.known_trip_count().n());
}

TEST_F(TripCountAnnotatorTest, KnownLargeTripCount) {
  const char* kModuleStr = R"(
    HloModule test
    Body {
      param = (s32[]) parameter(0)
      i = s32[] get-tuple-element(param), index=0
      one = s32[] constant(1)
      i_plus_one = s32[] add(i, one)
      ROOT tuple = (s32[]) tuple(i_plus_one)
    }

    Cond {
      param = (s32[]) parameter(0)
      i = s32[] get-tuple-element(param), index=0
      trip_count = s32[] constant(1000000)
      ROOT done = pred[] compare(i, trip_count), direction=LT
    }

    ENTRY test {
      i_start = s32[] constant(0)
      initial_tuple = (s32[]) tuple(i_start)
      ROOT while = (s32[]) while(initial_tuple), condition=Cond, body=Body
    })";

  TF_ASSERT_OK_AND_ASSIGN(auto m, ParseAndReturnVerifiedModule(kModuleStr));
  WhileLoopTripCountAnnotator pass;
  TF_ASSERT_OK_AND_ASSIGN(bool changed, RunHloPass(&pass, m.get()));
  ASSERT_TRUE(changed);

  TF_ASSERT_OK_AND_ASSIGN(auto config,
                          m->entry_computation()
                              ->root_instruction()
                              ->backend_config<WhileLoopBackendConfig>());
  EXPECT_EQ(1000000, config.known_trip_count().n());
}

TEST_F(TripCountAnnotatorTest, NonzeroStart) {
  const char* kModuleStr = R"(
    HloModule test
    Body {
      param = (s32[]) parameter(0)
      i = s32[] get-tuple-element(param), index=0
      one = s32[] constant(1)
      i_plus_one = s32[] add(i, one)
      ROOT tuple = (s32[]) tuple(i_plus_one)
    }

    Cond {
      param = (s32[]) parameter(0)
      i = s32[] get-tuple-element(param), index=0
      trip_count = s32[] constant(1000000)
      ROOT done = pred[] compare(i, trip_count), direction=LT
    }

    ENTRY test {
      i_start = s32[] constant(10)
      initial_tuple = (s32[]) tuple(i_start)
      ROOT while = (s32[]) while(initial_tuple), condition=Cond, body=Body
    })";

  TF_ASSERT_OK_AND_ASSIGN(auto m, ParseAndReturnVerifiedModule(kModuleStr));
  WhileLoopTripCountAnnotator pass;
  TF_ASSERT_OK_AND_ASSIGN(bool changed, RunHloPass(&pass, m.get()));
  ASSERT_TRUE(changed);

  TF_ASSERT_OK_AND_ASSIGN(auto config,
                          m->entry_computation()
                              ->root_instruction()
                              ->backend_config<WhileLoopBackendConfig>());
  EXPECT_EQ(999990, config.known_trip_count().n());
}

TEST_F(TripCountAnnotatorTest, LessThanOrEqualTo) {
  const char* kModuleStr = R"(
    HloModule test
    Body {
      param = (s32[]) parameter(0)
      i = s32[] get-tuple-element(param), index=0
      one = s32[] constant(1)
      i_plus_one = s32[] add(i, one)
      ROOT tuple = (s32[]) tuple(i_plus_one)
    }

    Cond {
      param = (s32[]) parameter(0)
      i = s32[] get-tuple-element(param), index=0
      trip_count = s32[] constant(1000000)
      ROOT done = pred[] compare(i, trip_count), direction=LE
    }

    ENTRY test {
      i_start = s32[] constant(10)
      initial_tuple = (s32[]) tuple(i_start)
      ROOT while = (s32[]) while(initial_tuple), condition=Cond, body=Body
    })";

  TF_ASSERT_OK_AND_ASSIGN(auto m, ParseAndReturnVerifiedModule(kModuleStr));
  WhileLoopTripCountAnnotator pass;
  TF_ASSERT_OK_AND_ASSIGN(bool changed, RunHloPass(&pass, m.get()));
  ASSERT_TRUE(changed);

  TF_ASSERT_OK_AND_ASSIGN(auto config,
                          m->entry_computation()
                              ->root_instruction()
                              ->backend_config<WhileLoopBackendConfig>());
  EXPECT_EQ(999991, config.known_trip_count().n());
}

TEST_F(TripCountAnnotatorTest, Int64Overflow) {
  // for(i = INT64_MIN; i < INT64_MAX; ++i)
  //
  // We store the trip count as an int64_t, so this loop is unanalyzable.
  const char* kModuleStr = R"(
    HloModule test
    Body {
      param = (s64[]) parameter(0)
      i = s64[] get-tuple-element(param), index=0
      one = s64[] constant(1)
      i_plus_one = s64[] add(i, one)
      ROOT tuple = (s64[]) tuple(i_plus_one)
    }

    Cond {
      param = (s64[]) parameter(0)
      i = s64[] get-tuple-element(param), index=0
      trip_count = s64[] constant(9223372036854775807) // 2^63-1
      ROOT done = pred[] compare(i, trip_count), direction=LE
    }

    ENTRY test {
      i_start = s64[] constant(-9223372036854775808)  // -2^63
      initial_tuple = (s64[]) tuple(i_start)
      ROOT while = (s64[]) while(initial_tuple), condition=Cond, body=Body
    })";

  TF_ASSERT_OK_AND_ASSIGN(auto m, ParseAndReturnVerifiedModule(kModuleStr));
  WhileLoopTripCountAnnotator pass;
  TF_ASSERT_OK_AND_ASSIGN(bool changed, RunHloPass(&pass, m.get()));
  EXPECT_FALSE(changed);
}

}  // namespace
}  // namespace xla


text:
package com.qiumingkui.sample.imedia.user.domain.model;

import com.qiumingkui.sample.imedia.common.ext.id.StringId;

public class UserId extends StringId {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	public UserId(String id) {
		super(id);
	}

}


text:
EXECUTING = 'executing'
QUEUED = 'queued'
PLEDGED = 'pledged'
IGNORE = 'ignore'

class Node(object):

    def __init__(self):
        self.children = []

    def add_child(self, node):
        self.children.append(node)

    def get_leaves(self, leaves=[]):

        # If the node has no leaves, return the node in a list
        if not self.children:
            leaves.append(self)
            return leaves

        # Recursively get to the bottom
        for child in self.children:
            child.get_leaves(leaves)

        return leaves

class Share(Node):
    """
    Implement the share node
    """
    def __str__(self, level=0):
        """
        Print the tree structure
        """
        ret = "{0} name: {1}, value: {2}\n".format('\t' * level, self.name, self.value)
        for child in self.children:
            ret += child.__str__(level + 1)
        return ret

    def __repr__(self):
        return self.__str__()

    def __mul__(self, other):
        """
        If I multiply a share object by a number, multiply the value field
        """
        self.value *= other
        return self.value

    def __rmul__(self, other):
        return self.__mul__

    def __imul__(self, other):
        return self.__mul__

    def __init__(self, name, value, parent, prodsourcelabel, workinggroup, campaign, processingtype):
        Node.__init__(self)
        self.name = name
        self.rawvalue = value
        self.value = value
        self.parent = parent
        self.prodsourcelabel = prodsourcelabel
        self.workinggroup = workinggroup
        self.campaign = campaign
        self.processingtype = processingtype

    def pretty_print_hs_distribution(self, hs_distribution, level=0):
        try:
            executing = hs_distribution[self.name][EXECUTING]/1000.0
        except:
            executing = 0

        try:
            target = hs_distribution[self.name][PLEDGED]/1000.0
        except:
            target = 0

        try:
            queued = hs_distribution[self.name][QUEUED]/1000.0
        except:
            queued = 0

        ret = "{0} name: {1}, values: {2:.1f}k|{3:.1f}k|{4:.1f}k\n".format('\t' * level, self.name, executing, target, queued)
        for child in self.children:
            ret += child.pretty_print_hs_distribution(hs_distribution, level + 1)
        return ret

    def normalize(self, multiplier=100, divider=100):
        """
        Will run down the branch and normalize values beneath
        """
        self.value *= (multiplier * 1.0 / divider)
        if not self.children:
            return

        divider = 0
        for child in self.children:
            divider += child.value

        multiplier = self.value

        for child in self.children:
            child.normalize(multiplier=multiplier, divider=divider)

        return

    def sort_branch_by_current_hs_distribution(self, hs_distribution):
        """
        Runs down the branch in order of under-pledging. It returns a list of sorted leave shares
        """
        sorted_shares = []

        # If the node has no leaves, return the node in a list
        if not self.children:
            sorted_shares = [self]
            return sorted_shares

        # If the node has leaves, sort the children
        children_sorted = []
        for child1 in self.children:
            loop_index = 0
            insert_index = len(children_sorted)  # insert at the end, if not deemed otherwise

            # Calculate under-pledging
            child1_under_pledge = hs_distribution[child1.name][PLEDGED] - hs_distribution[child1.name][EXECUTING]
            for child2 in children_sorted:
                try:
                    # Calculate under-pledging
                    child2_under_pledge = hs_distribution[child2.name][PLEDGED] \
                                          - hs_distribution[child2.name][EXECUTING]
                except KeyError:
                    continue

                if child1_under_pledge > child2_under_pledge:
                    insert_index = loop_index
                    break

                loop_index += 1

            # Insert the child into the list
            children_sorted.insert(insert_index, child1)

        # Go recursively and sort the grand* children
        for child in children_sorted:
            sorted_shares.extend(child.sort_branch_by_current_hs_distribution(hs_distribution))

        return sorted_shares

    def aggregate_hs_distribution(self, hs_distribution):
        """
        We have the current HS distribution values for the leaves, but want to propagate it updwards to the parents.
        We will traverse the tree from top to bottom and bring up the aggregated values.
        """
        executing, queued, pledged = 0, 0, 0

        # If the node has no children, it's a leave and should have an entry in the hs_distribution
        if not self.children:
            try:
                executing = hs_distribution[self.name][EXECUTING]
                queued = hs_distribution[self.name][QUEUED]
                pledged = hs_distribution[self.name][PLEDGED]
            except KeyError:
                pass

            return executing, queued, pledged

        # If the node has children, sum up the values of the children
        executing = 0
        queued = 0
        pledged = 0

        for child in self.children:
            executing_child, queued_child, pledged_child = child.aggregate_hs_distribution(hs_distribution)
            executing += executing_child
            queued += queued_child
            pledged += pledged_child

        # Add the aggregated value to the map
        hs_distribution[self.name] = {
                                       EXECUTING: executing,
                                       QUEUED: queued,
                                       PLEDGED: pledged
                                     }

        # Return the aggregated values
        return executing, queued, pledged


text:
// Originally submitted to OSEHRA 2/21/2017 by DSS, Inc.
// Authored by DSS, Inc. 2014-2017

using VA.Gov.Artemis.Vista.Broker;
using VA.Gov.Artemis.UI.Data.Brokers;
using VA.Gov.Artemis.UI.Data.Models;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VA.Gov.Artemis.UI.Data.Models.ServerSettings;
using VA.Gov.Artemis.UI.Data.Brokers.Common;
using VA.Gov.Artemis.UI.Data.Brokers.Settings;

namespace VA.Gov.Artemis.UI.Controllers
{
    [AllowAnonymous]
    public class ServerSettingsController : DashboardController
    {
        //
        // GET: /ServerSettings/Edit
        public ActionResult Edit()
        {
            // *** Show the edit server settings view ***

            // *** Get the model ***
            ServerConfigResult opResult = this.DashboardRepository.Settings.GetServerData();

            if (!opResult.Success)
                this.Error(opResult.Message);

            ServerConfig model = opResult.ServerConfig;

            // *** Return View ***
            return View(model);
        }

        //
        // POST: /ServerSettings/Edit/
        [HttpPost]
        public ActionResult Edit(ServerConfig serverConfig)
        {
            ActionResult returnResult;

            bool validModelState = this.ModelState.IsValid;

            returnResult = ProcessEditGet(serverConfig, validModelState);

            return returnResult;
        }

        [NonAction]
        public ActionResult ProcessEditGet(ServerConfig serverConfig, bool validModelState)
        {
            // *** Edit the server settings data ***

            ActionResult returnResult;

            // *** Check the model state ***
            if (ModelState.IsValid)
            {
                // *** Save the data ***
                BrokerOperationResult opResult = this.DashboardRepository.Settings.SetServerData(serverConfig);

                if (opResult.Success)
                {
                    // *** If good, then show info **
                    this.Information("Server Settings Saved");

                    returnResult = RedirectToAction("Dashboard", "PatientList");
                }
                else
                {
                    // *** Show error message ***
                    this.Error("Server settings could not be saved");

                    // *** Return to same view ***
                    returnResult = View(serverConfig);
                }
            }
            else
                returnResult = View(serverConfig);

            return returnResult;
        }

        [HttpPost]
        public ActionResult TestConnection(string serverName, string serverPort)
        {
            ActionResult returnResult;

            BrokerOperationResult opResult = this.DashboardRepository.Settings.TestServerConnection(serverName, serverPort);

            if (opResult.Success)
                returnResult = Content("true");
            else
                returnResult = Content("false");

            return returnResult;
        }

    }
}


text:
exports.create = function(_bird) {
	var self = Ti.UI.createWindow({
		fullscreen : false,
		title : _bird.latinname,
		backgroundColor : 'white',
		orientationModes : [Ti.UI.PORTRAIT]
	});
	self.audioPlayer = Ti.Media.createAudioPlayer({
		allowBackground : true,
		autoplay : true,
		volume : 1
	});
	self.actind = Ti.UI.createActivityIndicator({
		color : 'white',
		backgroundColor : '#262',
		width : '220dip',
		message : 'Bitte etwas Geduld … ',
		height : '100dip',
		zIndex : 99,
		opacity : 0.8,
		style : (Ti.Platform.osname == 'android') ? Ti.UI.ActivityIndicatorStyle.BIG : Ti.UI.iPhone.ActivityIndicatorStyle.BIG,
		font : {
			fontSize : '12dip'
		}/*,
		 borderRadius : '8dip',
		 borderColor : 'white',
		 borderWidth : 2*/
	});
	var rows = [];
	if (_bird.imageurl != '')
		self.add(Ti.UI.createImageView({
			top : 0,
			image : _bird.imageurl,
			width : Titanium.Platform.displayCaps.platformWidth,
			height : Titanium.Platform.displayCaps.platformWidth * 0.7,
		}));
	self.tv = Ti.UI.createTableView({
		top : Ti.Platform.displayCaps.platformWidth * 0.7,
	});
	self.add(self.tv);
	self.add(self.actind);
	self.actind.setMessage(' Get songs from XenoCanto.');
	Ti.App.XenoCanto.searchRecordings({
		bird : _bird.latinname,
		onload : function(_res) {
			self.actind.setMessage('  Got ' + _res.recordingslength + ' songs from song database.');
			for (var i = 0; i < _res.recordings.length; i++) {
				var row = require('ui/xenocantoplayer').create(self, _res.recordings[i]);
				rows.push(row);
			}
			if (_res.recordings.length) {
				var b = Ti.UI.createButton({
					height : 60,
					right : 10,
					top : 10,
					width : Ti.UI.SIZE,
					opacity : 0.7,
					title : ' Bird map '
				});
				self.add(b);
				b.addEventListener('click', function() {
					var gmap = require('ui/gmap.window').create(_res);
					gmap.open();
				});
				self.actind.hide();
				self.remove(self.actind);
				self.tv.setData(rows);
			}
		}
	});

	self.addEventListener('longpress', function() {
		self.close();
	});

	self.addEventListener('close', function() {
		if (self && self.audioPlayer) {
			self.audioPlayer.stop();
			if (Ti.Platform.osname === 'android') {
				self.audioPlayer.release();
			}
		}
	});
	self.addEventListener('close', function() {
		self = null;
	});
	return self;
}


text:
package io.opencensus.stats;

import static com.google.common.base.Preconditions.checkNotNull;

import io.opencensus.common.NonThrowingCloseable;
import java.io.IOException;
import java.io.InputStream;

/**
 * Factory class for {@link StatsContext}.
 */
public abstract class StatsContextFactory {

  /**
   * Creates a {@link StatsContext} from the given on-the-wire encoded representation.
   *
   *
Should be the inverse of {@link StatsContext#serialize(java.io.OutputStream)}. The
   * serialized representation should be based on the {@link StatsContext} binary representation.
   *
   * @param input on-the-wire representation of a {@link StatsContext}
   * @return a {@link StatsContext} deserialized from {@code input}
   */
  public abstract StatsContext deserialize(InputStream input) throws IOException;

  /**
   * Returns the default {@link StatsContext}.
   */
  public abstract StatsContext getDefault();

  /**
   * Get current StatsContext from current gRPC Context.
   *
   * @return the current {@code StatsContext} from {@code io.grpc.Context}, or the default
   * {@code StatsContext} if there's no {@code StatsContext} associated with current
   * {@code io.grpc.Context}.
   */
  public final StatsContext getCurrentStatsContext() {
    StatsContext statsContext = ContextUtils.getCurrentStatsContext();
    return statsContext != null ? statsContext : getDefault();
  }

  /**
   * Enters the scope of code where the given {@link StatsContext} is in the current Context, and
   * returns an object that represents that scope. The scope is exited when the returned object is
   * closed.
   *
   *
Supports try-with-resource idiom.
   *
   *
Example of usage:
   *
   *
{@code
   * private final StatsContextFactory statsCtxFactory =
   *     checkNotNull(Stats.getStatsContextFactory(), "statsCtxFactory");
   * void doWork() {
   *   // Construct a new StatsContext with required tags to be set into current context.
   *   StatsContext statsCtx = statsCtxFactory.getCurrentStatsContext().with(tagKey, tagValue);
   *   try (NonThrowingCloseable scopedStatsCtx = statsCtxFactory.withStatsContext(statsCtx)) {
   *     doSomeOtherWork();  // Here "scopedStatsCtx" is the current StatsContext.
   *   }
   * }
   * }

   *
   *
Prior to Java SE 7, you can use a finally block to ensure that a resource is closed
   * regardless of whether the try statement completes normally or abruptly.
   *
   *
Example of usage prior to Java SE7:
   *
   *
{@code
   * private final StatsContextFactory statsCtxFactory =
   *     checkNotNull(Stats.getStatsContextFactory(), "statsCtxFactory");
   * void doWork() {
   *   // Construct a new StatsContext with required tags to be set into current context.
   *   StatsContext statsCtx = statsCtxFactory.getCurrentStatsContext().with(tagKey, tagValue);
   *   NonThrowingCloseable scopedStatsCtx = statsCtxFactory.withStatsContext(statsCtx);
   *   try {
   *     doSomeOtherWork();  // Here "scopedStatsCtx" is the current StatsContext.
   *   } finally {
   *     scopedStatsCtx.close();
   *   }
   * }
   * }

   *
   * @param statsContext The {@link StatsContext} to be set to the current Context.
   * @return an object that defines a scope where the given {@link StatsContext} will be set to the
   *     current Context.
   * @throws NullPointerException if statsContext is null.
   */
  public final NonThrowingCloseable withStatsContext(StatsContext statsContext) {
    return ContextUtils.withStatsContext(checkNotNull(statsContext, "statsContext"));
  }
}


text:
Ext.define('Flamingo.view.workflowdesigner.property._NameValueGrid', {
    extend: 'Flamingo.view.workflowdesigner.property._Grid',
    alias: 'widget._nameValueGrid',

    store: Ext.create('Ext.data.Store', {
        fields: [
            {name: 'variableNames'},
            {name: 'variableValues'},
            {name: 'variableDescriptions'}
        ],
        data: []
    }),
    selType: 'rowmodel',
    forceFit: true,
    columnLines: true,
    columns: [
        {
            text: 'Key',
            dataIndex: 'variableNames',
            width: 100,
            editor: {
                allowBlank: true,
                vtype: 'alphanum',
                listeners: {
                    errorchange: function (comp, error, eopts) {
                        comp.focus(false, 50);
                    }
                }
            }
        },
        {
            text: 'Value',
            dataIndex: 'variableValues',
            width: 100,
            editor: {
                vtype: 'exceptcomma',
                allowBlank: true,
                listeners: {
                    errorchange: function (comp, error, eopts) {
                        comp.focus(false, 30);
                    }
                }
            }
        },
        {
            text: 'Description',
            dataIndex: 'variableDescriptions',
            width: 200,
            editor: {
                vtype: 'exceptcomma',
                allowBlank: true
            }
        }
    ]
});