text:
/*
 * Modernizr tests which native CSS3 and HTML5 features are available in the
 * current UA and makes the results available to you in two ways: as properties on
 * a global `Modernizr` object, and as classes on the `<html>` element. This
 * information allows you to progressively enhance your pages with a granular level
 * of control over the experience.
*/

;(function(window, document, undefined){
  var classes = [];

  var tests = [];

  /**
   *
   * ModernizrProto is the constructor for Modernizr
   *
   * @class
   * @access public
   */

  var ModernizrProto = {
    // The current version, dummy
    _version: '3.3.1',

    // Any settings that don't work as separate modules
    // can go in here as configuration.
    _config: {
      'classPrefix': '',
      'enableClasses': true,
      'enableJSClass': true,
      'usePrefixes': true
    },

    // Queue of tests
    _q: [],

    // Stub these for people who are listening
    on: function(test, cb) {
      // I don't really think people should do this, but we can
      // safe guard it a bit.
      // -- NOTE:: this gets WAY overridden in src/addTest for actual async tests.
      // This is in case people listen to synchronous tests. I would leave it out,
      // but the code to *disallow* sync tests in the real version of this
      // function is actually larger than this.
      var self = this;
      setTimeout(function() {
        cb(self[test]);
      }, 0);
    },

    addTest: function(name, fn, options) {
      tests.push({name: name, fn: fn, options: options});
    },

    addAsyncTest: function(fn) {
      tests.push({name: null, fn: fn});
    }
  };

  // Fake some of Object.create so we can force non test results to be non "own" properties.
  var Modernizr = function() {};
  Modernizr.prototype = ModernizrProto;

  // Leak modernizr globally when you `require` it rather than force it here.
  // Overwrite name so constructor name is nicer :D
  Modernizr = new Modernizr();

  /**
   * is returns a boolean if the typeof an obj is exactly type.
   *
   * @access private
   * @function is
   * @param {*} obj - A thing we want to check the type of
   * @param {string} type - A string to compare the typeof against
   * @returns {boolean}
   */

  function is(obj, type) {
    return typeof obj === type;
  }
  ;

  /**
   * Run through all tests and detect their support in the current UA.
   *
   * @access private
   */

  function testRunner() {
    var featureNames;
    var feature;
    var aliasIdx;
    var result;
    var nameIdx;
    var featureName;
    var featureNameSplit;

    for (var featureIdx in tests) {
      if (tests.hasOwnProperty(featureIdx)) {
        featureNames = [];
        feature = tests[featureIdx];
        // run the test, throw the return value into the Modernizr,
        // then based on that boolean, define an appropriate className
        // and push it into an array of classes we'll join later.
        //
        // If there is no name, it's an 'async' test that is run,
        // but not directly added to the object. That should
        // be done with a post-run addTest call.
        if (feature.name) {
          featureNames.push(feature.name.toLowerCase());

          if (feature.options && feature.options.aliases && feature.options.aliases.length) {
            // Add all the aliases into the names list
            for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {
              featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());
            }
          }
        }

        // Run the test, or use the raw value if it's not a function
        result = is(feature.fn, 'function') ? feature.fn() : feature.fn;

        // Set each of the names on the Modernizr object
        for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {
          featureName = featureNames[nameIdx];
          // Support dot properties as sub tests. We don't do checking to make sure
          // that the implied parent tests have been added. You must call them in
          // order (either in the test, or make the parent test a dependency).
          //
          // Cap it to TWO to make the logic simple and because who needs that kind of subtesting
          // hashtag famous last words
          featureNameSplit = featureName.split('.');

          if (featureNameSplit.length === 1) {
            Modernizr[featureNameSplit[0]] = result;
          } else {
            // cast to a Boolean, if not one already
            /* jshint -W053 */
            if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {
              Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);
            }

            Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;
          }

          classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));
        }
      }
    }
  }
  ;

  /**
   * docElement is a convenience wrapper to grab the root element of the document
   *
   * @access private
   * @returns {HTMLElement|SVGElement} The root element of the document
   */

  var docElement = document.documentElement;

  /**
   * A convenience helper to check if the document we are running in is an SVG document
   *
   * @access private
   * @returns {boolean}
   */

  var isSVG = docElement.nodeName.toLowerCase() === 'svg';

  /**
   * setClasses takes an array of class names and adds them to the root element
   *
   * @access private
   * @function setClasses
   * @param {string[]} classes - Array of class names
   */

  // Pass in an and array of class names, e.g.:
  //  ['no-webp', 'borderradius', ...]
  function setClasses(classes) {
    var className = docElement.className;
    var classPrefix = Modernizr._config.classPrefix || '';

    if (isSVG) {
      className = className.baseVal;
    }

    // Change `no-js` to `js` (independently of the `enableClasses` option)
    // Handle classPrefix on this too
    if (Modernizr._config.enableJSClass) {
      var reJS = new RegExp('(^|\\s)' + classPrefix + 'no-js(\\s|$)');
      className = className.replace(reJS, '$1' + classPrefix + 'js$2');
    }

    if (Modernizr._config.enableClasses) {
      // Add the new classes
      className += ' ' + classPrefix + classes.join(' ' + classPrefix);
      isSVG ? docElement.className.baseVal = className : docElement.className = className;
    }

  }

  ;

  /**
   * List of property values to set for css tests. See ticket #21
   * http://git.io/vUGl4
   *
   * @memberof Modernizr
   * @name Modernizr._prefixes
   * @optionName Modernizr._prefixes
   * @optionProp prefixes
   * @access public
   * @example
   *
   * Modernizr._prefixes is the internal list of prefixes that we test against
   * inside of things like [prefixed](#modernizr-prefixed) and [prefixedCSS](#-code-modernizr-prefixedcss). It is simply
   * an array of kebab-case vendor prefixes you can use within your code.
   *
   * Some common use cases include
   *
   * Generating all possible prefixed version of a CSS property
   * ```js
   * var rule = Modernizr._prefixes.join('transform: rotate(20deg); ');
   *
   * rule === 'transform: rotate(20deg); webkit-transform: rotate(20deg); moz-transform: rotate(20deg); o-transform: rotate(20deg); ms-transform: rotate(20deg);'
   * ```
   *
   * Generating all possible prefixed version of a CSS value
   * ```js
   * rule = 'display:' +  Modernizr._prefixes.join('flex; display:') + 'flex';
   *
   * rule === 'display:flex; display:-webkit-flex; display:-moz-flex; display:-o-flex; display:-ms-flex; display:flex'
   * ```
   */

  // we use ['',''] rather than an empty array in order to allow a pattern of .`join()`ing prefixes to test
  // values in feature detects to continue to work
  var prefixes = (ModernizrProto._config.usePrefixes ? ' -webkit- -moz- -o- -ms- '.split(' ') : ['','']);

  // expose these for the plugin API. Look in the source for how to join() them against your input
  ModernizrProto._prefixes = prefixes;

  /**
   * createElement is a convenience wrapper around document.createElement. Since we
   * use createElement all over the place, this allows for (slightly) smaller code
   * as well as abstracting away issues with creating elements in contexts other than
   * HTML documents (e.g. SVG documents).
   *
   * @access private
   * @function createElement
   * @returns {HTMLElement|SVGElement} An HTML or SVG element
   */

  function createElement() {
    if (typeof document.createElement !== 'function') {
      // This is the case in IE7, where the type of createElement is "object".
      // For this reason, we cannot call apply() as Object is not a Function.
      return document.createElement(arguments[0]);
    } else if (isSVG) {
      return document.createElementNS.call(document, 'http://www.w3.org/2000/svg', arguments[0]);
    } else {
      return document.createElement.apply(document, arguments);
    }
  }

  ;
