text:
#include "ABI44_0_0RawPropsKeyMap.h"

#include <algorithm>
#include <cassert>
#include <cstdlib>
#include <cstring>

namespace ABI44_0_0facebook {
namespace ABI44_0_0React {

bool RawPropsKeyMap::hasSameName(Item const &lhs, Item const &rhs) noexcept {
  return lhs.length == rhs.length &&
      (std::memcmp(lhs.name, rhs.name, lhs.length) == 0);
}

bool RawPropsKeyMap::shouldFirstOneBeBeforeSecondOne(
    Item const &lhs,
    Item const &rhs) noexcept {
  if (lhs.length != rhs.length) {
    return lhs.length < rhs.length;
  }

  return std::memcmp(lhs.name, rhs.name, rhs.length) < 0;
}

void RawPropsKeyMap::insert(
    RawPropsKey const &key,
    RawPropsValueIndex value) noexcept {
  auto item = Item{};
  item.value = value;
  key.render(item.name, &item.length);
  items_.push_back(item);
}

void RawPropsKeyMap::reindex() noexcept {
  // Sorting `items_` by property names length and then lexicographically.
  // Note, sort algorithm must be stable.
  std::stable_sort(
      items_.begin(),
      items_.end(),
      &RawPropsKeyMap::shouldFirstOneBeBeforeSecondOne);

  // Filtering out duplicating keys.
  // If some `*Props` object requests a prop more than once, only the first
  // request will be fulfilled. E.g. `TextInputProps` class has a sub-property
  // `backgroundColor` twice, the first time as part of `ViewProps` base-class
  // and the second as part of `BaseTextProps` base-class. In this
  // configuration, the only one which comes first (from `ViewProps`, which
  // appear first) will be assigned.
  items_.erase(
      std::unique(items_.begin(), items_.end(), &RawPropsKeyMap::hasSameName),
      items_.end());

  buckets_.resize(kPropNameLengthHardCap);

  auto length = RawPropsPropNameLength{0};
  for (auto i = 0; i < items_.size(); i++) {
    auto &item = items_[i];
    if (item.length != length) {
      for (auto j = length; j < item.length; j++) {
        buckets_[j] = i;
      }
      length = item.length;
    }
  }

  for (auto j = length; j < buckets_.size(); j++) {
    buckets_[j] = items_.size();
  }
}

RawPropsValueIndex RawPropsKeyMap::at(
    char const *name,
    RawPropsPropNameLength length) noexcept {
  assert(length > 0);
  assert(length < kPropNameLengthHardCap);
  // 1. Find the bucket.
  auto lower = int{buckets_[length - 1]};
  auto upper = int{buckets_[length]} - 1;
  assert(lower - 1 <= upper);

  // 2. Binary search in the bucket.
  while (lower <= upper) {
    auto median = (lower + upper) / 2;
    auto condition = std::memcmp(items_[median].name, name, length);
    if (condition < 0) {
      lower = median + 1;
    } else if (condition == 0) {
      return items_[median].value;
    } else /* if (condition > 0) */ {
      upper = median - 1;
    }
  }

  return kRawPropsValueIndexEmpty;
}

} // namespace ABI44_0_0React
} // namespace ABI44_0_0facebook

redpajama_set_name: RedPajamaGithub


text:
#import "mfreerdp.h"
#import "mf_client.h"

#import "freerdp/freerdp.h"
#import "freerdp/channels/channels.h"
#import "freerdp/client/cliprdr.h"

int mac_cliprdr_send_client_format_list(CliprdrClientContext* cliprdr);

void mac_cliprdr_init(mfContext* mfc, CliprdrClientContext* cliprdr);
void mac_cliprdr_uninit(mfContext* mfc, CliprdrClientContext* cliprdr);


text:
/**
 * @file lv_draw_rbasic..h
 *
 */

#ifndef LV_DRAW_RBASIC_H
#define LV_DRAW_RBASIC_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/
#include "misc/gfx/color.h"
#include "misc/gfx/area.h"
#include "misc/gfx/font.h"

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

/**********************
 * GLOBAL PROTOTYPES
 **********************/

void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa);

/**
 * Fill an area on the display
 * @param cords_p coordinates of the area to fill
 * @param mask_p fill only o this mask
 * @param color fill color
 * @param opa opacity (ignored, only for compatibility with lv_vfill)
 */
void lv_rfill(const area_t * cords_p, const area_t * mask_p,
                color_t color, opa_t opa);

/**
 * Draw a letter to the display
 * @param pos_p left-top coordinate of the latter
 * @param mask_p the letter will be drawn only on this area
 * @param font_p pointer to font
 * @param letter a letter to draw
 * @param color color of letter
 * @param opa opacity of letter (ignored, only for compatibility with lv_vletter)
 */
void lv_rletter(const point_t * pos_p, const area_t * mask_p,
                const font_t * font_p, uint8_t letter,
                color_t color, opa_t opa);

/**
 * Draw a color map to the display
 * @param cords_p coordinates the color map
 * @param mask_p the map will drawn only on this area
 * @param map_p pointer to a color_t array
 * @param opa opacity of the map (ignored, only for compatibility with lv_vmap)
 * @param transp true: enable transparency of LV_IMG_COLOR_TRANSP color pixels
 * @param upscale true: upscale to double size (not supported)
 * @param recolor mix the pixels with this color (not supported)
 * @param recolor_opa the intense of recoloring (not supported)
 */
void lv_rmap(const area_t * cords_p, const area_t * mask_p,
             const color_t * map_p, opa_t opa, bool transp, bool upscale,
			 color_t recolor, opa_t recolor_opa);
/**********************
 *      MACROS
 **********************/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif  /*LV_DRAW_RBASIC_H*/


text:
import time
import pam
from xen.xend import uuid
from xen.xend.XendError import *
from xen.xend.XendLogging import log

class XendAuthSessions:
    """Keeps track of Xen API Login Sessions using PAM.

    Note: Login sessions are not valid across instances of Xend.
    """
    def __init__(self):
        self.sessions = {}

    def init(self):
        pass

    def login_unconditionally(self, username):
        """Returns a session UUID if valid.

        @rtype: string
        @return: Session UUID
        """
#        file_object = open('/home/lt/ver', 'w')
#        file_object.write('in uncondition')
#        file_object.close()
        new_session = uuid.gen_regularUuid()
        self.sessions[new_session] = (username, time.time())
        return new_session

    def login_with_password(self, username, password):
        """Returns a session UUID if valid, otherwise raises an error.

        @raises XendError: If login fails.
        @rtype: string
        @return: Session UUID
        """
        if self.is_authorized(username, password):
            return self.login_unconditionally(username)

        raise XendError("Login failed")

    def logout(self, session):
        """Delete session of it exists."""
        if self.is_session_valid(session):
            del self.sessions[session]

    def is_session_valid(self, session):
        """Returns true is session is valid."""
        if type(session) == type(str()):
            return (session in self.sessions)
        return False

    def is_authorized(self, username, password):
        """Returns true is a user is authorised via PAM.

        Note: We use the 'login' PAM stack rather than inventing
              our own.

        @rtype: boolean
        """
#        file_object = open('/home/lt/verify', 'w')
#        file_object.write(str(pam.authenticate(username, password, 'sshd')))
#        file_object.close()
        return pam.authenticate(username, password, 'sshd')
#        pam_auth = None
#        try:
#            import PAM
#            pam_auth = PAM.pam()
#        except ImportError:
#            log.warn("python-pam is required for XenAPI support.")
#            return False
#        except NameError:
#            # if PAM doesn't exist, let's ignore it
#            return False

        pam_auth.start("login")
        pam_auth.set_item(PAM.PAM_USER, username)

        def _pam_conv(auth, query_list, user_data = None):
            resp = []
            for i in range(len(query_list)):
                query, qtype = query_list[i]
                if qtype == PAM.PAM_PROMPT_ECHO_ON:
                    resp.append((username, 0))
                elif qtype == PAM.PAM_PROMPT_ECHO_OFF:
                    resp.append((password, 0))
                else:
                    return None
            return resp

        pam_auth.set_item(PAM.PAM_CONV, _pam_conv)

        try:
            pam_auth.authenticate()
            pam_auth.acct_mgmt()
        except PAM.error, resp:
            return False
        except Exception, e:
            log.warn("Error with PAM: %s" % str(e))
            return False
        else:
            return True

    def get_user(self, session):
        try:
            return self.sessions[session][0]
        except (KeyError, IndexError):
            return None

def instance():
    """Singleton constructor. Use this instead of the class constructor.
    """
    global inst
    try:
        inst
    except:
        inst = XendAuthSessions()
        inst.init()
    return inst


text:
"""
Starting Template

Once you have learned how to use classes, you can begin your program with this
template.

"""
import arcade

SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600

class MyApplication(arcade.Window):
    """
    Main application class.

    NOTE: Go ahead and delete the methods you don't need.
    If you do need a method, delete the 'pass' and replace it
    with your own code. Don't leave 'pass' in this program.
    """

    def setup(self):
        """
        Set up the application.
        """

        arcade.set_background_color(arcade.color.WHITE)

    def on_draw(self):
        """
        Render the screen.
        """

        # This command has to happen before we start drawing
        arcade.start_render()

        arcade.draw_text("This is a simple template to start your game.",
                         10, SCREEN_HEIGHT // 2, arcade.color.BLACK, 20)

    def animate(self, delta_time):
        """
        All the logic to move, and the game logic goes here.
        """
        pass

    def on_key_press(self, symbol, modifiers):
        """
        Called whenever a key on the keyboard is pressed.
        """
        pass

    def on_key_release(self, symbol, modifiers):
        """
        Called whenever the user lets off a previously pressed key.
        """
        pass

    def on_mouse_motion(self, x, y, dx, dy):
        """
        Called whenever the mouse moves.
        """
        pass

    def on_mouse_press(self, x, y, button, modifiers):
        """
        Called when the user presses a mouse button.
        """
        pass

    def on_mouse_release(self, x, y, button, modifiers):
        """
        Called when a user releases a mouse button.
        """
        pass

window = MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT)
window.setup()

arcade.run()


text:
FactoryBot.define do
  factory :gws_monitor_topic, class: Gws::Monitor::Topic do
    cur_site { gws_site }
    cur_user { gws_user }

    name { "name-#{unique_id}" }
    text { "text-#{unique_id}" }
    user_ids { [cur_user.id] }
    group_ids { cur_user.group_ids }

    trait :gws_monitor_deleted do
      deleted { Time.zone.now }
    end
  end
end


text:
{{-- Pterodactyl - Panel --}}
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}

