text:
package org.ppwcode.bean_VI;

import static org.ppwcode.metainfo_I.License.Type.APACHE_V2;
import static org.ppwcode.util.reflect_I.PropertyHelpers.hasProperty;

import org.ppwcode.exception_N.SemanticException;
import org.ppwcode.metainfo_I.Copyright;
import org.ppwcode.metainfo_I.License;
import org.ppwcode.metainfo_I.vcs.SvnInfo;
import org.toryt.annotations_I.Basic;
import org.toryt.annotations_I.Expression;
import org.toryt.annotations_I.Invars;
import org.toryt.annotations_I.MethodContract;

/**
 *
PropertyExceptions are exceptions that carry with them information
 *   about the property for which they occurred. They are usually thrown
 *   by a property setter during validation. If the property name is
 *   null, it means that the exception could not be
 *   attributed to a specific property of {@link #getOrigin()}.
 *   The origin should not be null,
 *   except when the exception is thrown during construction of an
 *   object, that could not be completed. In that case, the type
 *   should be filled out. Carrying the reference to the object would
 *   expose an incompletely initialized object, as the exception
 *   signals a failure to complete the initialization.

 *
Localized messages are sougth
 *   in a *.properties file for the class of the origin. The
 *   properties files should be in the directory next to the bean class, with
 *   name <var>{@link #getOrigin()}.getClass().getName()</var>
 *   <var>_locale_identification</var>.properties. Alternatively,
 *   messages can be added to a properties file that comes with the
 *   exception.

 *
The keys for the localized messages have to have the form
 *   <var>this.getClass().getName()</var>.
 *         <var>{@link #getPropertyName()}</var>.
 *         <var>{@link #getMessage()}</var>.
 *   See {@link #getLocalizedMessageKeys()}.

 *
 * @note Throwables cannot have generic parameters. Otherwise we would have used
 *       this instead of {@link #getOriginType()}.
 *
 * @author    Jan Dockx
 * @author    PeopleWare n.v.
 *
 * @idea (jand): Check that property name is truly a property of the origin
 * @mudo extends SemanticException extends InternalException
 * @mudo i18n
 */
@Copyright("2004 - $Date$, PeopleWare n.v.")
@License(APACHE_V2)
@SvnInfo(revision = "$Revision$",
         date     = "$Date$")
@Invars(
  @Expression("message == null || ! message.equals(EMPTY)")
)
public class PropertyException extends SemanticException {

  /*<construction>*/
  //-------------------------------------------------------------------------

  /**
   * @param     origin
   *            The bean that has thrown this exception.
   * @param     propertyName
   *            The name of the property of which the setter has thrown
   *            this exception because parameter validation failed.
   * @param     message
   *            The message that describes the exceptional circumstance.
   * @param     cause
   *            The exception that occurred, causing this exception to be
   *            thrown, if that is the case.
   */
  @MethodContract(
    pre  = {
      @Expression("_origin != null"),
      @Expression("_propertyName != null ? hasProperty(_origin.class, _propertyName)"),
      @Expression("_message == null || ! _message.equals(EMPTY)")
    },
    post = {
      @Expression("origin == _origin"),
      @Expression("originType == _origin.class"),
      @Expression("propertyName == _propertyName"),
      @Expression("message == _message"),
      @Expression("cause == _cause")
    }
  )
  public PropertyException(final Object origin,
                           final String propertyName,
                           final String message,
                           final Throwable cause) {
    super(message, cause);
    assert origin != null;
    assert ! (origin instanceof Class);
    assert (propertyName == null) || hasProperty(origin.getClass(), propertyName);
    assert (message == null) || (! message.equals(""));
    $origin = origin;
    $originType = origin.getClass();
    $propertyName = propertyName;
  }

  /**
   * @param     origin
   *            The bean that has thrown this exception.
   * @param     inOriginInitialization
   *            Set to true if this active
   *            property is created during the origin initialization;
   *            if so, an exception will not carry a reference
   *            to the bean, but only to the bean type.
   * @param     propertyName
   *            The name of the property of which the setter has thrown
   *            this exception because parameter validation failed.
   * @param     message
   *            The message that describes the exceptional circumstance.
   * @param     cause
   *            The exception that occurred, causing this exception to be
   *            thrown, if that is the case.
   *
   * @since IV 1.1.0/1.0
   */
  @MethodContract(
    pre  = {
      @Expression("_origin != null"),
      @Expression("_propertyName != null ? hasProperty(_origin.class, _propertyName)"),
      @Expression("_message == null || ! _message.equals(EMPTY)")
    },
    post = {
      @Expression("_inOriginInitialization ? origin == null : origin == _origin"),
      @Expression("originType == _origin.class"),
      @Expression("propertyName == _propertyName"),
      @Expression("message == _message"),
      @Expression("cause == _cause")
    }
  )
  public PropertyException(final Object origin,
                           final boolean inOriginInitialization,
                           final String propertyName,
                           final String message,
                           final Throwable cause) {
    super(message, cause);
    assert origin != null;
    assert (propertyName == null) || hasProperty(origin.getClass(), propertyName);
    assert (message == null) || (!message.equals(""));
    if (!inOriginInitialization) {
      $origin = origin;
    }
    $originType = origin.getClass();
    $propertyName = propertyName;
  }