/*!
{
  "name": "CSS Gradients",
  "caniuse": "css-gradients",
  "property": "cssgradients",
  "tags": ["css"],
  "knownBugs": ["False-positives on webOS (https://github.com/Modernizr/Modernizr/issues/202)"],
  "notes": [{
    "name": "Webkit Gradient Syntax",
    "href": "https://webkit.org/blog/175/introducing-css-gradients/"
  },{
    "name": "Linear Gradient Syntax",
    "href": "https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient"
  },{
    "name": "W3C Gradient Spec",
    "href": "https://drafts.csswg.org/css-images-3/#gradients"
  }]
}
!*/

  Modernizr.addTest('cssgradients', function() {

    var str1 = 'background-image:';
    var str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));';
    var css = '';
    var angle;

    for (var i = 0, len = prefixes.length - 1; i < len; i++) {
      angle = (i === 0 ? 'to ' : '');
      css += str1 + prefixes[i] + 'linear-gradient(' + angle + 'left top, #9f9, white);';
    }

    if (Modernizr._config.usePrefixes) {
    // legacy webkit syntax (FIXME: remove when syntax not in use anymore)
      css += str1 + '-webkit-' + str2;
    }

    var elem = createElement('a');
    var style = elem.style;
    style.cssText = css;

    // IE6 returns undefined so cast to string
    return ('' + style.backgroundImage).indexOf('gradient') > -1;
  });

  // Run each test
  testRunner();

  // Remove the "no-js" class if it exists
  setClasses(classes);

  delete ModernizrProto.addTest;
  delete ModernizrProto.addAsyncTest;

  // Run the things that are supposed to run after the tests
  for (var i = 0; i < Modernizr._q.length; i++) {
    Modernizr._q[i]();
  }

  // Leak Modernizr namespace
  window.Modernizr = Modernizr;

;

})(window, document);


text:
package com.w3asel.cubesensors.api.v1.format;

import org.junit.Assert;
import org.junit.Test;

import com.w3asel.cubesensors.api.v1.format.Signal.State;

/**
 * Unit tests on {@link Signal}.
 *
 * @author Joe
 */
public class TestSignal {
	/** test corner cases of the signal strength labels */
	@Test
	public void testToRating() {
		String expected, actual;

		expected = State.FULL.getLabel();
		actual = Signal.toRating(-State.FULL.getMaxValue() + 1);
		Assert.assertEquals(expected, actual);

		expected = State.HIGH.getLabel();
		actual = Signal.toRating(-State.FULL.getMaxValue());
		Assert.assertEquals(expected, actual);

		expected = State.HIGH.getLabel();
		actual = Signal.toRating(-State.HIGH.getMaxValue() + 1);
		Assert.assertEquals(expected, actual);

		expected = State.MEDIUM.getLabel();
		actual = Signal.toRating(-State.HIGH.getMaxValue());
		Assert.assertEquals(expected, actual);

		expected = State.MEDIUM.getLabel();
		actual = Signal.toRating(-State.MEDIUM.getMaxValue() + 1);
		Assert.assertEquals(expected, actual);

		expected = State.LOW.getLabel();
		actual = Signal.toRating(-State.MEDIUM.getMaxValue());
		Assert.assertEquals(expected, actual);

		expected = State.LOW.getLabel();
		actual = Signal.toRating(-State.LOW.getMaxValue() + 1);
		Assert.assertEquals(expected, actual);

		expected = "Unknown";
		actual = Signal.toRating(-State.LOW.getMaxValue());
		Assert.assertEquals(expected, actual);
	}
}

redpajama_set_name: RedPajamaGithub


text:
(function($, GGRC, moment, Permission) {
  GGRC.Utils = {
    firstWorkingDay: function (date) {
      date = moment(date);
      // 6 is Saturday 0 is Sunday
      while (_.contains([0, 6], date.day())) {
        date.add(1, "day");
      }
      return date.toDate();
    },
    getPickerElement: function (picker) {
      return _.find(_.values(picker), function (val) {
        if (val instanceof Node) {
          return /picker\-dialog/.test(val.className);
        }
        return false;
      });
    },
    download: function (filename, text) {
      var element = document.createElement('a');
      element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
      element.setAttribute('download', filename);
      element.style.display = 'none';
      document.body.appendChild(element);
      element.click();
      document.body.removeChild(element);
    },
    export_request: function (request) {
      return $.ajax({
        type: "POST",
        dataType: "text",
        headers: $.extend({
          "Content-Type": "application/json",
          "X-export-view": "blocks",
          "X-requested-by": "gGRC"
        }, request.headers || {}),
        url: "/_service/export_csv",
        data: JSON.stringify(request.data || {})
      });
    },
    is_mapped: function (target, destination) {
      var table_plural = CMS.Models[destination.type].table_plural,
          bindings = target.get_binding((target.has_binding(table_plural) ? "" : "related_") + table_plural);

      if (bindings && bindings.list && bindings.list.length) {
        return _.find(bindings.list, function (item) {
          return item.instance.id === destination.id;
        });
      }
      if (target.objects && target.objects.length) {
        return _.find(target.objects, function (item) {
          return item.id === destination.id && item.type === destination.type;
        });
      }
    },

  /**
   * Determine if `source` is allowed to be mapped to `target`.
   *
   * By symmetry, this method can be also used to check whether `source` can
   * be unmapped from `target`.
   *
   * @param {Object} source - the source object the mapping
   * @param {Object} target - the target object of the mapping
   * @param {Object} options - the options objects, similar to the one that is
   *   passed as an argument to Mustache helpers
   *
   * @return {Boolean} - true if mapping is allowed, false otherwise
   */
    allowed_to_map: function (source, target, options) {
      var canMap = false;
      var types;
      var targetType;
      var sourceType;
      var targetContext;
      var sourceContext;
      var createContexts;
      var canonical;
      var hasWidget;
      var canonicalMapping;
      var forbidden = {
        'audit program': true,
        'audit request': true
      };

      if (target instanceof can.Model) {
        targetType = target.constructor.shortName;
      } else {
        targetType = target.type || target;
      }
      sourceType = source.constructor.shortName || source;

      // special case check:
      // - mapping an Audit to a Program is not allowed
      // - mapping an Audit to a Request is not allowed
      // (and vice versa)
      types = [sourceType.toLowerCase(), targetType.toLowerCase()].sort();
      if (forbidden[types.join(' ')]) {
        return false;
      }

      canonical = GGRC.Mappings.get_canonical_mapping_name(
        sourceType, targetType);
      canonicalMapping = GGRC.Mappings.get_canonical_mapping(
        sourceType, targetType);

      if (canonical && canonical.indexOf('_') === 0) {
        canonical = null;
      }

      hasWidget = _.contains(
        GGRC.tree_view.base_widgets_by_type[sourceType] || [],
        targetType);

      if (_.exists(options, 'hash.join') && (!canonical || !hasWidget) ||
          (canonical && !canonicalMapping.model_name)) {
        return false;
      }
      targetContext = _.exists(target, 'context.id');
      sourceContext = _.exists(source, 'context.id');
      createContexts = _.exists(
        GGRC, 'permissions.create.Relationship.contexts');

      canMap = Permission.is_allowed_for('update', source) ||
        sourceType === 'Person' ||
        _.contains(createContexts, sourceContext);

      if (target instanceof can.Model) {
        canMap = canMap &&
          (Permission.is_allowed_for('update', target) ||
           targetType === 'Person' ||
           _.contains(createContexts, targetContext));
      }
      return canMap;
    }
  };
})(jQuery, window.GGRC = window.GGRC || {}, window.moment, window.Permission);