{{-- This software is licensed under the terms of the MIT license. --}}
{{-- https://opensource.org/licenses/MIT --}}
@extends('layouts.admin')

@section('title')
    Nodes → New
@endsection

@section('content-header')

New NodeCreate a new local or remote node for servers to be installed to.

Admin

Nodes

New

@endsection

@section('content')
<form action="{{ route('admin.nodes.new') }}" method="POST">

Basic Details

                        Name
                        <input type="text" name="name" id="pName" class="form-control" value="{{ old('name') }}"/>

Character limits: a-zA-Z0-9_.- and [Space] (min 1, max 100 characters).

                        Description
                        <textarea name="description" id="pDescription" rows="4" class="form-control">{{ old('description') }}</textarea>

                        Location
                        <select name="location_id" id="pLocationId">
                            @foreach($locations as $location)
                                <option value="{{ $location->id }}" {{ $location->id != old('location_id') ?: 'selected' }}>{{ $location->short }}</option>
                            @endforeach
                        </select>

                        Node Visibility

                                <input type="radio" id="pPublicTrue" value="1" name="public" checked>
                                 Public

                                <input type="radio" id="pPublicFalse" value="0" name="public">
                                 Private

By setting a node to private you will be denying the ability to auto-deploy to this node.

                        FQDN
                        <input type="text" name="fqdn" id="pFQDN" class="form-control" value="{{ old('fqdn') }}"/>

Please enter domain name (e.g node.example.com) to be used for connecting to the daemon. An IP address may be used only if you are not using SSL for this node.

                        Communicate Over SSL

                                <input type="radio" id="pSSLTrue" value="https" name="scheme" checked>
                                 Use SSL Connection

                                <input type="radio" id="pSSLFalse" value="http" name="scheme" @if(request()->isSecure()) disabled @endif>
                                 Use HTTP Connection

                        @if(request()->isSecure())

Your Panel is currently configured to use a secure connection. In order for browsers to connect to your node it must use a SSL connection.

                        @else

In most cases you should select to use a SSL connection. If using an IP Address or you do not wish to use SSL at all, select a HTTP connection.

                        @endif

                        Behind Proxy

                                <input type="radio" id="pProxyFalse" value="0" name="behind_proxy" checked>
                                 Not Behind Proxy

                                <input type="radio" id="pProxyTrue" value="1" name="behind_proxy">
                                 Behind Proxy

If you are running the daemon behind a proxy such as Cloudflare, select this to have the daemon skip looking for certificates on boot.

Configuration

                            Daemon Server File Directory
                            <input type="text" name="daemonBase" id="pDaemonBase" class="form-control" value="/var/lib/pterodactyl/volumes" />

Enter the directory where server files should be stored. If you use OVH you should check your partition scheme. You may need to use /home/daemon-data to have enough space.

                            Total Memory

                                <input type="text" name="memory" data-multiplicator="true" class="form-control" id="pMemory" value="{{ old('memory') }}"/>
                                MB

                            Memory Over-Allocation

                                <input type="text" name="memory_overallocate" class="form-control" id="pMemoryOverallocate" value="{{ old('memory_overallocate') }}"/>
                                %

Enter the total amount of memory available for new servers. If you would like to allow overallocation of memory enter the percentage that you want to allow. To disable checking for overallocation enter -1 into the field. Entering 0 will prevent creating new servers if it would put the node over the limit.

                            Total Disk Space

                                <input type="text" name="disk" data-multiplicator="true" class="form-control" id="pDisk" value="{{ old('disk') }}"/>
                                MB

                            Disk Over-Allocation

                                <input type="text" name="disk_overallocate" class="form-control" id="pDiskOverallocate" value="{{ old('disk_overallocate') }}"/>
                                %

Enter the total amount of disk space available for new servers. If you would like to allow overallocation of disk space enter the percentage that you want to allow. To disable checking for overallocation enter -1 into the field. Entering 0 will prevent creating new servers if it would put the node over the limit.

                            Daemon Port
                            <input type="text" name="daemonListen" class="form-control" id="pDaemonListen" value="8080" />

                            Daemon SFTP Port
                            <input type="text" name="daemonSFTP" class="form-control" id="pDaemonSFTP" value="2022" />

The daemon runs its own SFTP management container and does not use the SSHd process on the main physical server. Do not use the same port that you have assigned for your physical server's SSH process. If you will be running the daemon behind CloudFlare® you should set the daemon port to 8443 to allow websocket proxying over SSL.

                    {!! csrf_field() !!}
                    <button type="submit" class="btn btn-success pull-right">Create Node</button>

</form>
@endsection

@section('footer-scripts')
    @parent

@endsection


text:
// -*- C++ -*-

/**
 *  @file Properties.h
 *
 *  $Id: Properties.h 1861 2011-08-31 16:18:08Z mesnierp $
 *
 *  @author Pradeep Gore <pradeep@oomworks.com>
 */

#ifndef TAO_Notify_PROPERTIES_H
#define TAO_Notify_PROPERTIES_H

#include /**/ "ace/pre.h"

#include "orbsvcs/Notify/notify_serv_export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "orbsvcs/CosNotificationC.h"
#include "orbsvcs/CosNotifyChannelAdminC.h"

#include "tao/PortableServer/PortableServer.h"

#include "tao/TAO_Singleton.h"
#include "tao/ORB.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_Notify_Factory;
class TAO_Notify_Builder;

/**
 * @class TAO_Notify_Properties
 *
 * @brief Global properties that strategize Notify's run-time behaviour.
 *
 */
class TAO_Notify_Serv_Export TAO_Notify_Properties
{
public:
  /// Constructor
  TAO_Notify_Properties (void);

  /// Destructor
  ~TAO_Notify_Properties ();

  /// Return a singleton instance of this class.
  static TAO_Notify_Properties * instance (void);

  static void close (void);

  // = Property Accessors
  TAO_Notify_Factory* factory (void);
  void factory (TAO_Notify_Factory* factory);

  TAO_Notify_Builder* builder (void);
  void builder (TAO_Notify_Builder* builder);

  CORBA::ORB_ptr orb (void);
  void orb (CORBA::ORB_ptr orb);
  CORBA::ORB_ptr dispatching_orb (void);
  void dispatching_orb (CORBA::ORB_ptr dispatching_orb);

  PortableServer::POA_ptr default_poa (void);
  void default_poa (PortableServer::POA_ptr default_poa);

  CORBA::Boolean asynch_updates (void);
  void asynch_updates (CORBA::Boolean asynch_updates);

  bool allow_reconnect (void);
  void allow_reconnect (bool b);
  bool validate_client (void);
  void validate_client (bool b);
  ACE_Time_Value validate_client_delay (void);
  void validate_client_delay (ACE_Time_Value b);
  ACE_Time_Value validate_client_interval (void);
  void validate_client_interval (ACE_Time_Value b);

  // Turn on/off update messages.
  CORBA::Boolean updates (void);
  void updates (CORBA::Boolean updates);
  bool separate_dispatching_orb (void);
  void separate_dispatching_orb (bool b);

  // The QoS Property that must be applied to each newly created Event Channel
  const CosNotification::QoSProperties& default_event_channel_qos_properties (void);

  // Set the default EC QoS Property.
  void default_event_channel_qos_properties (const CosNotification::QoSProperties &ec_qos);

  // The QoS Property that must be applied to each newly created Supplier Admin
  const CosNotification::QoSProperties& default_supplier_admin_qos_properties (void);

  // Set the default SA QoS Property.
  void default_supplier_admin_qos_properties (const CosNotification::QoSProperties &sa_qos);

  // The QoS Property that must be applied to each newly created Consumer Admin
  const CosNotification::QoSProperties& default_consumer_admin_qos_properties (void);

  // Set the default CA QoS Property.
  void default_consumer_admin_qos_properties (const CosNotification::QoSProperties &ca_qos);

  // The QoS Property that must be applied to each newly created Proxy Supplier
  const CosNotification::QoSProperties& default_proxy_supplier_qos_properties (void);

  // Set the default PS QoS Property.
  void default_proxy_supplier_qos_properties (const CosNotification::QoSProperties &ps_qos);

  // The QoS Property that must be applied to each newly created Proxy Consumer
  const CosNotification::QoSProperties& default_proxy_consumer_qos_properties (void);

  // Set the default PC QoS Property.
  void default_proxy_consumer_qos_properties (const CosNotification::QoSProperties &pc_qos);

  CosNotifyChannelAdmin::InterFilterGroupOperator defaultConsumerAdminFilterOp (void);
  void defaultConsumerAdminFilterOp (CosNotifyChannelAdmin::InterFilterGroupOperator op);

  CosNotifyChannelAdmin::InterFilterGroupOperator defaultSupplierAdminFilterOp (void);
  void defaultSupplierAdminFilterOp (CosNotifyChannelAdmin::InterFilterGroupOperator op);

protected:
  /// Object Factory
  TAO_Notify_Factory* factory_;

  /// Object Builder
  TAO_Notify_Builder* builder_;

  /// ORB
  CORBA::ORB_var orb_;

  /// dispatching orb
  CORBA::ORB_var dispatching_orb_;

  /// POA
  PortableServer::POA_var default_poa_;

  /// True if send asynch updates.
  CORBA::Boolean asynch_updates_;

  /// True if clients can reconnect to proxies.
  bool allow_reconnect_;
  bool validate_client_;
  ACE_Time_Value validate_client_delay_;
  ACE_Time_Value validate_client_interval_;

  /// True is separate dispatching orb
  bool separate_dispatching_orb_;

  /// True if updates are enabled (default).
  CORBA::Boolean updates_;

  /// The Update period for updates.
  ACE_Time_Value update_period_;

  /// The default EC QoS Properties.
  CosNotification::QoSProperties ec_qos_;

  /// The default SA QoS Properties.
  CosNotification::QoSProperties sa_qos_;

  /// The default CA QoS Properties.
  CosNotification::QoSProperties ca_qos_;

  /// The default PS QoS Properties.
  CosNotification::QoSProperties ps_qos_;

  /// The default PC QoS Properties.
  CosNotification::QoSProperties pc_qos_;

  /// The default consumer admin filter operator.
  CosNotifyChannelAdmin::InterFilterGroupOperator defaultConsumerAdminFilterOp_;

  /// The default supplier admin filter operator.
  CosNotifyChannelAdmin::InterFilterGroupOperator defaultSupplierAdminFilterOp_;
};

/**
 * @todo Remove this legacy TAO_Notify_Properties typedef.
 */
typedef TAO_Notify_Properties TAO_Notify_PROPERTIES;

TAO_END_VERSIONED_NAMESPACE_DECL

#if defined (__ACE_INLINE__)
#include "orbsvcs/Notify/Properties.inl"
#endif /* __ACE_INLINE__ */

#include /**/ "ace/post.h"

#endif /* TAO_Notify_PROPERTIES_H */


text:
name             'cloud-crawler'
maintainer       'Calculated Content'
maintainer_email 'charlesmartin14@gmail.com'
license          'All rights reserved'
description      'Installs/Configures cloud-crawler master node and monitor'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          '0.1.0'
depends          "git"
depends          "ruby_193"
depends          "redisio"
depends          "s3cmd"
depends          "sinatra_app"


text:
/**
 */
package CIM15.IEC61970.Informative.InfERPSupport;

import CIM15.IEC61970.Core.IdentifiedObject;

import CIM15.IEC61970.Informative.InfAssets.GenericAssetModelOrMaterial;
import CIM15.IEC61970.Informative.InfAssets.InfAssetsPackage;

import CIM15.IEC61970.Informative.InfWork.DesignLocation;
import CIM15.IEC61970.Informative.InfWork.InfWorkPackage;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

/**
 *
 * A representation of the model object 'Erp Bom Item Data'.
 *
 *
 *

 * The following features are supported:
 *

 *
{@link CIM15.IEC61970.Informative.InfERPSupport.ErpBomItemData#getTypeAsset Type Asset}

 *
{@link CIM15.IEC61970.Informative.InfERPSupport.ErpBomItemData#getErpBOM Erp BOM}

 *
{@link CIM15.IEC61970.Informative.InfERPSupport.ErpBomItemData#getDesignLocation Design Location}

 *

 *

 *
 * @generated
 */
public class ErpBomItemData extends IdentifiedObject {
	/**
	 * The cached value of the '{@link #getTypeAsset() Type Asset}' reference.
	 *
	 *
	 * @see #getTypeAsset()
	 * @generated
	 * @ordered
	 */
	protected GenericAssetModelOrMaterial typeAsset;

	/**
	 * The cached value of the '{@link #getErpBOM() Erp BOM}' reference.
	 *
	 *
	 * @see #getErpBOM()
	 * @generated
	 * @ordered
	 */
	protected ErpBOM erpBOM;

	/**
	 * The cached value of the '{@link #getDesignLocation() Design Location}' reference.
	 *
	 *
	 * @see #getDesignLocation()
	 * @generated
	 * @ordered
	 */
	protected DesignLocation designLocation;

	/**
	 *
	 *
	 * @generated
	 */
	protected ErpBomItemData() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return InfERPSupportPackage.Literals.ERP_BOM_ITEM_DATA;
	}

	/**
	 * Returns the value of the 'Type Asset' reference.
	 * It is bidirectional and its opposite is '{@link CIM15.IEC61970.Informative.InfAssets.GenericAssetModelOrMaterial#getErpBomItemDatas Erp Bom Item Datas}'.
	 *
	 *

	 * If the meaning of the 'Type Asset' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Type Asset' reference.
	 * @see #setTypeAsset(GenericAssetModelOrMaterial)
	 * @see CIM15.IEC61970.Informative.InfAssets.GenericAssetModelOrMaterial#getErpBomItemDatas
	 * @generated
	 */
	public GenericAssetModelOrMaterial getTypeAsset() {
		if (typeAsset != null && typeAsset.eIsProxy()) {
			InternalEObject oldTypeAsset = (InternalEObject)typeAsset;
			typeAsset = (GenericAssetModelOrMaterial)eResolveProxy(oldTypeAsset);
			if (typeAsset != oldTypeAsset) {
			}
		}
		return typeAsset;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public GenericAssetModelOrMaterial basicGetTypeAsset() {
		return typeAsset;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public NotificationChain basicSetTypeAsset(GenericAssetModelOrMaterial newTypeAsset, NotificationChain msgs) {
		GenericAssetModelOrMaterial oldTypeAsset = typeAsset;
		typeAsset = newTypeAsset;
		return msgs;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61970.Informative.InfERPSupport.ErpBomItemData#getTypeAsset Type Asset}' reference.
	 *
	 *
	 * @param value the new value of the 'Type Asset' reference.
	 * @see #getTypeAsset()
	 * @generated
	 */
	public void setTypeAsset(GenericAssetModelOrMaterial newTypeAsset) {
		if (newTypeAsset != typeAsset) {
			NotificationChain msgs = null;
			if (typeAsset != null)
				msgs = ((InternalEObject)typeAsset).eInverseRemove(this, InfAssetsPackage.GENERIC_ASSET_MODEL_OR_MATERIAL__ERP_BOM_ITEM_DATAS, GenericAssetModelOrMaterial.class, msgs);
			if (newTypeAsset != null)
				msgs = ((InternalEObject)newTypeAsset).eInverseAdd(this, InfAssetsPackage.GENERIC_ASSET_MODEL_OR_MATERIAL__ERP_BOM_ITEM_DATAS, GenericAssetModelOrMaterial.class, msgs);
			msgs = basicSetTypeAsset(newTypeAsset, msgs);
			if (msgs != null) msgs.dispatch();
		}
	}

	/**
	 * Returns the value of the 'Erp BOM' reference.
	 * It is bidirectional and its opposite is '{@link CIM15.IEC61970.Informative.InfERPSupport.ErpBOM#getErpBomItemDatas Erp Bom Item Datas}'.
	 *
	 *

	 * If the meaning of the 'Erp BOM' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Erp BOM' reference.
	 * @see #setErpBOM(ErpBOM)
	 * @see CIM15.IEC61970.Informative.InfERPSupport.ErpBOM#getErpBomItemDatas
	 * @generated
	 */
	public ErpBOM getErpBOM() {
		if (erpBOM != null && erpBOM.eIsProxy()) {
			InternalEObject oldErpBOM = (InternalEObject)erpBOM;
			erpBOM = (ErpBOM)eResolveProxy(oldErpBOM);
			if (erpBOM != oldErpBOM) {
			}
		}
		return erpBOM;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ErpBOM basicGetErpBOM() {
		return erpBOM;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public NotificationChain basicSetErpBOM(ErpBOM newErpBOM, NotificationChain msgs) {
		ErpBOM oldErpBOM = erpBOM;
		erpBOM = newErpBOM;
		return msgs;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61970.Informative.InfERPSupport.ErpBomItemData#getErpBOM Erp BOM}' reference.
	 *
	 *
	 * @param value the new value of the 'Erp BOM' reference.
	 * @see #getErpBOM()
	 * @generated
	 */
	public void setErpBOM(ErpBOM newErpBOM) {
		if (newErpBOM != erpBOM) {
			NotificationChain msgs = null;
			if (erpBOM != null)
				msgs = ((InternalEObject)erpBOM).eInverseRemove(this, InfERPSupportPackage.ERP_BOM__ERP_BOM_ITEM_DATAS, ErpBOM.class, msgs);
			if (newErpBOM != null)
				msgs = ((InternalEObject)newErpBOM).eInverseAdd(this, InfERPSupportPackage.ERP_BOM__ERP_BOM_ITEM_DATAS, ErpBOM.class, msgs);
			msgs = basicSetErpBOM(newErpBOM, msgs);
			if (msgs != null) msgs.dispatch();
		}
	}

	/**
	 * Returns the value of the 'Design Location' reference.
	 * It is bidirectional and its opposite is '{@link CIM15.IEC61970.Informative.InfWork.DesignLocation#getErpBomItemDatas Erp Bom Item Datas}'.
	 *
	 *

	 * If the meaning of the 'Design Location' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Design Location' reference.
	 * @see #setDesignLocation(DesignLocation)
	 * @see CIM15.IEC61970.Informative.InfWork.DesignLocation#getErpBomItemDatas
	 * @generated
	 */
	public DesignLocation getDesignLocation() {
		if (designLocation != null && designLocation.eIsProxy()) {
			InternalEObject oldDesignLocation = (InternalEObject)designLocation;
			designLocation = (DesignLocation)eResolveProxy(oldDesignLocation);
			if (designLocation != oldDesignLocation) {
			}
		}
		return designLocation;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public DesignLocation basicGetDesignLocation() {
		return designLocation;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public NotificationChain basicSetDesignLocation(DesignLocation newDesignLocation, NotificationChain msgs) {
		DesignLocation oldDesignLocation = designLocation;
		designLocation = newDesignLocation;
		return msgs;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61970.Informative.InfERPSupport.ErpBomItemData#getDesignLocation Design Location}' reference.
	 *
	 *
	 * @param value the new value of the 'Design Location' reference.
	 * @see #getDesignLocation()
	 * @generated
	 */
	public void setDesignLocation(DesignLocation newDesignLocation) {
		if (newDesignLocation != designLocation) {
			NotificationChain msgs = null;
			if (designLocation != null)
				msgs = ((InternalEObject)designLocation).eInverseRemove(this, InfWorkPackage.DESIGN_LOCATION__ERP_BOM_ITEM_DATAS, DesignLocation.class, msgs);
			if (newDesignLocation != null)
				msgs = ((InternalEObject)newDesignLocation).eInverseAdd(this, InfWorkPackage.DESIGN_LOCATION__ERP_BOM_ITEM_DATAS, DesignLocation.class, msgs);
			msgs = basicSetDesignLocation(newDesignLocation, msgs);
			if (msgs != null) msgs.dispatch();
		}
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__TYPE_ASSET:
				if (typeAsset != null)
					msgs = ((InternalEObject)typeAsset).eInverseRemove(this, InfAssetsPackage.GENERIC_ASSET_MODEL_OR_MATERIAL__ERP_BOM_ITEM_DATAS, GenericAssetModelOrMaterial.class, msgs);
				return basicSetTypeAsset((GenericAssetModelOrMaterial)otherEnd, msgs);
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__ERP_BOM:
				if (erpBOM != null)
					msgs = ((InternalEObject)erpBOM).eInverseRemove(this, InfERPSupportPackage.ERP_BOM__ERP_BOM_ITEM_DATAS, ErpBOM.class, msgs);
				return basicSetErpBOM((ErpBOM)otherEnd, msgs);
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__DESIGN_LOCATION:
				if (designLocation != null)
					msgs = ((InternalEObject)designLocation).eInverseRemove(this, InfWorkPackage.DESIGN_LOCATION__ERP_BOM_ITEM_DATAS, DesignLocation.class, msgs);
				return basicSetDesignLocation((DesignLocation)otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__TYPE_ASSET:
				return basicSetTypeAsset(null, msgs);
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__ERP_BOM:
				return basicSetErpBOM(null, msgs);
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__DESIGN_LOCATION:
				return basicSetDesignLocation(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__TYPE_ASSET:
				if (resolve) return getTypeAsset();
				return basicGetTypeAsset();
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__ERP_BOM:
				if (resolve) return getErpBOM();
				return basicGetErpBOM();
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__DESIGN_LOCATION:
				if (resolve) return getDesignLocation();
				return basicGetDesignLocation();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__TYPE_ASSET:
				setTypeAsset((GenericAssetModelOrMaterial)newValue);
				return;
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__ERP_BOM:
				setErpBOM((ErpBOM)newValue);
				return;
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__DESIGN_LOCATION:
				setDesignLocation((DesignLocation)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__TYPE_ASSET:
				setTypeAsset((GenericAssetModelOrMaterial)null);
				return;
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__ERP_BOM:
				setErpBOM((ErpBOM)null);
				return;
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__DESIGN_LOCATION:
				setDesignLocation((DesignLocation)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__TYPE_ASSET:
				return typeAsset != null;
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__ERP_BOM:
				return erpBOM != null;
			case InfERPSupportPackage.ERP_BOM_ITEM_DATA__DESIGN_LOCATION:
				return designLocation != null;
		}
		return super.eIsSet(featureID);
	}

} // ErpBomItemData


text:
namespace Nektar
{
    std::string FilterCheckpointCellModel::className = GetFilterFactory().RegisterCreatorFunction("CheckpointCellModel", FilterCheckpointCellModel::create);

    FilterCheckpointCellModel::FilterCheckpointCellModel(
        const LibUtilities::SessionReaderSharedPtr &pSession,
        const std::map<std::string, std::string> &pParams) :
        Filter(pSession)
    {
        if (pParams.find("OutputFile") == pParams.end())
        {
            m_outputFile = m_session->GetSessionName();
        }
        else
        {
            ASSERTL0(!(pParams.find("OutputFile")->second.empty()),
                     "Missing parameter 'OutputFile'.");
            m_outputFile = pParams.find("OutputFile")->second;
        }
        ASSERTL0(pParams.find("OutputFrequency") != pParams.end(),
                 "Missing parameter 'OutputFrequency'.");
        m_outputFrequency = atoi(pParams.find("OutputFrequency")->second.c_str());
        m_outputIndex = 0;
        m_index = 0;
        m_fld = MemoryManager<LibUtilities::FieldIO>::AllocateSharedPtr(m_session->GetComm());

    }

    FilterCheckpointCellModel::~FilterCheckpointCellModel()
    {

    }

    void FilterCheckpointCellModel::v_Initialise(const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields, const NekDouble &time)
    {
        ASSERTL0(m_cell.get(), "Cell model has not been set by EquationSystem "
                "class. Use SetCellModel on this filter to achieve this.");

        m_index = 0;
        m_outputIndex = 0;

        v_Update(pFields, 0.0);
    }

    void FilterCheckpointCellModel::v_Update(const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields, const NekDouble &time)
    {
        if (m_index++ % m_outputFrequency > 0)
        {
            return;
        }

        std::stringstream vOutputFilename;
        vOutputFilename << m_outputFile << "_" << m_outputIndex << ".chk";

        SpatialDomains::MeshGraphSharedPtr vGraph = pFields[0]->GetGraph();

        std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
            = pFields[0]->GetFieldDefinitions();
        std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());

        // copy Data into FieldData and set variable
        std::string varName;
        for(int j = 1; j < m_cell->GetNumCellVariables(); ++j)
        {
            varName = m_cell->GetCellVarName(j);

            for(int i = 0; i < FieldDef.size(); ++i)
            {
                // Retrieve data from cell model
                Array<OneD, NekDouble> data = m_cell->GetCellSolutionCoeffs(j);

                // Could do a search here to find correct variable
                FieldDef[i]->m_fields.push_back(varName);
                pFields[0]->AppendFieldData(FieldDef[i], FieldData[i], data);
            }
        }

        // Update time in field info if required
        LibUtilities::FieldMetaDataMap fieldMetaDataMap;
        fieldMetaDataMap["Time"] =  boost::lexical_cast<std::string>(time);

        m_fld->Write(vOutputFilename.str(),FieldDef,FieldData,fieldMetaDataMap);
        m_outputIndex++;
    }

    void FilterCheckpointCellModel::v_Finalise(const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields, const NekDouble &time)
    {

    }

    bool FilterCheckpointCellModel::v_IsTimeDependent()
    {
        return true;
    }
}


text:
//go:generate sh generate.sh

// Command genop generates a Go source file with functions for TensorFlow ops.
package main

import (
	"bytes"
	"flag"
	"go/format"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"

	"github.com/tensorflow/tensorflow/tensorflow/go/genop/internal"
)

func main() {
	var (
		filename = flag.String("outfile", "", "File to write generated source code to.")
		header   = flag.String("header", "", "Path to a file whose contents will be copied into the generated file. Can be empty")
		buf      bytes.Buffer
	)
	flag.Parse()
	if *filename == "" {
		log.Fatal("-outfile must be set")
	}
	if *header != "" {
		hdr, err := ioutil.ReadFile(*header)
		if err != nil {
			log.Fatalf("Unable to read %s: %v", *header, err)
		}
		buf.Write(hdr)
		buf.WriteString("\n\n")
	}
	os.MkdirAll(filepath.Dir(*filename), 0755)

	if err := internal.GenerateFunctionsForRegisteredOps(&buf); err != nil {
		log.Fatal(err)
	}
	formatted, err := format.Source(buf.Bytes())
	if err != nil {
		log.Fatalf("Failed to generate valid source? 'go fmt' failed: %v", err)
	}
	if err := ioutil.WriteFile(*filename, formatted, 0644); err != nil {
		log.Fatalf("Failed to write to %q: %v", *filename, err)
	}
}


text:
<feed xmlns="http://www.w3.org/2005/Atom">
<entry>
<content type="html"><figure></figure></content>
</entry>
</feed>


text:
"""Transformations to be applied on sequences."""

import abc
from typing import Dict, Optional, Sequence, Tuple, Union

import gin
import tensorflow as tf

from dedal import pairs
from dedal import vocabulary

Keys = Union[str, Sequence[str]]
Example = Dict[str, tf.Tensor]

@gin.configurable
class Transform(abc.ABC):
  """A generic class for transformations."""

  def __init__(self,
               on = 'sequence',
               out = None,
               vocab = None):
    self._on = (on,) if isinstance(on, str) else on
    out = self._on if out is None else out
    self._out = (out,) if isinstance(out, str) else out
    self._vocab = vocabulary.get_default() if vocab is None else vocab

  def single_call(self, arg):
    raise NotImplementedError()

  def call(self, *args):
    """Assumes the same order as `on` and `out` for args and outputs.

    This method by default calls the `single_call` method over each argument.
    For Transforms over single argument, the `single_call` method should be
    overwritten. For Transforms over many arguments, one should directly
    overload the `call` method itself.

    Args:
      *args: the argument of the transformation. For Transform over a single
        input, it can be a Sequence of arguments, in which case the Transform
        will be applied over each of them.

    Returns:
      A tf.Tensor or tuple of tf.Tensor.
    """
    result = tuple(self.single_call(arg) for arg in args)
    return result if len(args) > 1 else result[0]

  def __call__(self, inputs):
    keys = set(inputs.keys())
    if not keys.issuperset(self._on):
      raise ValueError(f'The keys of the input ({keys}) are not matching the'
                       f' transform input keys: {self._on}')

    args = tuple(inputs.pop(key) for key in self._on)
    outputs = self.call(*args)
    outputs = (outputs,) if not isinstance(outputs, Sequence) else outputs
    for key, output in zip(self._out, outputs):
      if output is not None:
        inputs[key] = output
    for i, key in enumerate(self._on):
      if key not in self._out:
        inputs[key] = args[i]
    return inputs

@gin.configurable
class Pop(Transform):

  def call(self, *args):
    return None

@gin.configurable
class ReKey(Transform):

  def single_call(self, arg):
    return arg

@gin.configurable
class Cast(Transform):
  """Casts a tensor to a particular dtype."""

  def __init__(self, dtype, **kwargs):
    super().__init__(**kwargs)
    self._dtype = tf.dtypes.as_dtype(dtype)

  def single_call(self, arg):
    return tf.cast(arg, self._dtype)

@gin.configurable
class Concat(Transform):
  """Concatenates tensors of compatible shapes."""

  def __init__(self, axis = 0, **kwargs):
    super().__init__(**kwargs)
    self._axis = axis

  def call(self, *args):
    return tf.concat(args, axis=self._axis)

@gin.configurable
class Reshape(Transform):
  """Reshapes a tensor to a compatible target shape."""

  def __init__(self, shape, **kwargs):
    super().__init__(**kwargs)
    self._shape = shape

  def single_call(self, arg):
    return tf.reshape(arg, self._shape)

@gin.configurable
class Stack(Transform):
  """Stacks tensors of compatible shapes."""

  def __init__(self, axis = 0, **kwargs):
    super().__init__(**kwargs)
    self._axis = axis

  def call(self, *args):
    return tf.stack(args, axis=self._axis)

@gin.configurable
class Encode(Transform):
  """Encodes a string into a integers."""

  def __init__(self, **kwargs):
    super().__init__(**kwargs)
    init = tf.lookup.KeyValueTensorInitializer(
        keys=tf.constant(list(self._vocab._indices.keys())),
        values=tf.constant(list(self._vocab._indices.values()), dtype=tf.int64))
    self._lookup = tf.lookup.StaticVocabularyTable(init, num_oov_buckets=1)

  def single_call(self, arg):
    return tf.cast(self._lookup[tf.strings.bytes_split(arg)], tf.int32)

@gin.configurable
class Recode(Transform):
  """Changes the integer-based encoding of amino acids."""

  def __init__(self, target, **kwargs):
    super().__init__(**kwargs)
    self._vocab_map = self._vocab.translate(target)

  def single_call(self, arg):
    return tf.gather(self._vocab_map, arg)

@gin.configurable
class ComputeSequenceLength(Transform):
  """Computes the length of a sequence."""

  def single_call(self, arg):
    if arg.dtype == tf.string:
      arg = tf.reshape(arg, ())
      return tf.strings.length(arg)
    else:
      mask = tf.logical_and(self._vocab.padding_mask(arg),
                            self._vocab.special_token_mask(arg))
      return tf.reduce_sum(tf.cast(mask, tf.int32))

@gin.configurable
class CropOrPad(Transform):
  """Crops or left/right pads a sequence with the same token."""

  def __init__(self,
               size = gin.REQUIRED,
               random = True,
               right = True,
               token = None,
               seed = None,
               **kwargs):
    super().__init__(**kwargs)
    self._size = size
    self._random = random
    self._right = right
    self._token = self._vocab.get(token, self._vocab.padding_code)
    self._seed = seed

  def single_call(self, arg):
    seq_len = tf.shape(arg)[0]
    if seq_len < self._size:
      to_pad = self._size - seq_len
      pattern = [0, to_pad] if self._right else [to_pad, 0]
      arg = tf.pad(arg, [pattern], constant_values=self._token)
    elif seq_len > self._size:
      arg = (
          tf.image.random_crop(arg, [self._size], seed=self._seed)
          if self._random else arg[:self._size])
    arg.set_shape([self._size])
    return arg

@gin.configurable
class AppendToken(Transform):
  """Left/Right pads a sequence with the a single token."""

  def __init__(self, right = True, token = None, **kwargs):
    super().__init__(**kwargs)
    self._token = self._vocab.get(token, self._vocab.padding_code)
    self._right = right

  def single_call(self, arg):
    pattern = [0, 1] if self._right else [1, 0]
    return tf.pad(arg, [pattern], constant_values=self._token)

@gin.configurable
class EOS(AppendToken):
  """Adds EOS token."""

  def __init__(self, token=None, **kwargs):
    """If token is not passed, assumed to be the last special."""
    super().__init__(right=True, token=token, **kwargs)  # Sets vocab and token.
    if token is None:  # Resets self._token to be the last special.
      token = self._vocab.specials[-1]
      self._token = self._vocab.get(token)

@gin.configurable
class PrependClass(AppendToken):
  """Prepends CLS token."""

  def __init__(self, token=None, **kwargs):
    """If token is not passed, assumed to be the penultimate special."""
    super().__init__(right=False, token=token, **kwargs)
    if token is None:  # Resets self._token to be the penultimate special.
      token = self._vocab.specials[-2]
      self._token = self._vocab.get(token)

@gin.configurable
class CropOrPadND(Transform):
  """Left/Right pads a tensor along its last dimension with the same value."""

  def __init__(self,
               size = 1,
               right = True,
               value = 0,
               axis = -1,
               **kwargs):
    super().__init__(**kwargs)
    self._size = size
    self._right = right
    self._axis = axis
    self._value = value

  def single_call(self, arg):
    length = tf.shape(arg)[self._axis]
    shape = arg.shape.as_list()
    shape[self._axis] = self._size
    if length < self._size:
      to_pad = self._size - length
      pattern = int(arg.shape.rank) * [[0, 0]]
      pattern[self._axis] = [0, to_pad] if self._right else [to_pad, 0]
      result = tf.pad(arg, pattern, constant_values=self._value)
    else:
      result = tf.image.random_crop(arg, shape)
    result.set_shape(shape)
    return result

@gin.configurable
class RemoveTokens(Transform):
  """Removes all positions in a sequence containing certain tokens."""

  def __init__(self, tokens = '-', **kwargs):
    super().__init__(**kwargs)
    self._tokens = (tokens,) if isinstance(tokens, str) else tokens

  def single_call(self, arg):
    mask = self._vocab.compute_mask(arg, self._tokens)
    keep_indices = tf.reshape(tf.where(mask), [-1])
    return tf.gather(arg, keep_indices)

@gin.configurable
class OneHot(Transform):
  """Turns sequence of integers into sequences of one-hot encodings."""

  def __init__(self, depth = None, **kwargs):
    super().__init__(**kwargs)
    self._depth = depth if depth is not None else len(self._vocab)

  def single_call(self, arg):
    return tf.one_hot(arg, self._depth, dtype=tf.float32)

@gin.configurable
class ContactMatrix(Transform):
  """Process the 3D positions and turn them into a contact matrix."""

  def __init__(self, threshold = 10.0, **kwargs):
    super().__init__(**kwargs)
    self._threshold = threshold

  def single_call(self, arg):
    """Expects positions to be a tf.Tensor<float>[n, 3]."""
    # Makes a batch of size 1 to be compatible with pairwise_square_dist.
    pos = tf.expand_dims(arg, 0)
    sq_dist = pairs.square_distances(pos, pos)[0]
    return tf.cast(sq_dist < self._threshold ** 2, dtype=tf.float32)

@gin.configurable
class ContactMask(Transform):
  """Process the masks and turn them into a contact matrix."""

  def __init__(self, shape, **kwargs):
    super().__init__(**kwargs)
    self._shape = shape

  def single_call(self, arg):
    """For later."""
    # Makes a batch of size 1 to be compatible with pairwise_square_dist.
    arg = tf.cast(arg[None, :] * arg[:, None], dtype=tf.float32)
    arg.set_shape(self._shape)
    return arg

@gin.configurable
class BackboneAngleTransform(Transform):
  """Maps tf.Tensor<float>[len, 1] of angles to [len, 2] tensor of sin/cos."""

  def single_call(self, arg):
    sin, cos = tf.sin(arg), tf.cos(arg)
    return tf.concat([sin, cos], -1)

@gin.configurable
class DatasetTransform(abc.ABC):
  """A generic class for dataset-level transformations."""

  @abc.abstractmethod
  def call(self, ds):
    """A transformation function to be used with `tf.data.Dataset.apply`."""
    pass

  def __call__(self, ds):
    return self.call(ds)

@gin.configurable
class FilterByLength(DatasetTransform):
  """Filters a dataset by the length of one or more sequences."""

  def __init__(self,
               on = 'seq_len',
               vocab = None,
               max_len = 512,
               precomputed = True):
    self._on = (on,) if isinstance(on, str) else on
    self._vocab = vocabulary.get_default() if vocab is None else vocab
    self._max_len = max_len
    self._precomputed = precomputed

  def _get_len(self, t):
    if not self._precomputed:
      if t.dtype == tf.string:
        t = tf.reshape(t, ())
        return tf.strings.length(t)
      else:
        mask = tf.logical_and(
            self._vocab.padding_mask(t), self._vocab.special_token_mask(t))
        return tf.reduce_sum(tf.cast(mask, tf.int32))
    return t

  def _filter_fn(self, ex):
    cond = tf.convert_to_tensor(True, tf.bool)
    for key in self._on:
      cond = tf.math.logical_and(cond, self._get_len(ex[key]) <= self._max_len)
    return cond

  def call(self, ds):
    return ds.filter(self._filter_fn)


text:
"use strict" ;

const asyncKit = require( 'async-kit' ) ;
const string = require( 'string-kit' ) ;
const termkit = require( 'terminal-kit' ) ;
const term = termkit.realTerminal ;

//const notifications = require( 'freedesktop-notifications' ) ;
//notifications.setAppName( 'wfm' ) ;

const path = require( 'path' ) ;

const minimist = require( 'minimist' ) ;
const glob = require( 'glob' ) ;

const ubenchPackage = require( '../package.json' ) ;

function noop() {}

const ubench = {} ;
module.exports = ubench ;

ubench.cli = () => {
	var i , iMax , args , v , package_ , benchFiles ;
	//var context = {} ;

	var runtime = {
		warmupTimeout: 1000 ,
		coolDownTimeout: 1000 ,
		benchTimeout: 5000 ,
		count: 1 ,
		benchFn: {} ,
		grep: []
	} ;

	term.bold.magenta( 'ubench' ).dim( ' v%s by Cédric Ronvel\n\n' , ubenchPackage.version ) ;

	// Manage command line arguments
	args = minimist( process.argv.slice( 2 ) ) ;

	if ( args.h || args.help ) {
		ubench.usage() ;
		return ;
	}

	if ( args.fast ) {
		runtime.warmupTimeout = 200 ;
		runtime.coolDownTimeout = 200 ;
		runtime.benchTimeout = 1000 ;
	}

	if ( args.b && ( v = parseInt( args.b , 10 ) ) ) { runtime.benchTimeout = v ; }
	if ( args.w && ( v = parseInt( args.w , 10 ) ) ) { runtime.warmupTimeout = v ; }
	if ( args.c && ( v = parseInt( args.c , 10 ) ) ) { runtime.coolDownTimeout = v ; }
	if ( args.n && ( v = parseInt( args.n , 10 ) ) ) { runtime.count = v ; }

	// Turn string into regexp for the "grep" feature
	if ( Array.isArray( args.g ) ) {
		for ( i = 0 , iMax = args.g.length ; i < iMax ; i ++ ) {
			runtime.grep[ i ] = new RegExp( args.g[ i ] , 'i' ) ;
		}
	}
	else if ( args.g ) {
		runtime.grep[ 0 ] = new RegExp( args.g , 'i' ) ;
	}

	if ( args._.length ) {
		benchFiles = args._.map( e => path.isAbsolute( e ) ? e : process.cwd() + '/' + e ) ;
	}
	else {
		// Require the package.json
		try {
			package_ = require( process.cwd() + '/package.json' ) ;
		}
		catch ( error ) {
			if ( error.code === 'MODULE_NOT_FOUND' ) { ubench.exitError( "No package.json found.\n" ) ; }
			else { ubench.exitError( "Error in the package.json: %E\n" , error ) ; }
		}

		// Get the bench directory
		if ( ! package_.directories || ! package_.directories.bench ) {
			ubench.exitError( "The package.json miss a directories.bench path, set to the directory containing bench files.\n" ) ;
		}

		// Load all bench files
		benchFiles = glob.sync( process.cwd() + '/' + package_.directories.bench + '/*js' ) ;
	}

	// Register to global
	global.benchmark = ubench.registerBenchmark.bind( runtime ) ;
	global.competitor = ubench.registerCompetitor.bind( runtime ) ;

	if ( ! global.gc ) {
		term.red( 'Cannot run the garbage collector manually\n\n' ) ;
		global.gc = function() {} ;
	}

	try {
		for ( i = 0 , iMax = benchFiles.length ; i < iMax ; i ++ ) {
			require( benchFiles[ i ] ) ;
		}
	}
	catch ( error ) {
		ubench.exitError( "Error in the bench file '" + benchFiles[ i ] + "': %E\n" , error ) ;
	}

	if ( args.check ) {
		ubench.check( runtime ) ;
	}

	ubench.init( () => {
		// Remove console.log and error
		console.log = console.error = noop ;
		ubench.run( runtime ) ;
	} ) ;
} ;

ubench.usage = () => {
	term.blue( "Usage is: ubench [<benchmark file1>] [<benchmark file2>] [...] [<option1>] [<option2>] [...]\n" ) ;
	term.blue( "Available options:\n" ) ;
	term.blue( "  -g           Grep by Benchmark name (can be used multiple times)\n" ) ;
	term.blue( "  -b           Benchmark timeout (default: 5000ms)\n" ) ;
	term.blue( "  -w           Warmup timeout (default: 1000ms)\n" ) ;
	term.blue( "  -c           Cool-down timeout (default: 1000ms)\n" ) ;
	term.blue( "  -n           Number of time each benchmark should be done (default: 1)\n" ) ;
	term.blue( "  --fast       Shortcut for options ^/-b 1000 -c 200 -w 200^:\n" ) ;
	term.blue( "  --jx         Run jx (jxcore) instead of node for the benchmark\n" ) ;
	term.blue( "  -h , --help  Show this help\n" ) ;
	term.blue( "\n" ) ;
} ;

ubench.init = callback => {
	//notifications.init( callback ) ;
	callback() ;
} ;

ubench.exitError = ( ... args ) => {
	var message = string.format( ... args ) ;

	term.bold.red( message ) ;

	/*
	notifications.createNotification( {
		summary: 'ubench: error' ,
		body: message ,
		icon: 'dialog-warning'
	} ).push() ;
	*/

	process.exit( 1 ) ;
} ;

ubench.check = runtime => {
	Object.keys( runtime.benchFn ).forEach( benchName => {

		term( '^_^y== Benchmark: ^Y^/%s^:^y^_ ==\n' , benchName ) ;

		Object.keys( runtime.benchFn[ benchName ] ).forEach( benchCompetitor => {

			term( "^M^/^_%s^:: " , benchCompetitor ) ;

			try {
				term.noFormat( string.inspect( { style: 'color' } , runtime.benchFn[ benchName ][ benchCompetitor ]() ) ) ;
			}
			catch ( error ) {
				term( "^R^+Error!^ %E" , runtime.benchFn[ benchName ][ benchCompetitor ]() ) ;
			}
		} ) ;
	} ) ;

	term( '\n' ) ;
	term.styleReset() ;
	process.exit() ;
} ;

ubench.run = runtime => {
	asyncKit.foreach( runtime.benchFn , ( e , benchName , outerForeachCallback ) => {

		term( '^_^y== Benchmark: ^Y^/%s^:^y^_ ==\n' , benchName ) ;

		asyncKit.map( e , ( benchFn , benchCompetitor , innerForeachCallback ) => {

			var benchMethod = ubench.doOneBench ;

			// Force the GC now!
			term.column.eraseLine( 1 , "^M^/%s^: -- ^g^+GARBAGE COLLECTION^:" , benchCompetitor ) ;
			global.gc() ;
			term.column.eraseLine( 1 , "^M^/%s^: -- ^C^+COOLDOWN^:" , benchCompetitor ) ;

			setTimeout( () => {

				term.column.eraseLine( 1 , "^M^/%s^: -- ^Y^+WARMUP^:" , benchCompetitor ) ;

				benchMethod( benchFn , runtime.warmupTimeout , () => {

					// Force the GC now!
					term.column.eraseLine( 1 , "^M^/%s^: -- ^g^+GARBAGE COLLECTION^:" , benchCompetitor ) ;
					global.gc() ;
					term.column.eraseLine( 1 , "^M^/%s^: -- ^C^+COOLDOWN^:" , benchCompetitor ) ;

					setTimeout( () => {

						//var startMemory , endMemory ;

						term.column.eraseLine( 1 , "^M^/%s^: -- ^R^+BENCHMARKING^:" , benchCompetitor ) ;

						//startMemory = process.memoryUsage().heapUsed ;

						benchMethod( benchFn , runtime.benchTimeout , innerForeachCallback ) ;

						/*
							benchMethod( benchFn , runtime.benchTimeout , function( error , result ) {

								term.column.eraseLine( 1 , "^M^/%s^: -- ^C^+COOLDOWN^:" , benchCompetitor ) ;

								// Force the GC now!
								global.gc() ;
								//endMemory = process.memoryUsage().heapUsed ;
								//result.memoryLeak = endMemory - startMemory ;

								setTimeout( innerForeachCallback.bind( undefined , error , result ) , runtime.coolDownTimeout / 2 ) ;
							} ) ;
							//*/
					} , runtime.coolDownTimeout
					) ;
				} ) ;
			} , runtime.coolDownTimeout / 2 ) ;
		} )
			.parallel( 1 )
			.exec( ( error , results ) => {

				var benchCompetitor , fastest = 0 , col = 0 ;

				//var paddingLeak = 0 , numLeak ;

				if ( error ) { outerForeachCallback( error ) ; return ; }

				for ( benchCompetitor in results ) {
					if ( results[ benchCompetitor ].opsPerSecond > fastest ) { fastest = results[ benchCompetitor ].opsPerSecond ; }
					if ( benchCompetitor.length > col ) { col = benchCompetitor.length ; }

					/*
					numLeak = '' + results[ benchCompetitor ].memoryLeak ;
					if ( numLeak.length > paddingLeak ) { paddingLeak = numLeak.length ; }
					*/
				}

				col += 3 ;

				for ( benchCompetitor in results ) {
					term.column.eraseLine( 1 , '^M^/%s^:' , benchCompetitor ) ;

					term.column( col , '^B%[.2!L15]f^b ops/s   ' , results[ benchCompetitor ].opsPerSecond ) ;

					if ( results[ benchCompetitor ].opsPerSecond < fastest ) {
						term( ' ^B%[.1L4]f%%^ ' , 100 * results[ benchCompetitor ].opsPerSecond / fastest ) ;
					}
					else {
						term( '^R^+^_FASTEST^:' ) ;
					}

					term( '   ^B%[L8]kB^b   ' , results[ benchCompetitor ].memory ) ;

					// The gc do not want to do the job on demand, so it's not possible to check memory leak ATM
					/*
					numLeak = '' + results[ benchCompetitor ].memoryLeak ;
					if ( numLeak.length < paddingLeak ) { numLeak = ' '.repeat( paddingLeak - numLeak.length ) + numLeak ; }
					term( '   ^B%s^b leak   ' , numLeak ) ;
					*/

					term( '^:\n' ) ;
				}

				term( '\n' ) ;

				outerForeachCallback() ;
			} ) ;

	} )
		.nice( 10 )
		.exec( () => {

			runtime.count -- ;

			if ( runtime.count ) {
				ubench.run( runtime ) ;
				return ;
			}

			term.styleReset() ;
			process.exit() ;
		} ) ;
} ;

ubench.doOneBench = ( benchFn , timeout , callback ) => {
	var count , startTime , endTime , maxEndTime , startMemory , endMemory ;

	/*
	var fnThis = Object.create( null ) ;
	//benchFn = benchFn.bind( fnThis ) ;
	//*/

	startMemory = process.memoryUsage().heapUsed ;

	// We do not want to mesure the for loop speed, so we run at least 100 times the bench function
	for ( count = 0 , startTime = Date.now() , maxEndTime = startTime + timeout ; ( endTime = Date.now() ) < maxEndTime ; count += 100 ) {
		//*
		benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ;
		benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ;
		benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ;
		benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ;
		benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ;
		benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ;
		benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ;
		benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ;
		benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ;
		benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ; benchFn() ;
		//*/

		/*
		benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ;
		benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ;
		benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ;
		benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ;
		benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ;
		benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ;
		benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ;
		benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ;
		benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ;
		benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ; benchFn.call( fnThis ) ;
		//*/
	}

	endMemory = process.memoryUsage().heapUsed ;

	//console.log( count , startTime , endTime , endTime - startTime ) ;
	callback( undefined , {
		opsPerSecond: 1000 * count / ( endTime - startTime ) ,
		memory: endMemory - startMemory
	} ) ;
} ;

/* User-land global functions */

var intoBenchmark = null ;
var fnThis = Object.create( null ) ;

ubench.registerBenchmark = function benchmark( benchName , fn ) {
	var i , iMax ;

	if ( ! benchName || typeof benchName !== 'string' || typeof fn !== 'function' ) {
		throw new Error( "Usage is benchmark( name , fn )" ) ;
	}

	// Filter out benchmarks that are not relevant
	for ( i = 0 , iMax = this.grep.length ; i < iMax ; i ++ ) {
		if ( ! benchName.match( this.grep[ i ] ) ) { return ; }
	}

	if ( ! this.benchFn[ benchName ] ) { this.benchFn[ benchName ] = {} ; }

	intoBenchmark = benchName ;
	fn.call( fnThis ) ;
	intoBenchmark = null ;
} ;

ubench.registerCompetitor = function competitor( benchCompetitor , fn ) {
	if ( ! benchCompetitor || typeof benchCompetitor !== 'string' || typeof fn !== 'function' ) {
		throw new Error( "Usage is competitor( name , fn )" ) ;
	}

	if ( ! intoBenchmark ) {
		throw new Error( "competitor() should be called from within a benchmark() callback" ) ;
	}

	// This cause raw power loss on small bench (like a "i++" bench), but this produce more stable result.
	// Otherwise, some competitor would run faster (sometime twice as fast) for no reason at all
	// (even if the code is a copy-paste of another one, which run 2 times slower for some unknown reasons).
	// Also benchmarks consume far less memory this way.
	this.benchFn[ intoBenchmark ][ benchCompetitor ] = fn.bind( fnThis ) ;

	//this.benchFn[ intoBenchmark ][ benchCompetitor ] = fn ;
	//this.benchFn[ intoBenchmark ][ benchCompetitor ] = fn.bind( Object.create( null ) ) ;
	//this.benchFn[ intoBenchmark ][ benchCompetitor ] = fn.bind( undefined ) ;
} ;


text:
#ifndef _ORG_LABCRYPTO_HOTTENTOT_GENERATOR__OS_H_
#define _ORG_LABCRYPTO_HOTTENTOT_GENERATOR__OS_H_

#include <string>

namespace org {
namespace labcrypto {
namespace hottentot {
namespace generator {
  class Os {
  public:
    static void MakeDir(std::string pathString);
    static void ReadFile(std::string path, std::string &content);
    static void WriteFile(std::string path , std::string &content);
  };
}
}
}
}

#endif


text:
@interface RSWebViewController : UIViewController

-(void) loadURL:(NSURL *)url;

@end


text:
import {OutputNode} from '../../../src/compile/data/dataflow';
import {ParseNode} from '../../../src/compile/data/formatparse';
import {optimizeDataflow} from '../../../src/compile/data/optimize';
import {SourceNode} from '../../../src/compile/data/source';
import {parseLayerModel} from '../../util';

describe('compile/data/optimize', () => {
  describe('optimizeDataFlow', () => {
    it('should move up common parse', () => {
      const source = new SourceNode(null);
      const parseOne = new ParseNode(source, {a: 'time', b: 'number'});
      const parseTwo = new ParseNode(source, {a: 'time', b: 'date'});
      new OutputNode(parseOne, 'foo', null, {foo: 1});
      new OutputNode(parseTwo, 'bar', null, {bar: 1});

      optimizeDataflow({sources: [source]} as any, null);

      expect(source.children).toHaveLength(1);
      expect(source.children[0]).toBeInstanceOf(ParseNode);

      const commonParse = source.children[0] as ParseNode;
      expect(commonParse.parse).toEqual({a: 'time'});
      expect(commonParse.children).toHaveLength(2);

      expect(commonParse.children[0]).toBeInstanceOf(ParseNode);
      expect(commonParse.children[0]).toEqual(parseOne);

      expect(commonParse.children[1]).toBeInstanceOf(ParseNode);
      expect(commonParse.children[1]).toEqual(parseTwo);
    });

    it('should push parse up from lowest level first to avoid conflicting common parse', () => {
      const source = new SourceNode(null);
      const parseOne = new ParseNode(source, {a: 'time'});
      const parseTwo = new ParseNode(source, {b: 'number'});
      const parseThree = new ParseNode(parseTwo, {a: 'number'});
      new OutputNode(parseOne, 'foo', null, {foo: 1});
      new OutputNode(parseThree, 'bar', null, {bar: 1});

      optimizeDataflow({sources: [source]} as any, null);

      expect(source.children).toHaveLength(1);
      expect(source.children[0]).toBeInstanceOf(ParseNode);

      const commonParse = source.children[0] as ParseNode;
      expect(commonParse.parse).toEqual({b: 'number'});

      expect(commonParse.children).toHaveLength(2);
      expect(commonParse.children[0]).toBeInstanceOf(ParseNode);
      expect(commonParse.children[1]).toBeInstanceOf(ParseNode);

      const p1 = commonParse.children[0] as ParseNode;
      const p2 = commonParse.children[1] as ParseNode;

      expect(p1.parse).toEqual({a: 'time'});
      expect(p2.parse).toEqual({a: 'number'});
    });

    it('should rename signals when merging BinNodes', () => {
      const transform = {
        bin: {extent: [0, 100] as [number, number], anchor: 6},
        field: 'Acceleration',
        as: ['binned_acceleration_start', 'binned_acceleration_stop']
      };
      const model = parseLayerModel({
        layer: [
          {
            transform: [transform],
            mark: 'rect',
            encoding: {}
          },
          {
            transform: [transform],
            mark: 'rect',
            encoding: {}
          }
        ]
      });
      model.parse();
      optimizeDataflow(model.component.data, model);
      expect(model.getSignalName('layer_0_bin_extent_0_100_anchor_6_maxbins_10_Acceleration_bins')).toEqual(
        'layer_1_bin_extent_0_100_anchor_6_maxbins_10_Acceleration_bins'
      );
    });
  });
});


text:
#include "Clipboard.h"

#include <QApplication>
#include <QClipboard>
#include <QTimer>

#include "core/Config.h"

Clipboard* Clipboard::m_instance(nullptr);

Clipboard::Clipboard(QObject* parent)
    : QObject(parent)
    , m_timer(new QTimer(this))
{
    m_timer->setSingleShot(true);
    connect(m_timer, SIGNAL(timeout()), SLOT(clearClipboard()));
    connect(qApp, SIGNAL(aboutToQuit()), SLOT(clearCopiedText()));
}

void Clipboard::setText(const QString& text)
{
    QClipboard* clipboard = QApplication::clipboard();

    clipboard->setText(text, QClipboard::Clipboard);
    if (clipboard->supportsSelection()) {
        clipboard->setText(text, QClipboard::Selection);
    }

    if (config()->get("security/clearclipboard").toBool()) {
        int timeout = config()->get("security/clearclipboardtimeout").toInt();
        if (timeout > 0) {
            m_lastCopied = text;
            m_timer->start(timeout * 1000);
        }
    }
}

void Clipboard::clearCopiedText()
{
    if (m_timer->isActive()) {
        m_timer->stop();
        clearClipboard();
    }
}

void Clipboard::clearClipboard()
{
    QClipboard* clipboard = QApplication::clipboard();

    if (!clipboard) {
        qWarning("Unable to access the clipboard.");
        return;
    }

    if (clipboard->text(QClipboard::Clipboard) == m_lastCopied) {
        clipboard->clear(QClipboard::Clipboard);
    }

    if (clipboard->supportsSelection()
            && (clipboard->text(QClipboard::Selection) == m_lastCopied)) {
        clipboard->clear(QClipboard::Selection);
    }

    m_lastCopied.clear();
}

Clipboard* Clipboard::instance()
{
    if (!m_instance) {
        m_instance = new Clipboard(qApp);
    }

    return m_instance;
}


text:
/**
 * JavaScript code for the "Export" screen
 *
 * @package TablePress
 * @subpackage Views JavaScript
 * @author Tobias Bäthge
 * @since 1.0.0
 */

jQuery( document ).ready( function( $ ) {

	'use strict';

	/**
	 * Check, whether inputs are valid
	 *
	 * @since 1.0.0
	 */
	$( '#tablepress-page' ).find( 'form' ).on( 'submit', function( /* event */ ) {
		var selected_tables = $( '#tables-export' ).val(),
			num_selected = ( selected_tables ) ? selected_tables.length : 0;

		// only submit form, if at least one table was selected
		if ( 0 === num_selected ) {
			return false;
		}

		// at this point, the form is valid and will be submitted

		// add selected tables as a list to a hidden field
		$( '#tables-export-list' ).val( selected_tables.join( ',' ) );

		// on form submit: Enable disabled fields, so that they are transmitted in the POST request
		$( '#tables-export-zip-file' ).prop( 'disabled', false );
	} );

	/**
	 * Show export delimiter dropdown box only if export format is CSV
	 *
	 * @since 1.0.0
	 */
	$( '#tables-export-format' ).on( 'change', function() {
		var non_csv_selected = ( 'csv' !== $(this).val() );
		$( '#tables-export-csv-delimiter' ).prop( 'disabled', non_csv_selected );
		$( '#tables-export-csv-delimiter-description' ).toggle( non_csv_selected );
	} )
	.change();

	/**
	 * Automatically check and disable the "ZIP file" checkbox whenever more than one table is selected
	 *
	 * @since 1.0.0
	 */
	var zip_file_manually_checked = false;
	$( '#tables-export-zip-file' ).on( 'change', function() {
		zip_file_manually_checked = $(this).prop( 'checked' );
	} );
	$( '#tables-export' ).on( 'change', function() {
		var selected_tables = $(this).val(),
			num_selected = ( selected_tables ) ? selected_tables.length : 0,
			zip_file_required = ( num_selected > 1 );
		$( '#tables-export-zip-file' )
			.prop( 'disabled', zip_file_required )
			.prop( 'checked', zip_file_required || zip_file_manually_checked );
		$( '#tables-export-zip-file-description' ).toggle( zip_file_required );
		// set state of "Select all" checkbox
		$( '#tables-export-select-all' ).prop( 'checked', 0 === $(this).find( 'option' ).not( ':selected' ).length );
	} )
	.change();

	/**
	 * Select all entries from the multiple-select dropdown on checkbox change
	 *
	 * @since 1.0.0
	 */
	$( '#tables-export-select-all' ).on( 'change', function() {
		var $tables = $( '#tables-export' );
		$tables.find( 'option' ).prop( 'selected', $(this).prop( 'checked' ) );
		$tables.change(); // to update ZIP file checkbox
	} );

	/**
	 * Automatically focus the tables dropdown
	 *
	 * @since 1.0.0
	 */
	$( '#tables-export' ).focus();

} );


text:
/*
 * EDACCExperimentModeGenerateJobs.java
 *
 * Created on 09.04.2011, 18:43:44
 */
package edacc;

import edacc.experiment.Util;

/**
 *
 * @author simon
 */
public class EDACCExperimentModeGenerateJobs extends javax.swing.JDialog {

    private boolean cancelled;
    private int cpuTimeLimit, memoryLimit, wallClockTimeLimit, stackSizeLimit, maxSeed;

    /** Creates new form EDACCExperimentModeGenerateJobs */
    public EDACCExperimentModeGenerateJobs(java.awt.Frame parent, boolean modal, int cpuTimeLimit, int memoryLimit, int wallClockTimeLimit, int stackSizeLimit) {
        super(parent, modal);
        initComponents();
        cancelled = true;
        txtCPUTimeLimit.setText("" + cpuTimeLimit);
        txtMemoryLimit.setText("" + memoryLimit);
        txtWallClockTimeLimit.setText("" + wallClockTimeLimit);
        txtStackSizeLimit.setText("" + stackSizeLimit);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        txtCPUTimeLimit = new javax.swing.JTextField();
        txtMemoryLimit = new javax.swing.JTextField();
        txtWallClockTimeLimit = new javax.swing.JTextField();
        txtStackSizeLimit = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        txtMaxSeed = new javax.swing.JTextField();
        btnGenerate = new javax.swing.JButton();
        btnCancel = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(edacc.EDACCApp.class).getContext().getResourceMap(EDACCExperimentModeGenerateJobs.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        txtCPUTimeLimit.setText(resourceMap.getString("txtCPUTimeLimit.text")); // NOI18N
        txtCPUTimeLimit.setToolTipText(resourceMap.getString("txtCPUTimeLimit.toolTipText")); // NOI18N
        txtCPUTimeLimit.setName("txtCPUTimeLimit"); // NOI18N
        txtCPUTimeLimit.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txtCPUTimeLimitFocusGained(evt);
            }
        });

        txtMemoryLimit.setText(resourceMap.getString("txtMemoryLimit.text")); // NOI18N
        txtMemoryLimit.setToolTipText(resourceMap.getString("txtMemoryLimit.toolTipText")); // NOI18N
        txtMemoryLimit.setName("txtMemoryLimit"); // NOI18N

        txtWallClockTimeLimit.setText(resourceMap.getString("txtWallClockTimeLimit.text")); // NOI18N
        txtWallClockTimeLimit.setName("txtWallClockTimeLimit"); // NOI18N

        txtStackSizeLimit.setText(resourceMap.getString("txtStackSizeLimit.text")); // NOI18N
        txtStackSizeLimit.setName("txtStackSizeLimit"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        txtMaxSeed.setText(resourceMap.getString("txtMaxSeed.text")); // NOI18N
        txtMaxSeed.setName("txtMaxSeed"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap(114, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtMaxSeed, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)
                            .addComponent(txtStackSizeLimit, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)
                            .addComponent(txtWallClockTimeLimit, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtCPUTimeLimit, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(145, 145, 145)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtMemoryLimit, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCPUTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtMemoryLimit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtWallClockTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addGap(6, 6, 6)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtStackSizeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtMaxSeed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addGap(20, 20, 20))
        );

        btnGenerate.setText(resourceMap.getString("btnGenerate.text")); // NOI18N
        btnGenerate.setName("btnGenerate"); // NOI18N
        btnGenerate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGenerateActionPerformed(evt);
            }
        });

        btnCancel.setText(resourceMap.getString("btnCancel.text")); // NOI18N
        btnCancel.setName("btnCancel"); // NOI18N
        btnCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(450, Short.MAX_VALUE)
                .addComponent(btnCancel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnGenerate)
                .addContainerGap())
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnGenerate)
                    .addComponent(btnCancel))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
        cancelled = true;
        setVisible(false);
    }//GEN-LAST:event_btnCancelActionPerformed

    private void btnGenerateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGenerateActionPerformed
        try {
            boolean format_check = true;
            format_check &= Util.verifyNumber_geq(txtCPUTimeLimit, -1);
            format_check &= Util.verifyNumber_geq(txtMemoryLimit, -1);
            format_check &= Util.verifyNumber_geq(txtWallClockTimeLimit, -1);
            format_check &= Util.verifyNumber_geq(txtStackSizeLimit, -1);
            if (!format_check) {
                throw new NumberFormatException();
            }
            cpuTimeLimit = Integer.parseInt(txtCPUTimeLimit.getText());
            memoryLimit = Integer.parseInt(txtMemoryLimit.getText());
            wallClockTimeLimit = Integer.parseInt(txtWallClockTimeLimit.getText());
            stackSizeLimit = Integer.parseInt(txtStackSizeLimit.getText());
            maxSeed = Integer.parseInt(txtMaxSeed.getText());
            cancelled = false;
            this.setVisible(false);
        } catch (NumberFormatException ex) {
            javax.swing.JOptionPane.showMessageDialog(null, "Couldn't validate input. Please correct input and try again.", "Invalid data", javax.swing.JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_btnGenerateActionPerformed

    private void txtCPUTimeLimitFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtCPUTimeLimitFocusGained
        txtCPUTimeLimit.selectAll();
    }//GEN-LAST:event_txtCPUTimeLimitFocusGained
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCancel;
    private javax.swing.JButton btnGenerate;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextField txtCPUTimeLimit;
    private javax.swing.JTextField txtMaxSeed;
    private javax.swing.JTextField txtMemoryLimit;
    private javax.swing.JTextField txtStackSizeLimit;
    private javax.swing.JTextField txtWallClockTimeLimit;
    // End of variables declaration//GEN-END:variables

    public boolean isCancelled() {
        return cancelled;
    }

    public int getCpuTimeLimit() {
        return cpuTimeLimit;
    }

    public int getMemoryLimit() {
        return memoryLimit;
    }

    public int getStackSizeLimit() {
        return stackSizeLimit;
    }

    public int getWallClockTimeLimit() {
        return wallClockTimeLimit;
    }

    public int getMaxSeed() {
        return maxSeed;
    }
}


text:
#pragma once
#include <aws/iotdeviceadvisor/IoTDeviceAdvisor_EXPORTS.h>
#include <aws/iotdeviceadvisor/IoTDeviceAdvisorRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Http
{
    class URI;
} //namespace Http
namespace IoTDeviceAdvisor
{
namespace Model
{

  /**
   */
  class AWS_IOTDEVICEADVISOR_API ListSuiteDefinitionsRequest : public IoTDeviceAdvisorRequest
  {
  public:
    ListSuiteDefinitionsRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "ListSuiteDefinitions"; }

    Aws::String SerializePayload() const override;

    void AddQueryStringParameters(Aws::Http::URI& uri) const override;

    /**
     *
The maximum number of results to return at once.

     */
    inline int GetMaxResults() const{ return m_maxResults; }

    /**
     *
The maximum number of results to return at once.

     */
    inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }

    /**
     *
The maximum number of results to return at once.

     */
    inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }

    /**
     *
The maximum number of results to return at once.

     */
    inline ListSuiteDefinitionsRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}

    /**
     *
A token used to get the next set of results.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
A token used to get the next set of results.

     */
    inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }

    /**
     *
A token used to get the next set of results.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }

    /**
     *
A token used to get the next set of results.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }

    /**
     *
A token used to get the next set of results.

     */
    inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }

    /**
     *
A token used to get the next set of results.

     */
    inline ListSuiteDefinitionsRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
A token used to get the next set of results.

     */
    inline ListSuiteDefinitionsRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
A token used to get the next set of results.

     */
    inline ListSuiteDefinitionsRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}

  private:

    int m_maxResults;
    bool m_maxResultsHasBeenSet = false;

    Aws::String m_nextToken;
    bool m_nextTokenHasBeenSet = false;
  };

} // namespace Model
} // namespace IoTDeviceAdvisor
} // namespace Aws