  /**
   * @param     originType
   *            The bean that has thrown this exception.
   * @param     propertyName
   *            The name of the property of which the setter has thrown
   *            this exception because parameter validation failed.
   * @param     message
   *            The message that describes the exceptional circumstance.
   * @param     cause
   *            The exception that occurred, causing this exception to be
   *            thrown, if that is the case.
   *
   * @since IV
   */
  @MethodContract(
    pre  = {
      @Expression("_originType != null"),
      @Expression("_propertyName != null ? hasProperty(_originType, _propertyName)"),
      @Expression("_message == null || ! _message.equals(EMPTY)")
    },
    post = {
      @Expression("origin == null"),
      @Expression("originType == _originType"),
      @Expression("propertyName == _propertyName"),
      @Expression("message == _message"),
      @Expression("cause == _cause")
    }
  )
  public PropertyException(final Class<?> originType,
                           final String propertyName,
                           final String message,
                           final Throwable cause) {
    super(message, cause);
    assert originType != null;
    assert (propertyName == null) || hasProperty(originType, propertyName);
    assert (message == null) || (!message.equals(""));
    $originType = originType;
    $propertyName = propertyName;
  }

  /*</construction>*/

  /*<property name="origin">*/
  //------------------------------------------------------------------

  /**
   * The bean that has thrown this exception.
   */
  @Basic(
    invars = {
      @Expression("originType != null"),
      @Expression("origin != null ? originType == origin.class")
    }
  )
  public final Object getOrigin() {
    return $origin;
  }

  private Object $origin;

  /*</property>*/

  /*<property name="originType">*/
  //------------------------------------------------------------------

  /**
   * The type of the bean that has thrown this exception.
   */
  @Basic(
    invars = @Expression("originType != null")
  )
  public final Class<?> getOriginType() {
    return $originType;
  }

  private Class<?> $originType;

  /*</property>*/

  /*<property name="propertyName">*/
  //------------------------------------------------------------------

  /**
   * The name of the property for which this
   */
  @Basic(
    invars = @Expression("propertyName != null ? hasProperty(originType, propertyName)")
  )
  public final String getPropertyName() {
    return $propertyName;
  }

  private String $propertyName;

  /*</property>*/

  /*
*/
  //------------------------------------------------------------------

  /**
   * Compare {@code other} to this: is other of the the exact same
   * type and does other have the exact same properties.
   *
   * This method is an alternative to {@link #equals(Object)}, which
   * we cannot override, because we need to keep reference semantics
   * for exceptions.
   *
   * This method is introduced mainly for use in contracts of methods
   * that throw property exceptions, and in unit tests for those
   * methods.
   *
   * This method must be overridden in every subclass that adds a property
   * to include that property in the comparison.
   *
   * @note methods was formerly called {@code hasSameValues}, and now replaces
   *       {@code hasSameValues}, 2 {@code contains} methods and 2 {@code reportsOn}
   *       methods, which in practice did not fulfill their promise.
   *
   * @since VI
   */
  @MethodContract(
    post = @Expression("result ? (_other != null) && (_other.class = class) && " +
                       "(origin == _other.origin) && (originType == _other.originType) && " +
                       "(propertyName == _other.propertyName) && (message == _other.message) && " +
                       "(cause == _other.cause)")
  )
  public boolean like(PropertyException other) {
    return (other != null) && (other.getClass() == getClass()) &&
           (other.getOrigin() == getOrigin()) &&
           (other.getOriginType() == getOriginType()) &&
           eqn(other.getPropertyName(), getPropertyName()) &&
           eqn(other.getMessage(), getMessage()) &&
           (other.getCause() == getCause());
  }

  protected final boolean eqn(Object o1, Object o2) {
    return o1 == null ? o2 == null : o1.equals(o2);
  }

}


text:
package com.indoqa.daisy.adapter;

import org.outerj.daisy.publisher.BlobInfo;
import org.outerj.daisy.publisher.Publisher;
import org.outerj.daisy.repository.Document;
import org.outerj.daisy.repository.RepositoryException;
import org.outerj.daisy.repository.VariantKey;
import org.outerj.daisy.repository.query.QueryManager;
import org.outerj.daisy.repository.user.UserManager;
import org.outerx.daisy.x10Publisher.PublisherRequestDocument;
import org.xml.sax.ContentHandler;

public class DaisyRepositoryAccessFacade extends AbstractDaisyRepositoryAccessFacade {

    public Document getJDocument(final String id) {
        return this.getJDocument(id, "1", "1");
    }

    public Document getJDocument(final String id, final String branchId, final String languageId) {
        Document jDocument = null;
        for (int i = 0; i <= this.getNumOfRetries(); i++) {
            try {
                jDocument = this.getRepository().getDocument(id, branchId, languageId, true);
                break;
            } catch (Exception e) {
                if (i == this.getNumOfRetries()) {
                    throw new DaisyAccessException("Problems occurred while accessing the Daisy repository server.", e);
                }
            }
        }
        return jDocument;
    }