text:
package com.google.android.accessibility.brailleime;

import android.content.Context;
import android.view.OrientationEventListener;
import com.google.common.annotations.VisibleForTesting;

/**
 * Monitors the orientation changed event even when device auto rotate is locked.
 *
 *
OrientationMonitor is a singleton. The calling sequence is as below.
 *
 *
1. Call {@link #init(Context)} once to make sure OrientationMonitor has been
 * initialized.
 *
 *
2. Call {@link #enable()} to start monitor orientation changed events from system.
 */
public class OrientationMonitor {
  /** Screen orientations. */
  public enum Orientation {
    UNKNOWN(-1),
    PORTRAIT(0),
    LANDSCAPE(90),
    REVERSE_PORTRAIT(180),
    REVERSE_LANDSCAPE(270),
    ;

    private final int degree;

    Orientation(int degree) {
      this.degree = degree;
    }

    public int getDegree() {
      return degree;
    }
  }

  /** Callback register in {@link OrientationMonitor}. */
  public interface Callback {
    void onOrientationChanged(Orientation orientation);
  }

  private static OrientationMonitor singleton;
  private Callback orientationMonitorCallback;
  private boolean enabled;
  private Orientation currentOrientation = Orientation.UNKNOWN;
  private OrientationEventListener orientationEventListener;

  public static OrientationMonitor getInstance() {
    if (singleton == null) {
      throw new IllegalStateException("You forget to call init()!");
    }
    return singleton;
  }

  public static void init(Context context) {
    if (singleton == null) {
      singleton = new OrientationMonitor();
      singleton.orientationEventListener =
          new OrientationEventListener(context.getApplicationContext()) {
            @Override
            public void onOrientationChanged(int degree) {
              degree = Utils.isDeviceDefaultPortrait(context) ? degree : degree - 90;
              Orientation newOrientation = convertToOrientation(degree);
              if (newOrientation != singleton.currentOrientation) {
                singleton.currentOrientation = newOrientation;
                if (singleton.orientationMonitorCallback != null) {
                  singleton.orientationMonitorCallback.onOrientationChanged(newOrientation);
                }
              }
            }

            private Orientation convertToOrientation(int degree) {
              for (Orientation orientation : Orientation.values()) {
                if (orientation != Orientation.UNKNOWN
                    && Math.abs(degree - orientation.getDegree()) <= 45) {
                  return orientation;
                }
              }
              // Special case for portrait when the degrees is close to 360.
              if (Math.abs(degree - 360) <= 45) {
                return Orientation.PORTRAIT;
              }
              return Orientation.UNKNOWN;
            }
          };
    }
  }

  public void enable() {
    if (enabled) {
      return;
    }
    enabled = true;
    orientationEventListener.enable();
  }

  public void disable() {
    if (!enabled) {
      return;
    }
    enabled = false;
    orientationEventListener.disable();
  }

  public Orientation getCurrentOrientation() {
    return currentOrientation;
  }

  public void registerCallback(Callback orientationMonitorCallback) {
    this.orientationMonitorCallback = orientationMonitorCallback;
  }

  public void unregisterCallback() {
    orientationMonitorCallback = null;
  }

  @VisibleForTesting
  public void testing_setOrientationEventListener(OrientationEventListener listener) {
    orientationEventListener = listener;
  }

  @VisibleForTesting
  public OrientationEventListener testing_getOrientationEventListener() {
    return orientationEventListener;
  }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop>
<C:supported-calendar-component-set/>
</D:prop>
</D:propfind>


text:
==============================
What's New in SQLAlchemy 1.0?
==============================

.. admonition:: About this Document

    This document describes changes between SQLAlchemy version 0.9,
    undergoing maintenance releases as of May, 2014,
    and SQLAlchemy version 1.0, as of yet unreleased.

    Document last updated: May 23, 2014

Introduction
============

This guide introduces what's new in SQLAlchemy version 1.0,
and also documents changes which affect users migrating
their applications from the 0.9 series of SQLAlchemy to 1.0.

Please carefully review
:ref:`behavioral_changes_orm_10` and :ref:`behavioral_changes_core_10` for
potentially backwards-incompatible changes.

.. _behavioral_changes_orm_10:

Behavioral Changes - ORM
========================

.. _migration_3061:

Changes to attribute events and other operations regarding attributes that have no pre-existing value
------------------------------------------------------------------------------------------------------

Given an object with no state::

	>>> obj = Foo()

It has always been SQLAlchemy's behavior such that if we access a scalar
or many-to-one attribute that was never set, it is returned as ``None``::

	>>> obj.someattr
	None

This value of ``None`` is in fact now part of the state of ``obj``, and is
not unlike as though we had set the attribute explicitly, e.g.
``obj.someattr = None``.  However, the "set on get" here would behave
differently as far as history and events.   It would not emit any attribute
event, and additionally if we view history, we see this::

	>>> inspect(obj).attrs.someattr.history
	History(added=(), unchanged=[None], deleted=())	  # 0.9 and below

That is, it's as though the attribute were always ``None`` and were
never changed.  This is explicitly different from if we had set the
attribute first instead::

	>>> obj = Foo()
	>>> obj.someattr = None
	>>> inspect(obj).attrs.someattr.history
	History(added=[None], unchanged=(), deleted=())  # all versions

The above means that the behavior of our "set" operation can be corrupted
by the fact that the value was accessed via "get" earlier.  In 1.0, this
inconsistency has been resolved, by no longer actually setting anything
when the default "getter" is used.