text:
surnames = ['Rivest', 'Shamir', 'Adleman']
for position in range(len(surnames)):
    print(position, surnames[position])
    # print(surnames[position][0], end='')  # try swapping prints


text:
<?php

/**
 * The "applications" collection of methods.
 * Typical usage is:
 *  <code>
 *   $gamesManagementService = new Google_Service_GamesManagement(...);
 *   $applications = $gamesManagementService->applications;
 *  </code>
 */
class Google_Service_GamesManagement_Resource_Applications extends Google_Service_Resource
{
  /**
   * Get the list of players hidden from the given application. This method is
   * only available to user accounts for your developer console.
   * (applications.listHidden)
   *
   * @param string $applicationId The application ID from the Google Play
   * developer console.
   * @param array $optParams Optional parameters.
   *
   * @opt_param int maxResults The maximum number of player resources to return in
   * the response, used for paging. For any response, the actual number of player
   * resources returned may be less than the specified maxResults.
   * @opt_param string pageToken The token returned by the previous request.
   * @return Google_Service_GamesManagement_HiddenPlayerList
   */
  public function listHidden($applicationId, $optParams = array())
  {
    $params = array('applicationId' => $applicationId);
    $params = array_merge($params, $optParams);
    return $this->call('listHidden', array($params), "Google_Service_GamesManagement_HiddenPlayerList");
  }
}