    public BlobInfo getPartAsBlob(String documentId, long branchId, long languageId, String version, String partType) {
        BlobInfo blobInfo = null;

        for (int i = 0; i <= this.getNumOfRetries(); i++) {
            Publisher publisher = (Publisher) this.getRepository().getExtension("Publisher");
            try {
                blobInfo = publisher.getBlobInfo(new VariantKey(documentId, branchId, languageId), version, partType);
                break;
            } catch (RepositoryException e) {
                if (i == this.getNumOfRetries()) {
                    throw new DaisyClientException("A problem occurred while using the publisher.", e);
                }
            }
        }
        return blobInfo;
    }

    public void getPublisherDocument(PublisherRequestDocument prDoc, ContentHandler handler) {
        for (int i = 0; i <= this.getNumOfRetries(); i++) {
            Publisher publisher = (Publisher) this.getRepository().getExtension("Publisher");
            try {
                publisher.processRequest(prDoc, handler);
                break;
            } catch (Exception e) {
                if (i == this.getNumOfRetries()) {
                    throw new DaisyClientException("A problem occurred while using the publisher.", e);
                }
            }
        }
    }

    public QueryManager getQueryManager() {
        return this.getRepository().getQueryManager();
    }

    public UserManager getUserManager() {
        return this.getRepository().getUserManager();
    }
}

redpajama_set_name: RedPajamaGithub


text:
Admin::OrdersController.class_eval do
  respond_to :html
  def index
    params[:search] ||= {}
    params[:search][:completed_at_is_not_null] ||= '1' if Spree::Config[:show_only_complete_orders_by_default]
    @show_only_completed = params[:search][:completed_at_is_not_null].present?
    params[:search][:meta_sort] ||= @show_only_completed ? 'completed_at.desc' : 'created_at.desc'
    @search = Order.metasearch(params[:search])
    if !params[:search][:created_at_greater_than].blank?
      params[:search][:created_at_greater_than] = Time.zone.parse(params[:search][:created_at_greater_than]).beginning_of_day rescue ""
    end
    if !params[:search][:created_at_less_than].blank?
      params[:search][:created_at_less_than] = Time.zone.parse(params[:search][:created_at_less_than]).end_of_day rescue ""
    end
    if @show_only_completed
      params[:search][:completed_at_greater_than] = params[:search].delete(:created_at_greater_than)
      params[:search][:completed_at_less_than] = params[:search].delete(:created_at_less_than)
    end
    @orders = Order.metasearch(params[:search])
				@orders = refine_list(@orders).paginate(
                     :include  => [:user, :shipments, :payments],
                     :per_page => Spree::Config[:orders_per_page],
                     :page     => params[:page])
    respond_with(@orders)
  end

 def refine_list(orders)
    orders_arr = StoreownerOrder.find(:all,:conditions=>["store_owner_id = ?",current_user.store_owner.id]).map(&:order_id)
    order_collection=orders.where("id in (?)",orders_arr)
    return order_collection
 end
end


text:
package de.ehex.foss.gematik.specifications;

import static java.util.Objects.nonNull;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.j8unit.J8UnitTest;
import org.junit.Test;

import de.ehex.foss.rfcs.rfc2119.RequirementLevel;

public abstract interface AFOTypeTests<SUT extends AFOType> extends /* EnumTests<SUT> */ J8UnitTest<SUT> {

    @Test
    public default void testDeclarationAsEnumConstant() throws Exception {
        final SUT sut = createNewSUT();
        assert nonNull(sut);
        assertTrue(sut.getDeclaringClass().isEnum());
    }

    @Test
    public default void testValidRequirementLevel() throws Exception {
        final SUT sut = createNewSUT();
        assert nonNull(sut);
        assertNotNull(sut.getLevel());
    }

    @Test
    public default void testNonAliasingRequirementLevel() throws Exception {
        final SUT sut = createNewSUT();
        assert nonNull(sut);
        final RequirementLevel level = sut.getLevel();
        assert nonNull(level);
        assertFalse(level.isAlias());
    }

}


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.yunpeng.alipay">

</manifest>


text:
local TextLine = require 'ui.TextLine'
local VList = require 'ui.VList'

local Expander = VList:subclass {
  expanded = false;
  size = { inf, 0 };
}