	>>> obj = Foo()
	>>> obj.someattr
	None
	>>> inspect(obj).attrs.someattr.history
	History(added=(), unchanged=(), deleted=())  # 1.0
	>>> obj.someattr = None
	>>> inspect(obj).attrs.someattr.history
	History(added=[None], unchanged=(), deleted=())

The reason the above behavior hasn't had much impact is because the
INSERT statement in relational databases considers a missing value to be
the same as NULL in most cases.   Whether SQLAlchemy received a history
event for a particular attribute set to None or not would usually not matter;
as the difference between sending None/NULL or not wouldn't have an impact.
However, as :ticket:`3060` illustrates, there are some seldom edge cases
where we do in fact want to positively have ``None`` set.  Also, allowing
the attribute event here means it's now possible to create "default value"
functions for ORM mapped attributes.

As part of this change, the generation of the implicit "None" is now disabled
for other situations where this used to occur; this includes when an
attribute set operation on a many-to-one is received; previously, the "old" value
would be "None" if it had been not set otherwise; it now will send the
value :data:`.orm.attributes.NEVER_SET`, which is a value that may be sent
to an attribute listener now.   This symbol may also be received when
calling on mapper utility functions such as :meth:`.Mapper.primary_key_from_state`;
if the primary key attributes have no setting at all, whereas the value
would be ``None`` before, it will now be the :data:`.orm.attributes.NEVER_SET`
symbol, and no change to the object's state occurs.

:ticket:`3061`

.. _behavioral_changes_core_10:

Behavioral Changes - Core
=========================

New Features
============

.. _feature_3034:

Select/Query LIMIT / OFFSET may be specified as an arbitrary SQL expression
----------------------------------------------------------------------------

The :meth:`.Select.limit` and :meth:`.Select.offset` methods now accept
any SQL expression, in addition to integer values, as arguments.  The ORM
:class:`.Query` object also passes through any expression to the underlying
:class:`.Select` object.   Typically
this is used to allow a bound parameter to be passed, which can be substituted
with a value later::

	sel = select([table]).limit(bindparam('mylimit')).offset(bindparam('myoffset'))

Dialects which don't support non-integer LIMIT or OFFSET expressions may continue
to not support this behavior; third party dialects may also need modification
in order to take advantage of the new behavior.  A dialect which currently
uses the ``._limit`` or ``._offset`` attributes will continue to function
for those cases where the limit/offset was specified as a simple integer value.
However, when a SQL expression is specified, these two attributes will
instead raise a :class:`.CompileError` on access.  A third-party dialect which
wishes to support the new feature should now call upon the ``._limit_clause``
and ``._offset_clause`` attributes to receive the full SQL expression, rather
than the integer value.

.. _feature_3076:

Behavioral Improvements
=======================

Dialect Changes
===============

.. _change_2984:

Drizzle Dialect is now an External Dialect
------------------------------------------

The dialect for `Drizzle <http://www.drizzle.org/>`_ is now an external
dialect, available at https://bitbucket.org/zzzeek/sqlalchemy-drizzle.
This dialect was added to SQLAlchemy right before SQLAlchemy was able to
accommodate third party dialects well; going forward, all databases that aren't
within the "ubiquitous use" category are third party dialects.
The dialect's implementation hasn't changed and is still based on the
MySQL + MySQLdb dialects within SQLAlchemy.  The dialect is as of yet
unreleased and in "attic" status; however it passes the majority of tests
and is generally in decent working order, if someone wants to pick up
on polishing it.


text:
//  Copyright John Maddock 2006.
//  Use, modification and distribution are subject to the
//  Boost Software License, Version 1.0. (See accompanying file
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_STATS_EXPONENTIAL_HPP
#define BOOST_STATS_EXPONENTIAL_HPP

#include <boost/math/distributions/fwd.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/math/special_functions/log1p.hpp>
#include <boost/math/special_functions/expm1.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/config/no_tr1/cmath.hpp>

#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4127) // conditional expression is constant
# pragma warning(disable: 4702) // unreachable code (return after domain_error throw).
#endif

#include <utility>

namespace boost{ namespace math{

namespace detail{
//
// Error check:
//
template <class RealType, class Policy>
inline bool verify_lambda(const char* function, RealType l, RealType* presult, const Policy& pol)
{
   if((l <= 0) || !(boost::math::isfinite)(l))
   {
      *presult = policies::raise_domain_error<RealType>(
         function,
         "The scale parameter \"lambda\" must be > 0, but was: %1%.", l, pol);
      return false;
   }
   return true;
}

template <class RealType, class Policy>
inline bool verify_exp_x(const char* function, RealType x, RealType* presult, const Policy& pol)
{
   if((x < 0) || (boost::math::isnan)(x))
   {
      *presult = policies::raise_domain_error<RealType>(
         function,
         "The random variable must be >= 0, but was: %1%.", x, pol);
      return false;
   }
   return true;
}

} // namespace detail

template <class RealType = double, class Policy = policies::policy<> >
class exponential_distribution
{
public:
   typedef RealType value_type;
   typedef Policy policy_type;

   exponential_distribution(RealType lambda = 1)
      : m_lambda(lambda)
   {
      RealType err;
      detail::verify_lambda("boost::math::exponential_distribution<%1%>::exponential_distribution", lambda, &err, Policy());
   } // exponential_distribution