text:
{% load widget_tweaks %}
{% if user.is_authenticated %}

          <form v-bind:action="url" method="post"> {% csrf_token %}

              @{{ request.user.username }} -> @[ username ]

                {% if form %}
                  {% render_field form.description type="textarea" class+="input input-is-large" placeholder="Fomatting is supported and please be nice :D" id="reply" %}
                {% endif %}

                <button class="button is-success" value="submit" name="submit">
                Make yer mark!
                </button>

          </form>

    <button class="modal-close"></button>

{% endif %}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WienerLinienApi.Samples.WPF_Proper.View
{
    /// <summary>
    /// Interaction logic for BusStopFavDialog.xaml
    /// </summary>
    public partial class TubeStopFavDialog : Window
    {
        public TubeStopFavDialog()
        {
            InitializeComponent();
        }
    }
}


text:
'use strict';

function Preload() {
  this.asset = null;
  this.ready = false;
}

Preload.prototype = {
  preload: function() {
    var centerX = this.game.width/2;
    var centerY = this.game.height/2;

    this.asset = this.add.sprite(centerX, centerY, 'preloader');
    this.asset.anchor.setTo(0.5, 0.5);

    this.load.onLoadComplete.addOnce(this.onLoadComplete, this);
    this.load.setPreloadSprite(this.asset);

    this.load.image('background', 'assets/background.png');
    this.load.image('ground', 'assets/ground.png');
    this.load.image('title', 'assets/title.png');
    this.load.image('startButton', 'assets/start-button.png');

    this.load.spritesheet('bird', 'assets/bird.png', 34, 24, 3);
    this.load.spritesheet('pipe', 'assets/pipes.png', 54, 320,2);

    this.load.image('instructions', 'assets/instructions.png');
    this.load.image('getReady', 'assets/get-ready.png');

    this.load.bitmapFont('flappyfont', 'assets/fonts/flappyfont/flappyfont.png', 'assets/fonts/flappyfont/flappyfont.fnt');

    this.load.audio('score', 'assets/score.wav');
    this.load.audio('flap', 'assets/flap.wav');
    this.load.audio('pipeHit', 'assets/pipe-hit.wav');
    this.load.audio('groundHit', 'assets/ground-hit.wav');

    this.load.image('scoreboard', 'assets/scoreboard.png');
    this.load.image('gameover', 'assets/gameover.png');
    this.load.spritesheet('medals', 'assets/medals.png', 44, 46, 2);
    this.load.image('particle', 'assets/particle.png');
  },
  create: function() {
    this.asset.cropEnabled = false;
  },
  update: function() {
    if(this.ready) {
      this.game.state.start('menu');
    }
  },
  onLoadComplete: function() {
    this.ready = true;
  }
};