function Expander:__init(data)
  if #data > 0 then
    assert(not data.content, "An Expander can't have both .content and array parts")
    data.content = ui.VList {}
    for i,v in ipairs(data) do
      data.content:attach(v)
      data[i] = nil
    end
  end
  VList.__init(self, data)
  if not self.content then
    assert(#self > 0, "Expander created without content")
  end
  self._header = TextLine { text = self.text; can_focus = true; }
  function self._header.cmd_activate()
    self:expand(not self.expanded)
    ui.layout()
    return true
  end
  self.content.margins = { up = 0; dn = 0; lf = 1; rt = 0 };
  self:attach(self._header)
  self:attach(self.content)
  self:expand(self.expanded)
end

-- To update all our bits to take the current expansion state into account.
function Expander:expand(expanded)
  self.expanded = expanded
  self._header.text = (expanded and "[-] " or "[+] ")..self.text
  self.content.visible = expanded
end

return Expander


text:
cask 'vmware-fusion' do
  version '10.0.0-6665085'
  sha256 'acd6bab4cb7a63319db8eb2f95da8738b394790d72fd44d4a6a7bd9895e023bb'

  url "https://download3.vmware.com/software/fusion/file/VMware-Fusion-#{version}.dmg"
  appcast 'https://softwareupdate.vmware.com/cds/vmw-desktop/fusion.xml',
          checkpoint: 'ad9fd8c30e14e34d54f0878a3926773ca8e6ba5ff21eb25f124ca79f82a087e3'
  name 'VMware Fusion'
  homepage 'https://www.vmware.com/products/fusion.html'

  auto_updates true

  app 'VMware Fusion.app'
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmnet-bridge"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmnet-cfgcli"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmnet-cli"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmnet-dhcpd"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmnet-natd"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmnet-netifup"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmnet-sniffer"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmrun"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmss2core"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-aewp"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-authd"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-cloneBootCamp"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-id"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-ntfs"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-rawdiskAuthTool"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-rawdiskCreator"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-remotemks"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-usbarbitrator"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-vdiskmanager"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-vmdkserver"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-vmx"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-vmx-debug"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/vmware-vmx-stats"
  binary "#{appdir}/VMware Fusion.app/Contents/Library/VMware OVF Tool/ovftool"

  postflight do
    system_command "#{appdir}/VMware Fusion.app/Contents/Library/Initialize VMware Fusion.tool",
                   args: ['set'],
                   sudo: true
  end

  uninstall_preflight do
    set_ownership "#{appdir}/VMware Fusion.app"
  end

  zap delete: [
                '/Library/Logs/VMware Fusion Services.log',
                '/Library/Logs/VMware USB Arbitrator Service.log',
                '/Library/Logs/VMware',
                '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.vmware.fusion.sfl',
                '~/Library/Caches/com.vmware.fusion',
                '~/Library/Logs/VMware Fusion',
                '~/Library/Logs/VMware Graphics Service.log',
                '~/Library/Logs/VMware',
                '~/Library/Preferences/com.vmware.fusion.LSSharedFileList.plist',
                '~/Library/Preferences/com.vmware.fusion.LSSharedFileList.plist.lockfile',
                '~/Library/Saved Application State/com.vmware.fusion.savedState',
                '~/Library/WebKit/com.vmware.fusion',
              ],
      trash:  [
                '/Library/Application Support/VMware',
                '/Library/Preferences/VMware Fusion',
                '~/Library/Application Support/VMware Fusion',
                '~/Library/Preferences/VMware Fusion',
                '~/Library/Preferences/com.vmware.fusion.plist',
                '~/Library/Preferences/com.vmware.fusion.plist.lockfile',
                '~/Library/Preferences/com.vmware.fusionDaemon.plist',
                '~/Library/Preferences/com.vmware.fusionDaemon.plist.lockfile',
                '~/Library/Preferences/com.vmware.fusionStartMenu.plist',
                '~/Library/Preferences/com.vmware.fusionStartMenu.plist.lockfile',
              ]
end


text:
import time
import math
import multiprocessing
import os
import random
import sys
import signal
from subprocess import Popen, PIPE

try:
    import psutil
except ImportError:
    psutil = None

try:
    from setproctitle import getproctitle, setproctitle
except ImportError:
    setproctitle = None

from diamond.utils.signals import signal_to_exception
from diamond.utils.signals import SIGALRMException
from diamond.utils.signals import SIGHUPException

def get_children(parent_pid):
    if psutil:
        parent = psutil.Process(int(parent_pid))
        return [child.pid for child in parent.get_children()]
    else:
        children = []
        process = Popen(['ps', '-eo', 'pid,ppid'], stdout=PIPE, stderr=PIPE)
        output, errors = process.communicate()
        if errors:
            log.error("Could not get processlist with child procs: {0!s}".format(errors))
            return children
        for line in output.splitlines():
            pid, ppid = line.split(' ', 1)
            if ppid == parent_pid:
                children.append(pid)
        return children

def collector_process(collector, log):
    """
    """
    proc = multiprocessing.current_process()
    pid = str(proc.pid)
    if setproctitle:
        setproctitle('%s - %s' % (getproctitle(), proc.name))

    signal.signal(signal.SIGALRM, signal_to_exception)
    signal.signal(signal.SIGHUP, signal_to_exception)
    signal.signal(signal.SIGUSR2, signal_to_exception)

    interval = float(collector.config['interval'])

    log.debug('Starting')
    log.debug('Interval: %s seconds', interval)

    # Validate the interval
    if interval <= 0:
        log.critical('interval of %s is not valid!', interval)
        sys.exit(1)

    # Start the next execution at the next window plus some stagger delay to
    # avoid having all collectors running at the same time
    next_window = math.floor(time.time() / interval) * interval
    stagger_offset = random.uniform(0, interval - 1)

    # Allocate time till the end of the window for the collector to run. With a
    # minimum of 1 second
    max_time = int(max(interval - stagger_offset, 1))
    log.debug('Max collection time: %s seconds', max_time)

    # Setup stderr/stdout as /dev/null so random print statements in thrid
    # party libs do not fail and prevent collectors from running.
    # https://github.com/BrightcoveOS/Diamond/issues/722
    sys.stdout = open(os.devnull, 'w')
    sys.stderr = open(os.devnull, 'w')

    while(True):
        try:
            time_to_sleep = (next_window + stagger_offset) - time.time()
            if time_to_sleep > 0:
                time.sleep(time_to_sleep)

            next_window += interval

            # Ensure collector run times fit into the collection window
            signal.alarm(max_time)

            # Collect!
            collector._run()

            # Success! Disable the alarm
            signal.alarm(0)

        except SIGALRMException:

            # Adjust  the stagger_offset to allow for more time to run the
            # collector
            stagger_offset = stagger_offset * 0.9

            max_time = int(max(interval - stagger_offset, 1))
            log.debug('Max collection time: %s seconds', max_time)
            collector.dimensions = {
                'interval': interval,
            }
            collector.publish('fullerite.collection_time_exceeded', 1)
            try:
                collector.log.warn("Took too long to run, Killed!")
                children = get_children(pid)
                for child in children:
                    os.kill(int(child), signal.SIGKILL)
            except OSError as e:
                log.debug('Process died on its own!')
            except Exception as e:
                collector.log.warn("Killing children failed")

        except SIGHUPException:
            # Reload the config if requested
            # We must first disable the alarm as we don't want it to interrupt
            # us and end up with half a loaded config
            signal.alarm(0)

            log.info('Reloading config reload due to HUP')
            collector.load_config()
            log.info('Config reloaded')

        except Exception:
            log.exception('Collector failed!')
            break


text:
//
//  DMFeedbackController.h
//  DevMateFeedback
//
//  Copyright (c) 2014-2016 DevMate Inc. All rights reserved.
//

#import <DevMateKit/DMFeedbackReportWindowController.h>
#import <DevMateKit/DMRatingView.h>

//! Different modes for showing feedback window.
typedef NS_ENUM(NSInteger, DMFeedbackMode)
{
    DMFeedbackIndependentMode = 0,
    DMFeedbackChildMode,
    DMFeedbackModalMode,
    DMFeedbackSheetMode,
    DMFeedbackFloatingMode,

    DMFeedbackDefaultMode = DMFeedbackIndependentMode
};

//! Items tags for feedbackTypeButton control
typedef NS_ENUM(NSInteger, DMFeedbackTypeTag)
{
    DMFeedbackTypeFeedback = 0,
    DMFeedbackTypeSupportRequest,
    DMFeedbackTypeBugReport
};

@protocol DMFeedbackControllerDelegate;

@interface DMFeedbackController : DMFeedbackReportWindowController

/*! @brief Method for getting shared controller instance.
    @return Shared controller instance.
 */
+ (instancetype)sharedController;

@property (nonatomic, assign) id<DMFeedbackControllerDelegate> delegate;
@property (nonatomic, retain) NSDictionary *defaultUserInfo;

//! Array of NSURL instances. Set it in case you have custom log files. By default log is obtained from ASL (default NSLog behaviour) for non-sandboxed apps.
@property (nonatomic, retain) NSArray *logURLs;

//! Property to get/change feedback type
@property (nonatomic, assign) DMFeedbackTypeTag currentFeedbackType;

// IBOutlets & IBActions
@property (nonatomic, assign) IBOutlet NSImageView *appIcon;
@property (nonatomic, assign) IBOutlet NSTextField *titleField;
@property (nonatomic, assign) IBOutlet NSTextField *messageField;

@property (nonatomic, assign) IBOutlet NSTextField *userNameField;
@property (nonatomic, assign) IBOutlet NSTextField *userEmailField;

@property (nonatomic, assign) IBOutlet NSPopUpButton *feedbackTypeButton;

@property (nonatomic, assign) IBOutlet NSTextView *commentView;
@property (nonatomic, assign) IBOutlet NSButton *attachmentButton;

@property (nonatomic, assign) IBOutlet NSButton *sendAnonymousButton;
@property (nonatomic, assign) IBOutlet NSTextField *sendAnonymousExplanationField;
@property (nonatomic, assign) IBOutlet NSButton *sysInfoButton;

@property (nonatomic, assign) IBOutlet NSTextField *ratingTextField;
@property (nonatomic, assign) IBOutlet DMRatingView *ratingView;

@property (nonatomic, assign) IBOutlet NSBox *separatorLine;

@property (nonatomic, assign) IBOutlet NSButton *sendButton;
@property (nonatomic, assign) IBOutlet NSProgressIndicator *progressIndicator;

- (IBAction)changeFeedbackType:(id)sender;
- (IBAction)showSysInfo:(id)sender;
- (IBAction)attachFile:(id)sender;
- (IBAction)sendReport:(id)sender;
// -------------------------------

//! User comment that will be sent. Can be overriden by subclasses.
- (NSString *)userComment;

//! User attached file URLs that will be sent. Can be overriden by subclasses.
- (NSArray *)userAttachmentURLs;

/*! @brief Shows feedback window.
    @discussion In case when you use \p DMFeedbackDefaultMode mode and \p nil handler,
                you can use standard \p -showWindow: method instead.
    @param mode     Feedback mode.
    @param handler  Completion handler.
 */
- (void)showFeedbackWindowInMode:(DMFeedbackMode)mode completionHandler:(void (^)(BOOL success))handler;

@end

@protocol DMFeedbackControllerDelegate <NSObject>
@optional

/*! @brief Returns parent window for feedback window.
    @discussion Delegate should implement this method in case when using \p DMFeedbackChildMode or
                \p DMFeedbackSheetMode feedback modes. For other modes dialog will be just centered
                in parent window.
    @param controller   Feedback controller.
    @param mode         Feedback mode.
    @return Parent window for feedback window.
 */
- (NSWindow *)feedbackController:(DMFeedbackController *)controller parentWindowForFeedbackMode:(DMFeedbackMode)mode;

@end

//! Keys for defaultUserInfo dictionary
FOUNDATION_EXPORT NSString *const DMFeedbackDefaultUserNameKey; // NSString object
FOUNDATION_EXPORT NSString *const DMFeedbackDefaultUserEmailKey; // NSString object
FOUNDATION_EXPORT NSString *const DMFeedbackDefaultCommentKey; // NSString object


text:
StartTest(function (t) {

    document.body.innerHTML = '
FOO
'

    t.it('Should fire touchstart, touchend on tap simulation', function(t) {
        t.willFireNTimes(Ext.get('div'), 'touchstart', 1);
        t.willFireNTimes(Ext.get('div'), 'touchend', 1);

        t.chain(
            {
                action : 'tap',
                target : '#div'
            }
        );
    })

    t.it('Should fire 1 touchstart, multiple touchmove and 1 touchend on drag simulation', function(t) {
        t.willFireNTimes(Ext.get('div'), 'touchstart', 1);
        t.willFireNTimes(Ext.get('div'), 'touchmove', 5, 'Should see at least 5 touchmove events', true);
        t.willFireNTimes(Ext.get('div'), 'touchend', 1);

        t.chain(
            {
                action : 'touchDrag',
                target : '#div',
                by     : [ 200, 100 ]
            }
        );
    })
});


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/spanner/admin/database/v1/spanner_database_admin.proto

package com.google.spanner.admin.database.v1;

public interface ListDatabasesResponseOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.ListDatabasesResponse)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Databases that matched the request.
   *

   *
   * repeated .google.spanner.admin.database.v1.Database databases = 1;
   */
  java.util.List<com.google.spanner.admin.database.v1.Database> getDatabasesList();
  /**
   *
   *
   *

   * Databases that matched the request.
   *

   *
   * repeated .google.spanner.admin.database.v1.Database databases = 1;
   */
  com.google.spanner.admin.database.v1.Database getDatabases(int index);
  /**
   *
   *
   *

   * Databases that matched the request.
   *

   *
   * repeated .google.spanner.admin.database.v1.Database databases = 1;
   */
  int getDatabasesCount();
  /**
   *
   *
   *

   * Databases that matched the request.
   *

   *
   * repeated .google.spanner.admin.database.v1.Database databases = 1;
   */
  java.util.List<? extends com.google.spanner.admin.database.v1.DatabaseOrBuilder>
      getDatabasesOrBuilderList();
  /**
   *
   *
   *

   * Databases that matched the request.
   *

   *
   * repeated .google.spanner.admin.database.v1.Database databases = 1;
   */
  com.google.spanner.admin.database.v1.DatabaseOrBuilder getDatabasesOrBuilder(int index);

  /**
   *
   *
   *

   * `next_page_token` can be sent in a subsequent
   * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more
   * of the matching databases.
   *

   *
   * string next_page_token = 2;
   *
   * @return The nextPageToken.
   */
  java.lang.String getNextPageToken();
  /**
   *
   *
   *

   * `next_page_token` can be sent in a subsequent
   * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more
   * of the matching databases.
   *

   *
   * string next_page_token = 2;
   *
   * @return The bytes for nextPageToken.
   */
  com.google.protobuf.ByteString getNextPageTokenBytes();
}