   RealType lambda()const { return m_lambda; }

private:
   RealType m_lambda;
};

typedef exponential_distribution<double> exponential;

template <class RealType, class Policy>
inline const std::pair<RealType, RealType> range(const exponential_distribution<RealType, Policy>& /*dist*/)
{ // Range of permissible values for random variable x.
  if (std::numeric_limits<RealType>::has_infinity)
  {
    return std::pair<RealType, RealType>(static_cast<RealType>(0), std::numeric_limits<RealType>::infinity()); // 0 to + infinity.
  }
  else
  {
   using boost::math::tools::max_value;
   return std::pair<RealType, RealType>(static_cast<RealType>(0), max_value<RealType>()); // 0 to + max
  }
}

template <class RealType, class Policy>
inline const std::pair<RealType, RealType> support(const exponential_distribution<RealType, Policy>& /*dist*/)
{ // Range of supported values for random variable x.
   // This is range where cdf rises from 0 to 1, and outside it, the pdf is zero.
   using boost::math::tools::max_value;
   using boost::math::tools::min_value;
   return std::pair<RealType, RealType>(min_value<RealType>(),  max_value<RealType>());
   // min_value<RealType>() to avoid a discontinuity at x = 0.
}

template <class RealType, class Policy>
inline RealType pdf(const exponential_distribution<RealType, Policy>& dist, const RealType& x)
{
   BOOST_MATH_STD_USING // for ADL of std functions

   static const char* function = "boost::math::pdf(const exponential_distribution<%1%>&, %1%)";

   RealType lambda = dist.lambda();
   RealType result = 0;
   if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
      return result;
   if(0 == detail::verify_exp_x(function, x, &result, Policy()))
      return result;
   result = lambda * exp(-lambda * x);
   return result;
} // pdf

template <class RealType, class Policy>
inline RealType cdf(const exponential_distribution<RealType, Policy>& dist, const RealType& x)
{
   BOOST_MATH_STD_USING // for ADL of std functions

   static const char* function = "boost::math::cdf(const exponential_distribution<%1%>&, %1%)";

   RealType result = 0;
   RealType lambda = dist.lambda();
   if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
      return result;
   if(0 == detail::verify_exp_x(function, x, &result, Policy()))
      return result;
   result = -boost::math::expm1(-x * lambda, Policy());

   return result;
} // cdf

template <class RealType, class Policy>
inline RealType quantile(const exponential_distribution<RealType, Policy>& dist, const RealType& p)
{
   BOOST_MATH_STD_USING // for ADL of std functions

   static const char* function = "boost::math::quantile(const exponential_distribution<%1%>&, %1%)";

   RealType result = 0;
   RealType lambda = dist.lambda();
   if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
      return result;
   if(0 == detail::check_probability(function, p, &result, Policy()))
      return result;

   if(p == 0)
      return 0;
   if(p == 1)
      return policies::raise_overflow_error<RealType>(function, 0, Policy());

   result = -boost::math::log1p(-p, Policy()) / lambda;
   return result;
} // quantile

template <class RealType, class Policy>
inline RealType cdf(const complemented2_type<exponential_distribution<RealType, Policy>, RealType>& c)
{
   BOOST_MATH_STD_USING // for ADL of std functions

   static const char* function = "boost::math::cdf(const exponential_distribution<%1%>&, %1%)";

   RealType result = 0;
   RealType lambda = c.dist.lambda();
   if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
      return result;
   if(0 == detail::verify_exp_x(function, c.param, &result, Policy()))
      return result;
   result = exp(-c.param * lambda);

   return result;
}

template <class RealType, class Policy>
inline RealType quantile(const complemented2_type<exponential_distribution<RealType, Policy>, RealType>& c)
{
   BOOST_MATH_STD_USING // for ADL of std functions

   static const char* function = "boost::math::quantile(const exponential_distribution<%1%>&, %1%)";

   RealType result = 0;
   RealType lambda = c.dist.lambda();
   if(0 == detail::verify_lambda(function, lambda, &result, Policy()))
      return result;

   RealType q = c.param;
   if(0 == detail::check_probability(function, q, &result, Policy()))
      return result;

   if(q == 1)
      return 0;
   if(q == 0)
      return policies::raise_overflow_error<RealType>(function, 0, Policy());

   result = -log(q) / lambda;
   return result;
}

template <class RealType, class Policy>
inline RealType mean(const exponential_distribution<RealType, Policy>& dist)
{
   RealType result = 0;
   RealType lambda = dist.lambda();
   if(0 == detail::verify_lambda("boost::math::mean(const exponential_distribution<%1%>&)", lambda, &result, Policy()))
      return result;
   return 1 / lambda;
}

template <class RealType, class Policy>
inline RealType standard_deviation(const exponential_distribution<RealType, Policy>& dist)
{
   RealType result = 0;
   RealType lambda = dist.lambda();
   if(0 == detail::verify_lambda("boost::math::standard_deviation(const exponential_distribution<%1%>&)", lambda, &result, Policy()))
      return result;
   return 1 / lambda;
}

template <class RealType, class Policy>
inline RealType mode(const exponential_distribution<RealType, Policy>& /*dist*/)
{
   return 0;
}

template <class RealType, class Policy>
inline RealType median(const exponential_distribution<RealType, Policy>& dist)
{
   using boost::math::constants::ln_two;
   return ln_two<RealType>() / dist.lambda(); // ln(2) / lambda
}

template <class RealType, class Policy>
inline RealType skewness(const exponential_distribution<RealType, Policy>& /*dist*/)
{
   return 2;
}

template <class RealType, class Policy>
inline RealType kurtosis(const exponential_distribution<RealType, Policy>& /*dist*/)
{
   return 9;
}

template <class RealType, class Policy>
inline RealType kurtosis_excess(const exponential_distribution<RealType, Policy>& /*dist*/)
{
   return 6;
}

} // namespace math
} // namespace boost

#ifdef BOOST_MSVC
# pragma warning(pop)
#endif

// This include must be at the end, *after* the accessors
// for this distribution have been defined, in order to
// keep compilers that support two-phase lookup happy.
#include <boost/math/distributions/detail/derived_accessors.hpp>

#endif // BOOST_STATS_EXPONENTIAL_HPP


text:
ES5Harness.registerTest( {
id: "15.2.3.3-4-124",

path: "TestCases/chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-124.js",

description: "Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Date.prototype.getHours)",

test: function testcase() {
  var desc = Object.getOwnPropertyDescriptor(Date.prototype, "getHours");
  if (desc.value === Date.prototype.getHours &&
      desc.writable === true &&
      desc.enumerable === false &&
      desc.configurable === true) {
    return true;
  }
 },

precondition: function prereq() {
  return fnExists(Object.getOwnPropertyDescriptor);
 }
});


text:
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {routing} from './content-details.routing';

import {SharedModule} from 'app/components/shared/app.shared.module';
import {ContentDetailsComponent} from './content-details.component';

@NgModule({
  imports: [
    CommonModule,
    SharedModule,
    routing
  ],
  declarations: [
    ContentDetailsComponent
  ]
})
export class ContentDetailsModule {
}


text:
var expect = require('chai').expect;
var Dispatcher = require('../lib/dispatcher');

describe('Integration', function () {
  it('Suite 1', function (done) {
    var dispatcher = Dispatcher.createDispatcher();
    var navigate = dispatcher.createAction('navigate', function (state) {
      return state;
    });
    var store = dispatcher.createStore()
      .define('state', 'splash')
      .handle('navigate:succeeded', function (state) {
        this.state = state;
      });

    expect(store.state).to.equal('splash');

    store.on('change:state', function (state) {
      expect(state).to.equal('login');
      expect(store.state).to.equal('login');
      done();
    });

    navigate('login');
  });
});


text:
from enum import Enum

from CommonServerPython import *

RESULT = 'Result'
TACTIC = 'Tactic'

class Result(Enum):
    SUSPICIOUS = 'Suspicious'
    NOT_DETECTED = 'Not Detected'

RESULT_TO_COLOR = {
    Result.SUSPICIOUS: "🔴",
    Result.NOT_DETECTED: "🟢",
}

class Finding:
    tactic: str
    result: Result

    def __init__(self, context_name: str, value: dict):
        self.context_name = context_name
        self.tactic = value.get(TACTIC, f'{self.context_name} (missing tactic value)')
        self.result = Result(value.get(RESULT, Result.NOT_DETECTED.value))