module.exports = Preload;


text:
set -xe

NEUTRON_DIR="$BASE/new/neutron"
SCRIPTS_DIR="/usr/local/jenkins/slave_scripts"
venv=dsvm-functional

function generate_testr_results {
    # Give job user rights to access tox logs
    sudo -H -u stack chmod o+rw -R .
    if [ -f ".testrepository/0" ] ; then
        .tox/$venv/bin/subunit-1to2 < .testrepository/0 > ./testrepository.subunit
        .tox/$venv/bin/python $SCRIPTS_DIR/subunit2html.py ./testrepository.subunit testr_results.html
        gzip -9 ./testrepository.subunit
        gzip -9 ./testr_results.html
        sudo mv ./*.gz /opt/stack/logs/
    fi
}

# Run tests as the stack user to allow sudo+rootwrap.
sudo chown -R stack:stack $NEUTRON_DIR
cd $NEUTRON_DIR

echo "Running neutron functional test suite"
set +e
sudo -H -u stack tox -e $venv
testr_exit_code=$?
set -e

generate_testr_results
exit $testr_exit_code


text:
using DotVVM.Framework.ViewModel;
using System.Collections.Generic;

namespace DotvvmWeb.Views.Docs.Controls.bootstrap.Tooltip.sample6
{
    public class ViewModel : DotvvmViewModelBase
    {
        public List<Popover> Popovers { get; set; } = new List<Popover>
                {
                    new Popover()
                    {
                        Title = "Tooltip 1",
                        Content = "Content 1"
                    },
                    new Popover()
                    {
                        Title = "Tooltip 2",
                        Content = "Content 2"
                    }
                };

        public void DeleteItems()
        {
            Popovers.Clear();
        }
    }
    public class Popover
    {
        public string Title { get; set; }
        public string Content { get; set; }
    }
}


text:
using System;
using System.Runtime.InteropServices;
using GitHub.ViewModels.Documents;
using Microsoft.VisualStudio.Shell;

namespace GitHub.VisualStudio.UI
{
    /// <summary>
    /// A <see cref="ToolWindowPane"/> which displays an issue or pull request in a document window.
    /// </summary>
    [Guid(IssueishDocumentPaneGuid)]
    public class IssueishDocumentPane : AsyncPaneBase<IIssueishPaneViewModel>
    {
        /// <summary>
        /// The guid of the document pane.
        /// </summary>
        public const string IssueishDocumentPaneGuid = "9506846C-4CEC-4DDA-87E7-A99CDCD4E35B";
    }
}


text:
package hu.unideb.inf.reversi.service.interfaces;

import hu.unideb.inf.reversi.service.enums.ActualPlayer;
import javafx.scene.input.MouseEvent;

/**
 * Játék logikát szolgáltató interfész.
 */
public interface ReversiGameManager extends BoardGameManager {

	/**
	 * Visszadja az aktuális játékoshoz tartozó korongok számát.
	 * @param actualPlayer Az aktuális játékos.
	 * @return Az aktuális játékoshoz tartozó korongok száma.
	 */
	public Integer countPieces(ActualPlayer actualPlayer);

	/**
	 * Megszámolja, hogy hány olyan cella van, ahova letudja rakni az adott játékos a korongját.
	 * @param actualPlayer Az aktuális játékos.
	 * @return Azon cellák száma, ahova letudja rakni a saját korongját.
	 */
	public Integer countRemainingValidCells(ActualPlayer actualPlayer);

	/**
	 * Visszaadja az aktuális játékost.
	 * @return Aktuális játékos.
	 */
	public ActualPlayer getActualPlayer();

	/**
	 * Egérkattintásért felelős metódus.
	 * @param mouseEvent Egéresemény, ami a kattintás miatt fontos.
	 */
	public void mouseClicked(MouseEvent mouseEvent);

	/**
	 * Visszaadja a játék jelenlegi eredményét.
	 * @return A játék aktuális állása, eredménye.
	 */
	public String getStatus();

}