text:
"""
@package ion.services.mi.test.test_zmq_driver_process
@file ion/services/mi/test_zmq_driver_process.py
@author Edward Hunter
@brief Test cases for ZmqDriverProcess processes.
"""

__author__ = 'Edward Hunter'
__license__ = 'Apache 2.0'

import logging

from nose.plugins.attrib import attr

from mi.core.unit_test import MiTestCase

mi_logger = logging.getLogger('mi_logger')

@attr('UNIT', group='mi')
class TestZmqDriverProcess(MiTestCase):
    """
    Unit tests for ZMQ driver process.
    """

    def setUp(self):
        """
        Setup test cases.
        """
        # Zmq parameters used by driver process and client.
        self.host = 'localhost'
        self.cmd_port = 5556
        self.evt_port = 5557

        # Driver module parameters.
        self.dvr_mod = 'ion.services.mi.drivers.sbe37.sbe37_driver'
        self.dvr_cls = 'SBE37Driver'

        # Add cleanup handler functions.
        # self.addCleanup()

    def test_driver_process(self):
        """
        Test driver process launch and comms.
        """

        """
        driver_process = ZmqDriverProcess.launch_process(5556, 5557,
                        'ion.services.mi.drivers.sbe37.sbe37_driver', 'SBE37Driver')
        driver_client = ZmqDriverClient('localhost', 5556, 5557)
        driver_client.start_messaging()
        time.sleep(3)

        reply = driver_client.cmd_dvr('process_echo', data='test 1 2 3')
        self.assertIsInstance(reply, dict)
        self.assertTrue('cmd' in reply)
        self.assertTrue('args' in reply)
        self.assertTrue('kwargs' in reply)
        self.assertTrue(reply['cmd'] == 'process_echo')
        self.assertTrue(reply['args'] == ())
        self.assertIsInstance(reply['kwargs'], dict)
        self.assertTrue('data' in reply['kwargs'])
        self.assertTrue(reply['kwargs']['data'], 'test 1 2 3')

        reply = driver_client.cmd_dvr('process_echo',
                                      data='zoom zoom boom boom')
        self.assertIsInstance(reply, dict)
        self.assertTrue('cmd' in reply)
        self.assertTrue('args' in reply)
        self.assertTrue('kwargs' in reply)
        self.assertTrue(reply['cmd'] == 'process_echo')
        self.assertTrue(reply['args'] == ())
        self.assertIsInstance(reply['kwargs'], dict)
        self.assertTrue('data' in reply['kwargs'])
        self.assertTrue(reply['kwargs']['data'], 'test 1 2 3')

        events = ['I am event number 1!', 'And I am event number 2!']
        reply = driver_client.cmd_dvr('test_events', events=events)
        self.assertEqual(reply, 'test_events')
        time.sleep(3)
        self.assertTrue(driver_client.events, events)
        driver_client.done()
        """
        pass

    def test_number_2(self):
        """
        """

        pass