    def to_summary_line(self) -> Dict[str, str]:
        return {
            TACTIC: self.tactic,
            RESULT: f'{RESULT_TO_COLOR[self.result]}  {self.result.value.title()}'
        }

def get_findings(malware_findings_context: dict) -> List[Finding]:
    findings = []
    for name, value in malware_findings_context.items():
        if isinstance(value, list):  # when running the script for the second time, values are put in lists.
            value = value[-1]  # solves for one or multiple values
        findings.append(Finding(name, value))
    return findings

def findings_to_command_results(findings: List[Finding]) -> CommandResults:
    if not findings:
        return CommandResults(
            readable_output='### Waiting on entries\n'
                            'When `InvestigationSummaryParse` is finished, its results will appear here.'
        )
    outputs = list(finding.to_summary_line() for finding in findings)
    return CommandResults(
        outputs_prefix='InvestigationSummary',
        outputs=outputs,
        readable_output=tableToMarkdown(
            '',
            outputs,
            [TACTIC, RESULT],
        )
    )

def main():
    try:
        malware_context = json.loads(
            demisto.incident().get('CustomFields', {}).get('malwareinvestigationsummary', '{}')
        )
        return_results(findings_to_command_results(get_findings(malware_context)))
    except Exception as e:
        demisto.error(traceback.format_exc())  # print the traceback
        return_error(f'Failed to execute InvestigationSummaryToTable. Error: {str(e)}')

if __name__ in ['__main__', '__builtin__', 'builtins']:
    main()


text:
import cx_Freeze
import sys
import os.path
from version_hunter.versioner import Versioner

# Collect version file
v = Versioner()
version = v.get_version()

# This is needed for Cx_Freeze to find path to tcl and tk libraries.
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')

base = None
# base = "Console" # use for testing in deployed version

DATA_DIR = "../weather_app/Data/"

if sys.platform == "win32":
    base = "Win32GUI"

include_files = [DATA_DIR,
                 os.path.join(DATA_DIR,
                              "Icons",
                              "app_icon",
                              "app_icon48x48.ico"),
                 os.path.join(DATA_DIR, "DLLs", "32bit", 'tk86t.dll'),
                 os.path.join(DATA_DIR, "DLLs", "32bit", 'tcl86t.dll'),
                 ]
includes = []
excludes = ["PyQt5"]
packages = ["tkinter", "idna"]
executables = [cx_Freeze.Executable("../weather_app/weather_gui.py",
                                    base=base,
                                    icon=os.path.join(DATA_DIR,
                                                      "Icons",
                                                      "app_icon",
                                                      "app_icon96x96.ico"),
                                    targetName="Weather_App_32bit.exe"),
               ]

cx_Freeze.setup(
    name='Weather_App_32bit',
    version=version,
    description='Weather report application',
    author='Tomasz Kluczkowski',
    author_email='tomaszk1@hotmail.co.uk',
    options={'build_exe': {'includes': includes,
                           'excludes': excludes,
                           'packages': packages,
                           'include_files': include_files}},
    executables=executables)


text:
namespace NJekyll.Engine
{
    public class Layout : ContentFile
    {
        internal string Name { get; private set; }
        internal string ParentLayout { get; private set; }

        public Layout(string virtualPath)
            : base(virtualPath)
        {
        }

        protected override void Init()
        {
            // ge layout name from file name
            Name = System.IO.Path.GetFileNameWithoutExtension(this.Path);

            // extract parent layout from front matter
            if (FrontMatter.ContainsKey("layout"))
            {
                ParentLayout = (string)FrontMatter["layout"];
            }
        }
    }
}


text:
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.Azure.Management.Sql;
using Microsoft.Azure.Management.Sql.Models;

namespace Microsoft.Azure.Management.Sql
{
    /// <summary>
    /// The Windows Azure SQL Database management API provides a RESTful set of
    /// web services that interact with Windows Azure SQL Database services to
    /// manage your databases. The API enables users to create, retrieve,
    /// update, and delete databases and servers.
    /// </summary>
    public static partial class AuditingPolicyOperationsExtensions
    {
        /// <summary>
        /// Creates or updates an Azure SQL Database auditing policy.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group to which the server
        /// belongs.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL Database Server on which the
        /// database is hosted.
        /// </param>
        /// <param name='databaseName'>
        /// Required. The name of the Azure SQL Database for which the auditing
        /// policy applies.
        /// </param>
        /// <param name='parameters'>
        /// Required. The required parameters for createing or updating a Azure
        /// SQL Database auditing policy.
        /// </param>
        /// <returns>
        /// A standard service response including an HTTP status code and
        /// request ID.
        /// </returns>
        public static AzureOperationResponse CreateOrUpdateDatebasePolicy(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseAuditingPolicyCreateOrUpdateParameters parameters)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IAuditingPolicyOperations)s).CreateOrUpdateDatebasePolicyAsync(resourceGroupName, serverName, databaseName, parameters);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Creates or updates an Azure SQL Database auditing policy.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group to which the server
        /// belongs.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL Database Server on which the
        /// database is hosted.
        /// </param>
        /// <param name='databaseName'>
        /// Required. The name of the Azure SQL Database for which the auditing
        /// policy applies.
        /// </param>
        /// <param name='parameters'>
        /// Required. The required parameters for createing or updating a Azure
        /// SQL Database auditing policy.
        /// </param>
        /// <returns>
        /// A standard service response including an HTTP status code and
        /// request ID.
        /// </returns>
        public static Task<AzureOperationResponse> CreateOrUpdateDatebasePolicyAsync(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseAuditingPolicyCreateOrUpdateParameters parameters)
        {
            return operations.CreateOrUpdateDatebasePolicyAsync(resourceGroupName, serverName, databaseName, parameters, CancellationToken.None);
        }

        /// <summary>
        /// Creates or updates an Azure SQL Database Server auditing policy.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group to which the server
        /// belongs.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL Database Server on which the
        /// database is hosted.
        /// </param>
        /// <param name='parameters'>
        /// Required. The required parameters for createing or updating a Azure
        /// SQL Database Server auditing policy.
        /// </param>
        /// <returns>
        /// A standard service response including an HTTP status code and
        /// request ID.
        /// </returns>
        public static AzureOperationResponse CreateOrUpdateServerPolicy(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName, ServerAuditingPolicyCreateOrUpdateParameters parameters)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IAuditingPolicyOperations)s).CreateOrUpdateServerPolicyAsync(resourceGroupName, serverName, parameters);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Creates or updates an Azure SQL Database Server auditing policy.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group to which the server
        /// belongs.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL Database Server on which the
        /// database is hosted.
        /// </param>
        /// <param name='parameters'>
        /// Required. The required parameters for createing or updating a Azure
        /// SQL Database Server auditing policy.
        /// </param>
        /// <returns>
        /// A standard service response including an HTTP status code and
        /// request ID.
        /// </returns>
        public static Task<AzureOperationResponse> CreateOrUpdateServerPolicyAsync(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName, ServerAuditingPolicyCreateOrUpdateParameters parameters)
        {
            return operations.CreateOrUpdateServerPolicyAsync(resourceGroupName, serverName, parameters, CancellationToken.None);
        }

        /// <summary>
        /// Returns an Azure SQL Database auditing policy.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group to which the server
        /// belongs.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL Database Server on which the
        /// database is hosted.
        /// </param>
        /// <param name='databaseName'>
        /// Required. The name of the Azure SQL Database for which the auditing
        /// policy applies.
        /// </param>
        /// <returns>
        /// Represents the response to a get database auditing policy request.
        /// </returns>
        public static DatabaseAuditingPolicyGetResponse GetDatabasePolicy(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName, string databaseName)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IAuditingPolicyOperations)s).GetDatabasePolicyAsync(resourceGroupName, serverName, databaseName);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Returns an Azure SQL Database auditing policy.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group to which the server
        /// belongs.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL Database Server on which the
        /// database is hosted.
        /// </param>
        /// <param name='databaseName'>
        /// Required. The name of the Azure SQL Database for which the auditing
        /// policy applies.
        /// </param>
        /// <returns>
        /// Represents the response to a get database auditing policy request.
        /// </returns>
        public static Task<DatabaseAuditingPolicyGetResponse> GetDatabasePolicyAsync(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName, string databaseName)
        {
            return operations.GetDatabasePolicyAsync(resourceGroupName, serverName, databaseName, CancellationToken.None);
        }

        /// <summary>
        /// Returns an Azure SQL Database server auditing policy.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group to which the server
        /// belongs.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL Database Server on which the
        /// database is hosted.
        /// </param>
        /// <returns>
        /// Represents the response to a get database auditing policy request.
        /// </returns>
        public static ServerAuditingPolicyGetResponse GetServerPolicy(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IAuditingPolicyOperations)s).GetServerPolicyAsync(resourceGroupName, serverName);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Returns an Azure SQL Database server auditing policy.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IAuditingPolicyOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group to which the server
        /// belongs.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL Database Server on which the
        /// database is hosted.
        /// </param>
        /// <returns>
        /// Represents the response to a get database auditing policy request.
        /// </returns>
        public static Task<ServerAuditingPolicyGetResponse> GetServerPolicyAsync(this IAuditingPolicyOperations operations, string resourceGroupName, string serverName)
        {
            return operations.GetServerPolicyAsync(resourceGroupName, serverName, CancellationToken.None);
        }
    }
}