text:
package org.apache.arrow;

import static org.apache.arrow.vector.types.FloatingPointPrecision.DOUBLE;
import static org.apache.arrow.vector.types.FloatingPointPrecision.SINGLE;

import java.io.EOFException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.arrow.consumers.AvroBooleanConsumer;
import org.apache.arrow.consumers.AvroBytesConsumer;
import org.apache.arrow.consumers.AvroDoubleConsumer;
import org.apache.arrow.consumers.AvroFloatConsumer;
import org.apache.arrow.consumers.AvroIntConsumer;
import org.apache.arrow.consumers.AvroLongConsumer;
import org.apache.arrow.consumers.AvroStringConsumer;
import org.apache.arrow.consumers.Consumer;
import org.apache.arrow.consumers.NullableTypeConsumer;
import org.apache.arrow.util.Preconditions;
import org.apache.arrow.vector.BaseFixedWidthVector;
import org.apache.arrow.vector.BigIntVector;
import org.apache.arrow.vector.BitVector;
import org.apache.arrow.vector.FieldVector;
import org.apache.arrow.vector.Float4Vector;
import org.apache.arrow.vector.Float8Vector;
import org.apache.arrow.vector.IntVector;
import org.apache.arrow.vector.ValueVector;
import org.apache.arrow.vector.VarBinaryVector;
import org.apache.arrow.vector.VarCharVector;
import org.apache.arrow.vector.VectorSchemaRoot;
import org.apache.arrow.vector.types.pojo.ArrowType;
import org.apache.arrow.vector.types.pojo.Field;
import org.apache.arrow.vector.types.pojo.FieldType;
import org.apache.avro.Schema;
import org.apache.avro.Schema.Type;
import org.apache.avro.io.Decoder;

/**
 * Class that does most of the work to convert Avro data into Arrow columnar format Vector objects.
 */
public class AvroToArrowUtils {

  private static final int DEFAULT_BUFFER_SIZE = 256;
  public static final String NULL_INDEX = "nullIndex";

  /**
   * Creates a {@link Field} from the {@link Schema}
   *

This method currently performs following type mapping for Avro data types to corresponding Arrow data types.
   *
   *

   *
STRING --> ArrowType.Utf8

   *
INT --> ArrowType.Int(32, signed)

   *
LONG --> ArrowType.Int(64, signed)

   *
FLOAT --> ArrowType.FloatingPoint(FloatingPointPrecision.SINGLE)

   *
DOUBLE --> ArrowType.FloatingPoint(FloatingPointPrecision.DOUBLE)

   *
BOOLEAN --> ArrowType.Bool

   *
BYTES --> ArrowType.Binary

   *

   */
  private static Field getArrowField(Schema schema, String name, boolean nullable) {

    Preconditions.checkNotNull(schema, "Avro schema object can't be null");

    Type type = schema.getType();
    ArrowType arrowType;

    switch (type) {
      case UNION:
        return getUnionField(schema, name);
      case STRING:
        arrowType = new ArrowType.Utf8();
        break;
      case INT:
        arrowType = new ArrowType.Int(32, /*signed=*/true);
        break;
      case BOOLEAN:
        arrowType = new ArrowType.Bool();
        break;
      case LONG:
        arrowType = new ArrowType.Int(64, /*signed=*/true);
        break;
      case FLOAT:
        arrowType =  new ArrowType.FloatingPoint(SINGLE);
        break;
      case DOUBLE:
        arrowType = new ArrowType.FloatingPoint(DOUBLE);
        break;
      case BYTES:
        arrowType = new ArrowType.Binary();
        break;
      default:
        // no-op, shouldn't get here
        throw new RuntimeException("Can't convert avro type %s to arrow type." + type.getName());
    }

    final FieldType fieldType =  new FieldType(nullable, arrowType, /*dictionary=*/null,
        getMetaData(schema));
    return new Field(name, fieldType, null);
  }