text:
package com.amazonaws.services.sagemaker.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.sagemaker.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * UserSettings JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UserSettingsJsonUnmarshaller implements Unmarshaller<UserSettings, JsonUnmarshallerContext> {

    public UserSettings unmarshall(JsonUnmarshallerContext context) throws Exception {
        UserSettings userSettings = new UserSettings();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return null;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("ExecutionRole", targetDepth)) {
                    context.nextToken();
                    userSettings.setExecutionRole(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("SecurityGroups", targetDepth)) {
                    context.nextToken();
                    userSettings.setSecurityGroups(new ListUnmarshaller<String>(context.getUnmarshaller(String.class))

                    .unmarshall(context));
                }
                if (context.testExpression("SharingSettings", targetDepth)) {
                    context.nextToken();
                    userSettings.setSharingSettings(SharingSettingsJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("JupyterServerAppSettings", targetDepth)) {
                    context.nextToken();
                    userSettings.setJupyterServerAppSettings(JupyterServerAppSettingsJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("KernelGatewayAppSettings", targetDepth)) {
                    context.nextToken();
                    userSettings.setKernelGatewayAppSettings(KernelGatewayAppSettingsJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("TensorBoardAppSettings", targetDepth)) {
                    context.nextToken();
                    userSettings.setTensorBoardAppSettings(TensorBoardAppSettingsJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("RStudioServerProAppSettings", targetDepth)) {
                    context.nextToken();
                    userSettings.setRStudioServerProAppSettings(RStudioServerProAppSettingsJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("RSessionAppSettings", targetDepth)) {
                    context.nextToken();
                    userSettings.setRSessionAppSettings(RSessionAppSettingsJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("CanvasAppSettings", targetDepth)) {
                    context.nextToken();
                    userSettings.setCanvasAppSettings(CanvasAppSettingsJsonUnmarshaller.getInstance().unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return userSettings;
    }

    private static UserSettingsJsonUnmarshaller instance;

    public static UserSettingsJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new UserSettingsJsonUnmarshaller();
        return instance;
    }
}


text:
{% raw %}

The boring envelope game

There are two envelopes. In the envelope handed to you there is definitely {{amount | currency}}.  In the other envelope, there is either {{amount * 2 | currency}} or {{0 | currency}}. Whether the other envelope contains {{amount * 2 | currency}} or {{0 | currency}} on any particular occasion is decided in advance by flipping a fair coin, and so the other envelope already contains either {{amount * 2 | currency}} or {{0 | currency}}, each outcome being 50% likely.

Do you KEEP or SWAP?

{% endraw %}
{% include buttons.html %}
{% raw %}

        #
        Payout
        Total
        Average

        {{game.count | number}}
        {{game.payout | currency}}
        {{game.total | currency}}
        {{game.total / game.count | currency}}

{% endraw %}


text:
https://developer.mozilla.org/en-US/docs/Web/CSS/z-index

## auto
```css
.selector {
  composes: auto from 'hydrogencss/z-index.css'
}
```

or:
```css
.selector {
  composes: auto from 'hydrogencss/z-index/auto.css'
}
```


text:
package com.heliosdecompiler.helios.api.events;

public class Event {
}


text:
package com.huan.mapper;

import com.huan.model.ArticleList;

import java.util.List;

public interface ArticleListMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table article_list
     *
     * @mbg.generated Thu Jan 12 16:49:55 CST 2017
     */
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table article_list
     *
     * @mbg.generated Thu Jan 12 16:49:55 CST 2017
     */
    int insert(ArticleList record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table article_list
     *
     * @mbg.generated Thu Jan 12 16:49:55 CST 2017
     */
    ArticleList selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table article_list
     *
     * @mbg.generated Thu Jan 12 16:49:55 CST 2017
     */
    List<ArticleList> selectAll();

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table article_list
     *
     * @mbg.generated Thu Jan 12 16:49:55 CST 2017
     */
    int updateByPrimaryKey(ArticleList record);
}


text:
<atlassian-ide-plugin>
  <project-configuration id="1">
    <servers id="2" />
    <default-jira-server id="3">53aa6ff9-15bf-4b39-a30f-f35dbba5da4c</default-jira-server>
  </project-configuration>
</atlassian-ide-plugin>


text:
@implementation Specials

@end


text:
(function (angular) {
    'use strict';

    angular
        .module('equipMe.addProduct', [
        ])
        .config(config);

    function config($stateProvider) {
        $stateProvider
            .state('addProduct', {
                url: '/add-products',
                templateUrl: 'features/add-products/add-product.html',
                controller: 'addProductController',
                controllerAs: 'addProdVm'
            });
    }
}(angular));


text:
<?php
namespace chrisShick\CakeMiddlewares\Middleware;

use chrisShick\CakeMiddlewares\Utilities\IdentifierTrait;
use Geocoder\Geocoder;
use Geocoder\ProviderAggregator;
use Geocoder\Provider\FreeGeoIp;
use Ivory\HttpAdapter\FopenHttpAdapter;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

class GeolocationMiddleware
{
    use IdentifierTrait;

    /**
     * Default Configuration for the Gelocation Middleware
     *
     * @var array
     */
    protected $_defaultConfig = [
        'attribute' => 'geolocation',
        'geocoder' => null
    ];

    /**
     * @var Geocoder
     */
    private $geocoder;

    /**
     * GeolocationMiddleware constructor.
     *
     * @param array $config customized configuration options for Geolocation Middleware
     */
    public function __construct(array $config = [])
    {
        $this->setConfig($this->_setIdentifierConfig($config));

        $this->_setGeocoder($this->getConfig('geocoder'));
    }

    /**
     *
     *
     * @param /Psr/Http/Message/ServerRequestInterface $request $request ServerRequest object
     * @param /Psr/Http/Message/ResponseInterface $response Response object
     * @param callable $next next middleware call
     * @return /Psr/Http/Message/ResponseInterface
     */
    public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)
    {
        $this->_setIdentifier($request);

        if ($this->_identifier !== null && is_string($this->getConfig('attribute'))) {
            $location = $this->geocoder->geocode($this->_identifier);

            $request = $request->withAttribute($this->getConfig('attribute'), $location);
        }

        return $next($request, $response);
    }

    /**
     * Sets the geocoder class property.
     *
     * @param Geocoder|null $geocoder Geocoder object
     * @return void
     */
    protected function _setGeocoder(Geocoder $geocoder = null)
    {
        if ($geocoder === null) {
            $geocoder = new ProviderAggregator();
            $geocoder->registerProvider(new FreeGeoIp(new FopenHttpAdapter()));
        }

        $this->geocoder = $geocoder;
    }
}


text:
#include "MessageInterface.h"

#include <qcc/Debug.h>

#define QCC_MODULE "ALLJOYN_JS"

std::map<qcc::String, int32_t> _MessageInterface::constants;

std::map<qcc::String, int32_t>& _MessageInterface::Constants()
{
    if (constants.empty()) {
        CONSTANT("ALLJOYN_FLAG_NO_REPLY_EXPECTED", 0x01);
        CONSTANT("ALLJOYN_FLAG_AUTO_START",        0x02);
        CONSTANT("ALLJOYN_FLAG_ALLOW_REMOTE_MSG",  0x04);
        CONSTANT("ALLJOYN_FLAG_SESSIONLESS",       0x10);
        CONSTANT("ALLJOYN_FLAG_GLOBAL_BROADCAST",  0x20);
        CONSTANT("ALLJOYN_FLAG_COMPRESSED",        0x40);
        CONSTANT("ALLJOYN_FLAG_ENCRYPTED",         0x80);
    }
    return constants;
}

_MessageInterface::_MessageInterface(Plugin& plugin) :
    ScriptableObject(plugin, Constants())
{
    QCC_DbgTrace(("%s", __FUNCTION__));
}

_MessageInterface::~_MessageInterface()
{
    QCC_DbgTrace(("%s", __FUNCTION__));
}


text:
<!DOCTYPE HTML>

<meta charset="UTF-8">
<title>Day Events</title>

Day Events Ver 2.0

9:00 AM

9:30

10:00 AM

10:30

11:00 AM

11:30

12:00 PM

12:30

01:00 PM

01:30

02:00 PM

02:30

03:00 PM

03:30

04:00 PM

04:30

05:00 PM

05:30

06:00 PM

06:30

07:00 PM

07:30

08:00 PM

08:30

09:00 PM


text:
/**
 * DOM generation class
 */

exports.DOM = DOM;
exports.htmlEscape = htmlEscape;
exports.normalizeHeaderToId = normalizeHeaderToId;

//////////////////////////////////////////////////////////

function htmlEscape(text){
  return text
          .replace(/&/g, '&')
          .replace(/</g, '<')
          .replace(/>/g, '>')
          .replace(/\{\{/g, '{{')
          .replace(/\}\}/g, '}}');
}

function nonEmpty(header) {
  return !!header;
}

function idFromCurrentHeaders(headers) {
  if (headers.length === 1) return headers[0];
  // Do not include the first level title, as that's the title of the page.
  return headers.slice(1).filter(nonEmpty).join('_');
}

function normalizeHeaderToId(header) {
  if (typeof header !== 'string') {
    return '';
  }

  return header.toLowerCase()
      .replace(/<.*>/g, '')         // html tags
      .replace(/[\!\?\:\.\']/g, '') // special characters
      .replace(/&#\d\d;/g, '')      // html entities
      .replace(/\(.*\)/mg, '')      // stuff in parenthesis
      .replace(/\s$/, '')           // trailing spaces
      .replace(/\s+/g, '-');        // replace whitespaces with dashes
}

function DOM() {
  this.out = [];
  this.headingDepth = 0;
  this.currentHeaders = [];
  this.anchors = [];
}

var INLINE_TAGS = {
    i: true,
    b: true,
    a: true
};

DOM.prototype = {
  toString: function() {
    return this.out.join('');
  },

  text: function(content) {
    if (typeof content == "string") {
      this.out.push(htmlEscape(content));
    } else if (typeof content == 'function') {
      content.call(this, this);
    } else if (content instanceof Array) {
      this.ul(content);
    }
  },

  html: function(html) {
    if (!html) return;

    var self = this;
    // rewrite header levels, add ids and collect the ids
    html = html.replace(/<h(\d)(.*?)>([\s\S]+?)<\/h\1>/gm, function(_, level, attrs, content) {
      level = parseInt(level, 10) + self.headingDepth; // change header level based on the context

      self.currentHeaders[level - 1] = normalizeHeaderToId(content);
      self.currentHeaders.length = level;

      var id = idFromCurrentHeaders(self.currentHeaders);
      self.anchors.push(id);
      return '<h' + level + attrs + ' id="' + id + '">' + content + '</h' + level + '>';
    });

    // collect anchors
    html = html.replace(//g, function(match, anchor) {
      self.anchors.push(anchor);
      return match;
    });

    this.out.push(html);
  },

  tag: function(name, attr, text) {
    if (!text) {
      text = attr;
      attr = {};
      if (name == 'code')
        attr['ng:non-bindable'] = '';
    }
    this.out.push('<' + name);
    for(var key in attr) {
      this.out.push(" " + key + '="' + attr[key] + '"');
    }
    this.out.push('>');
    this.text(text);
    this.out.push('</' + name + '>');
    if (!INLINE_TAGS[name])
      this.out.push('\n');
  },

  code: function(text) {
    this.tag('pre', {'class':"prettyprint linenums"}, text);
  },

  div: function(attr, text) {
    this.tag('div', attr, text);
  },

  h: function(heading, content, fn){
    if (content==undefined || (content instanceof Array && content.length == 0)) return;

    this.headingDepth++;
    this.currentHeaders[this.headingDepth - 1] = normalizeHeaderToId(heading);
    this.currentHeaders.length = this.headingDepth;

    var className = null,
        anchor = null;
    if (typeof heading == 'string') {
      var id = idFromCurrentHeaders(this.currentHeaders);
      this.anchors.push(id);
      anchor = {'id': id};
      var classNameValue = this.currentHeaders[this.headingDepth - 1]
      if (/^(hide|close|collapse)$/.test(classNameValue)) classNameValue = '';
      className = {'class': classNameValue};
    }
    this.tag('h' + this.headingDepth, anchor, heading);
    if (content instanceof Array) {
      this.ul(content, className, fn);
    } else if (fn) {
      this.tag('div', className, function() {
        fn.call(this, content);
      });
    } else {
      this.tag('div', className, content);
    }
    this.headingDepth--;
  },

  h1: function(attr, text) {
    this.tag('h1', attr, text);
  },

  h2: function(attr, text) {
    this.tag('h2', attr, text);
  },

  h3: function(attr, text) {
    this.tag('h3', attr, text);
  },

  p: function(attr, text) {
    this.tag('p', attr, text);
  },

  ul: function(list, attr, fn) {
    if (typeof attr == 'function') {
      fn = attr;
      attr = {};
    }
    this.tag('ul', attr, function(dom){
      list.forEach(function(item){
        dom.out.push('
');
        dom.text(fn ? fn(item) : item);
        dom.out.push('
\n');
      });
    });
  }

};


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-comp-4064',
  templateUrl: './comp-4064.component.html',
  styleUrls: ['./comp-4064.component.css']
})
export class Comp4064Component implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}