  private static Field getUnionField(Schema schema, String name) {
    int size = schema.getTypes().size();
    long nullCount = schema.getTypes().stream().filter(s -> s.getType() == Type.NULL).count();

    // avro schema not allow repeated type, so size == nullCount + 1 indicates nullable type.
    if (size == nullCount + 1) {

      Schema nullSchema = schema.getTypes().stream().filter(s -> s.getType() == Type.NULL).findFirst().get();
      String nullIndex = String.valueOf(schema.getTypes().indexOf(nullSchema));

      // if has two field and one is null type, convert to nullable primitive type
      if (size == 2) {
        Schema subSchema = schema.getTypes().stream().filter(s -> s.getType() != Type.NULL).findFirst().get();
        Preconditions.checkNotNull(subSchema);
        subSchema.addProp(NULL_INDEX, nullIndex);
        return getArrowField(subSchema, name,true);
      } else {
        //TODO convert avro unions type to arrow UnionVector
        throw new UnsupportedOperationException();
      }
    } else {
      throw new UnsupportedOperationException();
    }
  }

  private static Map<String, String> getMetaData(Schema schema) {
    Map<String, String> metadata = new HashMap<>();
    schema.getObjectProps().forEach((k,v) -> metadata.put(k, v.toString()));
    return metadata;
  }

  /**
   * Create Arrow {@link org.apache.arrow.vector.types.pojo.Schema} object for the given Avro {@link Schema}.
   */
  public static org.apache.arrow.vector.types.pojo.Schema avroToArrowSchema(Schema schema) {

    Preconditions.checkNotNull(schema, "Avro Schema object can't be null");
    List<Field> arrowFields = new ArrayList<>();

    Schema.Type type = schema.getType();
    final Map<String, String> metadata = getMetaData(schema);

    if (type == Type.RECORD) {
      for (Schema.Field field : schema.getFields()) {
        arrowFields.add(getArrowField(field.schema(), field.name(),false));
      }
    } else if (type == Type.MAP) {
      throw new UnsupportedOperationException();
    } else if (type == Type.ARRAY) {
      throw new UnsupportedOperationException();
    } else if (type == Type.ENUM) {
      throw new UnsupportedOperationException();
    } else {
      arrowFields.add(getArrowField(schema, "", false));
    }

    return new org.apache.arrow.vector.types.pojo.Schema(arrowFields, /*metadata=*/ metadata);
  }

  /**
   * Create primitive consumer to read data from decoder, will reduce boxing/unboxing operations.
   */
  public static Consumer createPrimitiveConsumer(ValueVector vector) {

    Consumer consumer;
    switch (vector.getMinorType()) {
      case INT:
        consumer = new AvroIntConsumer((IntVector) vector);
        break;
      case VARBINARY:
        consumer = new AvroBytesConsumer((VarBinaryVector) vector);
        break;
      case VARCHAR:
        consumer = new AvroStringConsumer((VarCharVector) vector);
        break;
      case BIGINT:
        consumer = new AvroLongConsumer((BigIntVector) vector);
        break;
      case FLOAT4:
        consumer = new AvroFloatConsumer((Float4Vector) vector);
        break;
      case FLOAT8:
        consumer = new AvroDoubleConsumer((Float8Vector) vector);
        break;
      case BIT:
        consumer = new AvroBooleanConsumer((BitVector) vector);
        break;
      default:
        throw new RuntimeException("could not get consumer from type:" + vector.getMinorType());
    }

    if (vector.getField().isNullable()) {
      int nullIndex = getNullFieldIndex(vector.getField());
      return new NullableTypeConsumer(consumer, nullIndex);
    }

    return consumer;
  }

  /**
   * Get avro null field index from vector field metadata.
   */
  private static int getNullFieldIndex(Field field) {
    Map<String, String> metadata = field.getMetadata();
    Preconditions.checkNotNull(metadata, "metadata should not be null when vector is nullable");
    String index = metadata.get(AvroToArrowUtils.NULL_INDEX);
    Preconditions.checkNotNull(index, "nullIndex should not be null when vector is nullable");
    return Integer.parseInt(index);
  }

  /**
   * Iterate the given Avro {@link Decoder} object to fetch the data and transpose it to populate
   * the given Arrow Vector objects.
   * @param decoder avro decoder to read data.
   * @param root Arrow {@link VectorSchemaRoot} object to populate
   */
  public static void avroToArrowVectors(Decoder decoder, VectorSchemaRoot root) throws IOException {

    Preconditions.checkNotNull(decoder, "Avro decoder object can't be null");
    Preconditions.checkNotNull(root, "VectorSchemaRoot object can't be null");

    allocateVectors(root, DEFAULT_BUFFER_SIZE);

    // create consumers
    Consumer[] consumers = new Consumer[root.getFieldVectors().size()];
    for (int i = 0; i < root.getFieldVectors().size(); i++) {
      FieldVector vector = root.getFieldVectors().get(i);
      consumers[i] = createPrimitiveConsumer(vector);
    }

    int valueCount = 0;
    while (true) {
      try {
        for (Consumer consumer : consumers) {
          consumer.consume(decoder);
        }
        valueCount++;
        //reach end will throw EOFException.
      } catch (EOFException eofException) {
        root.setRowCount(valueCount);
        break;
      }
    }
  }

  private static void allocateVectors(VectorSchemaRoot root, int size) {
    List<FieldVector> vectors = root.getFieldVectors();
    for (FieldVector fieldVector : vectors) {
      if (fieldVector instanceof BaseFixedWidthVector) {
        ((BaseFixedWidthVector) fieldVector).allocateNew(size);
      } else {
        fieldVector.allocateNew();
      }
      fieldVector.setInitialCapacity(size);
    }
  }
}