text:
var noop = function () {};

var zjquery = (function () {

var elems = {};
var exports = {};

function new_elem(selector) {
    var value;
    var shown = false;
    var focused = false;

    var self = {
        val: function () {
            if (arguments.length === 0) {
                return value || '';
            }
            value = arguments[0];
        },
        css: noop,
        data: noop,
        empty: noop,
        height: noop,
        removeAttr: noop,
        removeData: noop,
        trigger: noop,
        blur: function () {
            focused = false;
        },
        focus: function () {
            focused = true;
        },
        show: function () {
            shown = true;
        },
        hide: function () {
            shown = false;
        },
        addClass: function (class_name) {
            assert.equal(class_name, 'active');
            shown = true;
        },
        removeClass: function (class_name) {
            if (class_name === 'status_classes') {
                return self;
            }
            assert.equal(class_name, 'active');
            shown = false;
        },
        debug: function () {
            return {
                value: value,
                shown: shown,
                selector: selector,
            };
        },
        visible: function () {
            return shown;
        },
        is_focused: function () {
            // is_focused is not a jQuery thing; this is
            // for our testing
            return focused;
        },
    };
    return self;
}

function jquery_array(elem) {
    var result = [elem];

    for (var attr in elem) {
        if (Object.prototype.hasOwnProperty.call(elem, attr)) {
            result[attr] = elem[attr];
        }
    }

    return result;
}

exports.zjquery = function (arg) {
    if (typeof arg === "function") {
        // If somebody is passing us a function, we emulate
        // jQuery's behavior of running this function after
        // page load time.  But there are no pages to load,
        // so we just call it right away.
        arg();
        return;
    }

    var selector = arg;
    if (elems[selector] === undefined) {
        var elem = new_elem(selector);
        elems[selector] = elem;
    }
    return jquery_array(elems[selector]);
};

exports.zjquery.trim = function (s) { return s; };

exports.zjquery.state = function () {
    // useful for debugging
    var res =  _.map(elems, function (v) {
        return v.debug();
    });

    res = _.map(res, function (v) {
        return [v.selector, v.value, v.shown];
    });

    res.sort();

    return res;
};

exports.zjquery.Event = noop;

return exports;
}());
module.exports = zjquery;


text:
package eval

import (
	"context"
	"reflect"
	"regexp"

	"github.com/google/gapid/core/event"
	"github.com/google/gapid/core/log"
	"github.com/google/gapid/test/robot/search"
)

type eval func(context.Context, interface{}) interface{}

var (
	boolType     = reflect.TypeOf(true)
	signedType   = reflect.TypeOf(int64(0))
	unsignedType = reflect.TypeOf(uint64(0))
	doubleType   = reflect.TypeOf(float64(0))
	stringType   = reflect.TypeOf("")
)

// Compile takes a search query and a a value type and produces a function that will perform the
// query against values of that type.
func Compile(ctx context.Context, query *search.Query, klass reflect.Type) (event.Predicate, error) {
	m, res, err := compileExpression(ctx, query.Expression, klass)
	if res.Kind() != reflect.Bool {
		return nil, log.Err(ctx, nil, "Expression result not a bool")
	}
	return func(ctx context.Context, value interface{}) bool {
		got := reflect.TypeOf(value)
		if got != klass {
			return false
		}
		return m(ctx, value).(bool)
	}, err
}

// Filter uses a search query and returns a handler that filters events before passing them to
// the output handler.
func Filter(ctx context.Context, query *search.Query, klass reflect.Type, handler event.Handler) event.Handler {
	pred, err := Compile(ctx, query, klass)
	if err != nil {
		return func(ctx context.Context, event interface{}) error {
			return err
		}
	}
	return event.Filter(ctx, pred, handler)
}

func compileExpression(ctx context.Context, expr *search.Expression, t reflect.Type) (eval, reflect.Type, error) {
	if expr == nil {
		return func(context.Context, interface{}) interface{} { return true }, boolType, nil
	}
	switch et := expr.Is.(type) {
	case nil:
		return func(context.Context, interface{}) interface{} { return true }, boolType, nil
	case *search.Expression_Boolean:
		return func(context.Context, interface{}) interface{} { return et.Boolean }, boolType, nil
	case *search.Expression_String_:
		return func(context.Context, interface{}) interface{} { return et.String_ }, stringType, nil
	case *search.Expression_Signed:
		return func(context.Context, interface{}) interface{} { return et.Signed }, signedType, nil
	case *search.Expression_Unsigned:
		return func(context.Context, interface{}) interface{} { return et.Unsigned }, unsignedType, nil
	case *search.Expression_Double:
		return func(context.Context, interface{}) interface{} { return et.Double }, doubleType, nil
	case *search.Expression_Name:
		return compileGetMember(ctx, et.Name, t)
	case *search.Expression_And:
		return compileBinaryBool(ctx, et.And, t, func(lhs, rhs bool) bool { return lhs && rhs })
	case *search.Expression_Or:
		return compileBinaryBool(ctx, et.Or, t, func(lhs, rhs bool) bool { return lhs || rhs })
	case *search.Expression_Equal:
		return compileEqual(ctx, et.Equal, t)
	case *search.Expression_Greater:
		return compileBinaryNumeric(ctx, et.Greater, t,
			func(lhs, rhs int64) bool { return lhs > rhs },
			func(lhs, rhs uint64) bool { return lhs > rhs },
			func(lhs, rhs float64) bool { return lhs > rhs },
		)
	case *search.Expression_GreaterOrEqual:
		return compileBinaryNumeric(ctx, et.GreaterOrEqual, t,
			func(lhs, rhs int64) bool { return lhs >= rhs },
			func(lhs, rhs uint64) bool { return lhs >= rhs },
			func(lhs, rhs float64) bool { return lhs >= rhs },
		)
	case *search.Expression_Subscript:
		return compileSubscript(ctx, et.Subscript, t)
	case *search.Expression_Regex:
		return compileRegex(ctx, et.Regex, t)
	case *search.Expression_Member:
		return compileMember(ctx, et.Member, t)
	case *search.Expression_Not:
		return compileNot(ctx, et.Not, t)
	default:
		return nil, boolType, log.Errf(ctx, nil, "Invalid expression %v", et)
	}
}

func compileBinaryBool(ctx context.Context, expr *search.Binary, t reflect.Type, test func(bool, bool) bool) (eval, reflect.Type, error) {
	lhs, res, err := compileExpression(ctx, expr.Lhs, t)
	if err != nil {
		return nil, boolType, err
	}
	if res.Kind() != reflect.Bool {
		return nil, boolType, log.Err(ctx, nil, "lhs was not bool")
	}
	rhs, res, err := compileExpression(ctx, expr.Rhs, t)
	if err != nil {
		return nil, boolType, err
	}
	if res.Kind() != reflect.Bool {
		return nil, boolType, log.Err(ctx, nil, "rhs was not bool")
	}
	return func(ctx context.Context, value interface{}) interface{} {
		return test(lhs(ctx, value).(bool), rhs(ctx, value).(bool))
	}, boolType, nil
}

func compileEqual(ctx context.Context, expr *search.Binary, t reflect.Type) (eval, reflect.Type, error) {
	lhs, lt, err := compileExpression(ctx, expr.Lhs, t)
	if err != nil {
		return nil, boolType, err
	}
	rhs, rt, err := compileExpression(ctx, expr.Rhs, t)
	if err != nil {
		return nil, boolType, err
	}
	if lt != rt {
		return nil, boolType, log.Err(ctx, nil, "Types to equal do not match")
	}
	return func(ctx context.Context, value interface{}) interface{} {
		return reflect.DeepEqual(lhs(ctx, value), rhs(ctx, value))
	}, boolType, nil
}

func compileBinaryNumeric(ctx context.Context, expr *search.Binary, t reflect.Type,
	testS func(int64, int64) bool,
	testU func(uint64, uint64) bool,
	testD func(float64, float64) bool,
) (eval, reflect.Type, error) {
	lhs, lt, err := compileExpression(ctx, expr.Lhs, t)
	if err != nil {
		return nil, boolType, err
	}
	rhs, rt, err := compileExpression(ctx, expr.Rhs, t)
	if err != nil {
		return nil, boolType, err
	}
	if lt.AssignableTo(signedType) && rt.AssignableTo(signedType) {
		return func(ctx context.Context, value interface{}) interface{} {
			return testS(lhs(ctx, value).(int64), rhs(ctx, value).(int64))
		}, boolType, nil
	}
	if lt.AssignableTo(unsignedType) && rt.AssignableTo(unsignedType) {
		return func(ctx context.Context, value interface{}) interface{} {
			return testU(lhs(ctx, value).(uint64), rhs(ctx, value).(uint64))
		}, boolType, nil
	}
	if lt.AssignableTo(doubleType) && rt.AssignableTo(doubleType) {
		return func(ctx context.Context, value interface{}) interface{} {
			return testD(lhs(ctx, value).(float64), rhs(ctx, value).(float64))
		}, boolType, nil
	}
	return nil, boolType, log.Err(ctx, nil, "no numeric comparison possible")
}

func compileNot(ctx context.Context, expr *search.Expression, t reflect.Type) (eval, reflect.Type, error) {
	rhs, res, err := compileExpression(ctx, expr, t)
	if err != nil {
		return nil, boolType, err
	}
	if res.Kind() != reflect.Bool {
		return nil, boolType, log.Err(ctx, nil, "Not only applies to bool")
	}
	return func(ctx context.Context, value interface{}) interface{} {
		return !rhs(ctx, value).(bool)
	}, boolType, nil
}

func compileSubscript(ctx context.Context, expr *search.Subscript, t reflect.Type) (eval, reflect.Type, error) {
	container, ct, err := compileExpression(ctx, expr.Container, t)
	if err != nil {
		return nil, boolType, err
	}
	key, kt, err := compileExpression(ctx, expr.Key, t)
	if err != nil {
		return nil, boolType, err
	}
	vt := ct.Elem()
	switch ct.Kind() {
	case reflect.Slice:
		if !kt.AssignableTo(signedType) {
			return nil, boolType, log.Err(ctx, nil, "Slices must be indexed by int64")
		}
		zeroValue := reflect.Zero(vt).Interface()
		return func(ctx context.Context, value interface{}) interface{} {
			cv := reflect.ValueOf(container(ctx, value))
			index := (int)(key(ctx, value).(int64))
			if index >= cv.Len() {
				return zeroValue
			}
			return cv.Index(index).Interface()
		}, vt, nil
	case reflect.Map:
		if !kt.AssignableTo(ct.Key()) {
			return nil, boolType, log.Err(ctx, nil, "Map index type does not match")
		}
		return func(ctx context.Context, value interface{}) interface{} {
			return reflect.ValueOf(container(ctx, value)).MapIndex(reflect.ValueOf(key(ctx, value))).Interface()
		}, vt, nil
	default:
		return nil, boolType, log.Err(ctx, nil, "Can only subscript map or slice")
	}
}

func compileRegex(ctx context.Context, expr *search.Regex, t reflect.Type) (eval, reflect.Type, error) {
	val, vt, err := compileExpression(ctx, expr.Value, t)
	if err != nil {
		return nil, boolType, err
	}
	if vt.Kind() != reflect.String {
		return nil, boolType, log.Err(ctx, nil, "Regex only applies to string")
	}
	re, err := regexp.Compile(expr.Pattern)
	if err != nil {
		return nil, boolType, err
	}
	return func(ctx context.Context, value interface{}) interface{} {
		return re.MatchString(val(ctx, value).(string))
	}, boolType, nil
}

func compileMember(ctx context.Context, expr *search.Member, t reflect.Type) (eval, reflect.Type, error) {
	obj, ot, err := compileExpression(ctx, expr.Object, t)
	if err != nil {
		return nil, boolType, err
	}
	get, mt, err := compileGetMember(ctx, expr.Name, ot)
	if err != nil {
		return nil, boolType, err
	}
	return func(ctx context.Context, value interface{}) interface{} {
		return get(ctx, obj(ctx, value))
	}, mt, nil
}

func compileGetMember(ctx context.Context, name string, t reflect.Type) (eval, reflect.Type, error) {
	wasPtr := t.Kind() == reflect.Ptr
	if wasPtr {
		t = t.Elem()
	}
	if t.Kind() != reflect.Struct {
		return nil, boolType, log.Err(ctx, nil, "Field access on non struct type"+t.String())
	}
	field, found := t.FieldByName(name)
	if !found {
		return nil, boolType, log.Err(ctx, nil, "Invalid field name "+name)
	}
	if wasPtr {
		return func(ctx context.Context, value interface{}) interface{} {
			return reflect.ValueOf(value).Elem().FieldByIndex(field.Index).Interface()
		}, field.Type, nil
	}
	return func(ctx context.Context, value interface{}) interface{} {
		return reflect.ValueOf(value).FieldByIndex(field.Index).Interface()
	}, field.Type, nil
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>org.apache.tools.ant.listener (Apache Ant API)</title>
<meta name="date" content="2012-05-22">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.apache.tools.ant.listener

Class Summary

Class
Description

AnsiColorLogger

Uses ANSI Color Code Sequences to colorize messages
 sent to the console.

BigProjectLogger

This is a special logger that is designed to make it easier to work
 with big projects, those that use imports and
 subant to build complex systems.

CommonsLoggingListener

Jakarta Commons Logging listener.

Log4jListener

Listener which sends events to Log4j logging system

MailLogger

Buffers log messages from DefaultLogger, and sends an e-mail with the
  results.

ProfileLogger

This is a special logger that is designed to profile builds.

SimpleBigProjectLogger

Displays subproject names like BigProjectLogger
 but is otherwise as quiet as NoBannerLogger.

TimestampedLogger

Like a normal logger, except with timed outputs

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
*Non-trivial pull requests should include an entry below. Entries must be suitable for inclusion in public-facing materials such as release notes and blog posts. Keep them short, sweet, and in the past tense. New entries go on top. When merging to deploy, add the version number and date.*

## Unreleased

## v3.3.0

* Removed scribing

## v3.2.0

* Moved build to Java 8
* Narrowed support-v4 dependency to support-compat and support-core-ui

## v3.1.1

* Modified TweetTimelineRecyclerViewAdapter to allow user to override the ViewHolder

## v3.1.0

* Added support for RecyclerView
* Linkified profile image and entities (hashtags, user mentions, and symbols)

## v3.0.0

* Fixed crash when liking a quote Tweet
* Fixed crash with multi-touch gestures in ViewPager

## v2.3.2

* Added ability to set geocode for SearchTimeline builder.
* Videos less than 6.5 seconds now loop.
* Fixed issue where quote Tweets with media showed both media and quote Tweet. Only media should be shown if both are included.

## v2.3.1

* Improved RTL mirroring for Tweet views.
* Dates are now properly localized for non-English locales.

## v2.3.0

* Added support for timeline filtering.

## v2.2.0

* Added support for quote Tweet display.

## v2.1.1

* Fixed UnsupportedOperationException when rendering multiple photos API 17 and below.

## v2.1.0

* Added multi-photo support for inline views and the fullscreen gallery view.
* Updated Twitter Core dependency to version 2.1.0.

## v2.0.1

* Removed pseudo locales from translations.

## v2.0.0

* Dropped support for API versions before API 14 (ICS).
* Updated Twitter Core dependency.
* Removed previously deprecated methods and classes.
* Added contentDescription for media based on altText field.

## v1.11.1

* Allow non-filtered search results for SearchTimeline

## v1.11.0

* Added support for Vine in Tweets

## v1.10.3

* Updated Twitter Core dependency

## v1.10.2

* Updated Fabric Base dependency

## v1.10.1

* Added HLS playback support. Removed WebM playback support.
* Added loading and buffering spinners to video player.
* Only show play button and media badge if playback is supported.

## v1.10.0

* Added click listeners on Tweet views for URL and media clicks.
* Fixed click listeners on Tweet text so multiple events are not generated.
* Fixed JavaDocs.

## v1.9.1

* Added gif or duration badge to media view.

## v1.9.0
* Added basic photo viewer.
* Added custom controls for video playback.
* Enabled looping for animated gifs.

## v1.8.0

* Added support for video and animated gif playback.

## v1.7.0

* Added heart animations on Android API 21+
* Changed favorite stars to "likes" hearts.

## v1.6.0

## v1.5.0

* Raised Min SDK version from 8 to 9.

## v1.4.1

## v1.4.0

* Added Tweet actions to Tweet views.
* Added TweetTimelineListAdapter Builder to support setting style and enabling actions
* Added FixedTweetTimeline for fixed sets of Tweets
* Deprecated TweetViewAdapter and TweetViewFetchAdapter. To upgrade:
    * If required, load Tweets by id with TweetUtils.loadTweets(List<Long> ids, Callback<List<Tweet>> cb)
    * Build a FixedTweetTimeline with the set of Tweets to display, pass the timeline to the
    TweetTimelineListAdapter and set the adapter on your ListView (consistent with other Timelines).

## v1.3.1

* (DH) Change TweetUtils loadTweet(s) to take a TwitterCore Callback. Deprecate those taking a LoadCallback.
* (DH) Change TweetViewFetchAdapter setTweetIds to take a TwitterCore Callback. Deprecate the method taking a LoadCallback.

## v1.3.0

* (EF) Updated TweetView so images display full width on API < 17
* (DH) Updated the CompactTweetView photo display to support a range of aspect ratios to reduce cropping. Made portrait oriented photos square cropped.
* (DH) Added TwitterListTimeline to support Timelines of Tweets from Twitter Lists.
* (DH) Fixed bug in SearchTimeline preventing some filter queries from being used.
* (DH) Removed cobalt performance-metrics dependency.
* (DH) Added result_type=filtered to SearchTimeline queries to use new backend search workflow.
* (DH) Improved TweetView display with reduced full name font weight on newer API versions.

## v1.2.0

* (DH) Added CollectionTimeline to show Tweets from a Twitter collection.
* (DH) Added 'refresh' support to the TimelineListAdapter
* (DH) Removed final from TimelineCursor class.
* (AP) Updated Picasso dependency version to 2.5.2, OkHttp required to be 2.0 or greater.

## v1.1.0

* (AP) (internal) Added timeline impression scribing.
* (DH) Added UserTimeline to show Tweets for a particular user.
* (DH) Added SearchTimeline to show Tweets that match a search query.
* (DH) Added TweetTimelineListAdapter for providing ListViews with a scrollable Timeline of Tweets.
* (AP) Added retweet display support to show the original Tweet with retweeted by attribution.

## v1.0.7

* (DH) Fixed TweetView MetricsManager IllegalArgumentException bug.
* (DH) (internal) Added a UserTimeline.

## v1.0.6

* (AP) Fixed strict mode violations on startup when using OkHttp
* (DH) Update performance-metrics to 0.2.0
* (DH) (internal) Added foundation for timelines with a TimelineListAdapter and SearchTimeline, an implementation of Timeline.
* (DH) Switched to using com.twitter.cobalt:performance-metrics for performance monitoring.

## v1.0.5
**Jan 30 2015**

* (DH) Changed package for AppSession used internally

## v1.0.4
**Jan 29 2015**

* (EF) Removed targetSdkVersion because it should not be specified on libraries.

## v1.0.3
**Dec 15 2014**

* (DH) Fixed TweetViewAdapter to set an empty Tweet list when null is passed to setTweets
* (TS) Added Consumer Proguard Config file to be bundled with AAR
* (DH) Stopped Share Tweet button from showing in all caps on API 21

## v1.0.2
**Nov 20 2014**
* (AP) Scribe SyndicatedSdkImpression type events on Tweet view impressions and permalink clicks
* (TS) Moved to Java 7
* (AP) Fixed scribing requests dropping User-Agent and X-Client-UUID headers
* (DH) Fixed exception in TweetViewAdapter.
* (DH) Started treating sessions with tokens known to be expired so new tokens are fetched upfront.
* (DH) Improved TweetView and CompactTweetView layout preview in IDEs to show an example Tweet.

## v1.0.1
**Oct 30 2014**

* (TY) Removed Apache 2.0 License from pom files.

## v1.0.0
**Oct 15 2014**

* (AP) Updated support library version 21.0.0
* (LTM) Removed allowBackup=true attribute from application element in AndroidManifest.xml.
* (YH) Changed the loading of Active Session from TweetCore to be in background.
* (AP) Configured to scribe to talk to https://syndication.twitter.com/i/jot/sdk
* (AP) Added required ScribeConfig arguments for scribe path components
* (LTM) Fixed scribe bug where events were not sent to the backend whenever TweetUi was using a user session for making API calls.
* (LTM) Introduced AppSession for holding app tokens. TwitterSession now holds only user tokens.
* (LTM) Switched to using new SessionManager that manages the app sessions. Updated TwitterApiClient to accept Session instead of TwitterSession.
* (DH) Disabled setting Tweet fields in Tweet views rendered in edit mode (e.g. for IDE layout preview)
* (DH) Disabled the Tweet view and logged the error when views are created, but the TweetUi kit hasn't been started in Fabric.with()
* (DH) Added debug logging for single Tweet load failures, error logging for kit or auth related errors.
* (LTM) Configured scribe using analytics settings, which is used by crashlytics for configuring Answers. This is temporary until we have can get our scribe settings from the backend. If analytics settings are not available, fallback to defaults.
* (AP) Added SyndicationScribeEvent for product metrics
* (AP) Added many languages for localization
* (AP) Updated ScribeFilesSender to send device id header
* (DH) Fixed bug in BaseTweetView.setTweet in which tapping a Tweet took the user to the previous Tweet
* (DH) Removed TweetView and CompactTweetView OnTwitterExceptionListener (breaking change)
* (AP) Updated ScribeConfig with configurable User-Agent
* (DH) Added loadTweet and loadTweets to handle guest auth and request queueing
* (DH) Added TweetViewFetcherAdapter.setTweetIds that accepts a LoadCallback
* (DH) Made TweetViewFetchAdapter returns Tweets in requested order, no longer optional (breaking change)
* (DH) Removed TweetViewFetchAdapter's setOnTwitterExceptionListener (breaking change)
* (AP) Improved accessibility for users of TalkBack
* (LTM) Updated Twitter API Tweet model to be immutable model.
* (LTM) Updated Twitter API User model to be immutable model.
* (LTM) Updated Twitter API entity models to be immutable models.
* (DH) Removed TweetView and CompactTweetView setOnTwitterExceptionListener and loadTweet (breaking change)
* (DH) Removed TweetView and CompactTweetView constructors which accepted Tweet ids (breaking change)
* (DH) Changed Share Tweet button margin slightly

## v0.9.0

* (AP) Fixed html entities in Tweets passed in via StatusesService
* (DH) Renamed TweetView and CompactTweetView style attributes to allow creating custom styles and themes
* (AP) Added color calculations for secondary colored visual elements
* (DH) Added photo to CompactTweetView with 16:9 aspect ratio and center cropped
* (DH) Removed XML "tw__preload_(name, screen_name, text, timestamp)" attributes from Tweet views (breaking change)

## v0.8.0
** Sep 15 2014**

* (TS) Added fluent API builder to Fabric Class and cleaned up Fabric API
* (DH) Renamed twittersocial to tweetui
* (LTM) Renamed twittercore to core
* (TS) Renamed Foundation to Fabric
* (DH) Added "tw__" prefix to TweetView and CompactTweetView XML attributes (breaking change)
* (LTM) Updated SessionManager to support multiple sessions. This is a breaking API change.

## v0.7.0
** Sep 4 2014**

* (DH) Fix TweetViewFetchAdapter out-of-order Tweets problem
* (AP) Added Share Tweet button to TweetViews
* (DH) Added U-specific avatar, media default, and error drawables.
* (DH) Added TweetView and CompactTweetView constructors taking a style to be applied to the view.
* (DH) Added R.style.tw__TweetLightStyle and R.style.tw__TweetDarkStyle styles which may be used or subclassed.
* (DH) Allowed style to be set by the standard XML 'style' attribute (e.g. style="@style/tw__TweetLightStyle")

## v0.6.0
**Aug 18 2014**

* (DH) Clear session when guest/app token expires
* (LTM) Reset version from 1.0.4 to 0.1.0
* (TS) Replaced Kit#getName with Kit#getIdentifier, fixed issue where kit names could be reported incorrectly after proguarding.
* (DH) Make the super class of TweetView and CompactTweetView, BaseTweetView, public
* (DH) Updated Tweet timestamps to show relative time format
* (DH) Removed share button and share listener (breaking change)
* (DH) Made TweetView and CompactTweetView design redline adjustments and cleaned up styles
* (AP) Added basic scribing with no de-duplication effort.
* (AP) Removed theme interface (breaking change)
* (AP) Added error listener to more explicit OnTwitterExceptionListener
* (AP) Added requirement to call AbstractTweetView.loadTweet to fetch tweet from the Twitter api for tweets constructed with an id (breaking change)
* (AP) Removed success listener from tweet view (breaking change)
* (AP) Fixed tweet entity indices in presence of html chars and emoji
* (DH) Changed TweetViewAdapter constructor to accept Tweets (breaking change, no longer accepts Builders).
* (DH) TweetViewFetchAdapter constructed by tweetIds and performs multiget statuses/lookup.
* (DH) Changed TweetView and CompactTweetView constructors to accept Tweet id or Tweet, Builder removed (breaking change).
* (TS) Replaced API stack with new Twittercore API
* (TS) Added Picasso for image loading

## v0.5.0
**July 24 2014**

* (DH) Added TweetViewAdapter to support AdapterViews such as ListView
* (AP) Added setOnShareListener to TweetViewBuilder interface
* (AP) Added share action to compact and normal tweets
* (DH) Removed Tweet reply, retweet, and favorite actions and ComposerActivity
* (AP) Added onSuccess and onError callbacks to TweetView that can be assigned in the builder

## v0.4.0
**June 26 2014**

* (DH) Each TweetView class provides a Builder. Builder constructors now require a tweetId (breaking change). Removed method createCompact.
* (DH) Add support for setting preloaded data via XML.
* (DH) Improved Tweet compose transition animation, button disabling, remaining character warning.
* (AP) Added support for viewing tweets while logged-out
* (AP) Split TwitterSocial.setAuth into setAuthConfig and setAuthToken (breaking change)

## v0.3.0
**June 3 2014**

* (AP) Added support for setting preloaded data, equivalent to data in oembed.
* (AP) Updated TweetView's default click event to launch permalink.
* (DH) Implemented tweet reply action button.
* (AP) Added best effort error recovering and error parsing.
* (LTM) Removed twitter auth permission since it was never explicitly required by twittersocial. twitteridentity removed this permission some time ago since it is no longer required for Twitter Single Sign On.
* (TS) Migrated app onboarding code from crashlytics to foundation.
* (IC) Added support for tracking rate limiting.
* (AP) Added support for character counting when composing a tweet.
* (DH) Implemented retweet/undo retweet action button.

## v0.2.0
**May 20 2014**

* (DH) Fixed tweet view inconsistencies.
* (LTM) Changed how version information is generated.
* (DH) Implemented favorite/unfavorite tweet action button.
* (TS) Renamed Module to Kit.
* (AP) Improved startup time by initializing syndication db connection asynchronously.

## v0.1.0
**April 28 2014**

* Initial version


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    {% block title %}<title>Debate It</title>{% endblock %}
    {% load staticfiles %}
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <link href="https://fonts.googleapis.com/css?family=Syncopate" type="text/css">

    <link rel="stylesheet"  href="{% static 'debate/css/style.css' %}"/>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#topNavBar">

                </button>
                {% if user.is_authenticated %}

                {% else %}

                {% endif %}

                {% if user.is_authenticated %}

                            {% csrf_token %}
                            <input type="text" class="form-control" id="search" name="search" value=""/>

                                <button type="submit" class="btn">

 </button>

                              My Profile

                              Featured Debates

                              Create Debate

                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Modal title

One fine body…

                                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                        <button type="button" class="btn btn-primary">Save changes</button>

                              Log Out

                {% else %}

                              Log In

                              Register

                {% endif %}

{#    #}
{% block body %}
{% endblock %}


text:
class CreateIdentities < ActiveRecord::Migration
  def change
    create_table :identities do |t|
      t.string :name
      t.string :email
      t.string :password_digest

      t.timestamps
    end
  end
end


text:
#include "include/private/SkSLIRNode.h"
#include "include/private/SkSLStatement.h"
#include "src/sksl/SkSLAnalysis.h"
#include "src/sksl/ir/SkSLBlock.h"
#include "src/sksl/ir/SkSLForStatement.h"
#include "src/sksl/ir/SkSLSwitchStatement.h"

#include <memory>
#include <utility>
#include <vector>

namespace SkSL {

class SymbolTable;

namespace Analysis {

SymbolTableStackBuilder::SymbolTableStackBuilder(const Statement* stmt,
                                                 std::vector<std::shared_ptr<SymbolTable>>* stack) {
    if (stmt) {
        switch (stmt->kind()) {
            case Statement::Kind::kBlock:
                if (std::shared_ptr<SymbolTable> symbols = stmt->as<Block>().symbolTable()) {
                    stack->push_back(std::move(symbols));
                    fStackToPop = stack;
                }
                break;

            case Statement::Kind::kFor:
                if (std::shared_ptr<SymbolTable> symbols = stmt->as<ForStatement>().symbols()) {
                    stack->push_back(std::move(symbols));
                    fStackToPop = stack;
                }
                break;

            case Statement::Kind::kSwitch:
                if (std::shared_ptr<SymbolTable> symbols = stmt->as<SwitchStatement>().symbols()) {
                    stack->push_back(std::move(symbols));
                    fStackToPop = stack;
                }
                break;

            default:
                break;
        }
    }
}

SymbolTableStackBuilder::~SymbolTableStackBuilder() {
    if (fStackToPop) {
        fStackToPop->pop_back();
    }
}

}  // namespace Analysis
}  // namespace SkSL


text:
MarkerManager v3
================

## Description

Marker manager is an interface between the map and the user, designed to manage adding and removing many points when the viewport changes.

###How it Works:

The MarkerManager places its markers onto a grid, similar to the map tiles. When the user moves the viewport, it computes which grid cells have entered or left the viewport, and shows or hides all the markers in those cells. (If the users scrolls the viewport beyond the markers that are loaded, no markers will be visible until the EVENT_moveend triggers an update.) In practical consequences, this allows 10,000 markers to be distributed over a large area, and as long as only 100-200 are visible in any given viewport, the user will see good performance corresponding to the 100 visible markers, rather than poor performance corresponding to the total 10,000 markers. Note that some code is optimized for speed over space, with the goal of accommodating thousands of markers.

[Read more][more]

## Support

This library is community supported. We're comfortable enough with the stability and features of
the library that we want you to build real production applications on it.

If you find a bug, or have a feature suggestion, please [log an issue][issues]. If you'd like to
contribute, please read [How to Contribute][contrib].

[issues]: https://github.com/googlemaps/v3-utility-library/issues
[contrib]: https://github.com/googlemaps/v3-utility-library/blob/master/markermanager/CONTRIB.md
[more]: http://htmlpreview.github.io/?https://github.com/googlemaps/v3-utility-library/blob/master/markermanager/docs/reference.html


text:
// Specifically test buffer module regression.
import { Buffer as ImportedBuffer, SlowBuffer as ImportedSlowBuffer, transcode, TranscodeEncoding } from "buffer";

const utf8Buffer = new Buffer('test');
const base64Buffer = new Buffer('', 'base64');
const octets: Uint8Array = new Uint8Array(123);
const octetBuffer = new Buffer(octets);
const sharedBuffer = new Buffer(octets.buffer);
const copiedBuffer = new Buffer(utf8Buffer);
console.log(Buffer.isBuffer(octetBuffer));
console.log(Buffer.isEncoding('utf8'));
console.log(Buffer.byteLength('xyz123'));
console.log(Buffer.byteLength('xyz123', 'ascii'));
const result1 = Buffer.concat([utf8Buffer, base64Buffer] as ReadonlyArray<Uint8Array>);
const result2 = Buffer.concat([utf8Buffer, base64Buffer] as ReadonlyArray<Uint8Array>, 9999999);

// Class Methods: Buffer.swap16(), Buffer.swa32(), Buffer.swap64()
{
    const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
    buf.swap16();
    buf.swap32();
    buf.swap64();
}

// Class Method: Buffer.from(data)
{
    // Array
    const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72] as ReadonlyArray<number>);
    // Buffer
    const buf2: Buffer = Buffer.from(buf1);
    // String
    const buf3: Buffer = Buffer.from('this is a tést');
    // ArrayBuffer
    const arrUint16: Uint16Array = new Uint16Array(2);
    arrUint16[0] = 5000;
    arrUint16[1] = 4000;
    const buf4: Buffer = Buffer.from(arrUint16.buffer);
    const arrUint8: Uint8Array = new Uint8Array(2);
    const buf5: Buffer = Buffer.from(arrUint8);
    const buf6: Buffer = Buffer.from(buf1);
    const sb: SharedArrayBuffer = {} as any;
    const buf7: Buffer = Buffer.from(sb);
}

// Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
{
    const arr: Uint16Array = new Uint16Array(2);
    arr[0] = 5000;
    arr[1] = 4000;

    let buf: Buffer;
    buf = Buffer.from(arr.buffer, 1);
    buf = Buffer.from(arr.buffer, 0, 1);
}

// Class Method: Buffer.from(str[, encoding])
{
    const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex');
}

// Class Method: Buffer.alloc(size[, fill[, encoding]])
{
    const buf1: Buffer = Buffer.alloc(5);
    const buf2: Buffer = Buffer.alloc(5, 'a');
    const buf3: Buffer = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
}
// Class Method: Buffer.allocUnsafe(size)
{
    const buf: Buffer = Buffer.allocUnsafe(5);
}
// Class Method: Buffer.allocUnsafeSlow(size)
{
    const buf: Buffer = Buffer.allocUnsafeSlow(10);
}

// Class Method byteLenght
{
    let len: number;
    len = Buffer.byteLength("foo");
    len = Buffer.byteLength("foo", "utf8");

    const b = Buffer.from("bar");
    len = Buffer.byteLength(b);
    len = Buffer.byteLength(b, "utf16le");

    const ab = new ArrayBuffer(15);
    len = Buffer.byteLength(ab);
    len = Buffer.byteLength(ab, "ascii");

    const dv = new DataView(ab);
    len = Buffer.byteLength(dv);
    len = Buffer.byteLength(dv, "utf16le");
}

// Class Method poolSize
{
    let s: number;
    s = Buffer.poolSize;
    Buffer.poolSize = 4096;
}

// Test that TS 1.6 works with the 'as Buffer' annotation
// on isBuffer.
let a: Buffer | number;
a = new Buffer(10);
if (Buffer.isBuffer(a)) {
    a.writeUInt8(3, 4);
}

// write* methods return offsets.
const b = new Buffer(16);
let result: number = b.writeUInt32LE(0, 0);
result = b.writeUInt16LE(0, 4);
result = b.writeUInt8(0, 6);
result = b.writeInt8(0, 7);
result = b.writeDoubleLE(0, 8);
result = b.write('asd');
result = b.write('asd', 'hex');
result = b.write('asd', 123, 'hex');
result = b.write('asd', 123, 123, 'hex');

// fill returns the input buffer.
b.fill('a').fill('b');

{
    const buffer = new Buffer('123');
    let index: number;
    index = buffer.indexOf("23");
    index = buffer.indexOf("23", 1);
    index = buffer.indexOf("23", 1, "utf8");
    index = buffer.indexOf(23);
    index = buffer.indexOf(buffer);
}

{
    const buffer = new Buffer('123');
    let index: number;
    index = buffer.lastIndexOf("23");
    index = buffer.lastIndexOf("23", 1);
    index = buffer.lastIndexOf("23", 1, "utf8");
    index = buffer.lastIndexOf(23);
    index = buffer.lastIndexOf(buffer);
}

{
    const buffer = new Buffer('123');
    const val: [number, number] = [1, 1];

    /* comment out for --target es5
    for (let entry of buffer.entries()) {
        val = entry;
    }
        */
}

{
    const buffer = new Buffer('123');
    let includes: boolean;
    includes = buffer.includes("23");
    includes = buffer.includes("23", 1);
    includes = buffer.includes("23", 1, "utf8");
    includes = buffer.includes(23);
    includes = buffer.includes(23, 1);
    includes = buffer.includes(23, 1, "utf8");
    includes = buffer.includes(buffer);
    includes = buffer.includes(buffer, 1);
    includes = buffer.includes(buffer, 1, "utf8");
}

{
    const buffer = new Buffer('123');
    const val = 1;

    /* comment out for --target es5
    for (let key of buffer.keys()) {
        val = key;
    }
        */
}

{
    const buffer = new Buffer('123');
    const val = 1;

    /* comment out for --target es5
    for (let value of buffer.values()) {
        val = value;
    }
        */
}

// Imported Buffer from buffer module works properly
{
    const b = new ImportedBuffer('123');
    b.writeUInt8(0, 6);
    const sb = new ImportedSlowBuffer(43);
    b.writeUInt8(0, 6);
}

// Buffer has Uint8Array's buffer field (an ArrayBuffer).
{
    const buffer = new Buffer('123');
    const octets = new Uint8Array(buffer.buffer);
}

// Inherited from Uint8Array but return buffer
{
    const b = Buffer.from('asd');
    let res: Buffer = b.reverse();
    res = b.subarray(1);
}

// Buffer module, transcode function
{
    transcode(Buffer.from('€'), 'utf8', 'ascii'); // $ExpectType Buffer

    const source: TranscodeEncoding = 'utf8';
    const target: TranscodeEncoding = 'ascii';
    transcode(Buffer.from('€'), source, target); // $ExpectType Buffer
}


text:
import {createElementWithAttributes, removeChildren} from '#core/dom';

import {Services} from '#service';

import {listen} from '#utils/event-helper';
import {user} from '#utils/log';

import {parseUrlDeprecated} from 'src/url';

import {
  AUTHORIZATION_TIMEOUT,
  CONFIG_BASE_PATH,
  CONFIG_PATH_PARAMS,
  DEFAULT_MESSAGES,
  TAG,
  TAG_SHORTHAND,
} from './fewcents-constants';

import {CSS} from '../../../build/amp-access-fewcents-0.1.css';
import {installStylesForDoc} from '../../../src/style-installer';

/**
 * @implements {../../amp-access/0.1/access-vendor.AccessVendor}
 */
export class AmpAccessFewcents {
  /**
   * @constructor
   * @param {!../../amp-access/0.1/amp-access.AccessService} accessService
   * @param {!../../amp-access/0.1/amp-access-source.AccessSource} accessSource
   */
  constructor(accessService, accessSource) {
    /** @const */
    this.ampdoc = accessService.ampdoc;

    /** @const @private {!../../amp-access/0.1/amp-access-source.AccessSource} */
    this.accessSource_ = accessSource;

    /** @private {?Node} */
    this.innerContainer_ = null;

    /** @private {?Node} Main container where paywall will be rendered */
    this.dialogContainer_ = null;

    /** @const @private {JsonObject}  Stores the config passed by the publisher */
    this.fewcentsConfig_ = this.accessSource_.getAdapterConfig();

    /** @private {string} Authorize endpoint to get paywall data*/
    this.authorizeUrl_ = this.prepareAuthorizeUrl_();

    /** @private {!JsonObject} */
    this.i18n_ = {...DEFAULT_MESSAGES};

    /** @private {string} */
    this.fewCentsBidId_ = null;

    /** @const @private {!../../../src/service/xhr-impl.Xhr} */
    this.xhr_ = Services.xhrFor(this.ampdoc.win);

    /** @const @private {!../../../src/service/timer-impl.Timer} */
    this.timer_ = Services.timerFor(this.ampdoc.win);

    /** @const @private {!../../../src/service/vsync-impl.Vsync} */
    this.vsync_ = Services.vsyncFor(this.ampdoc.win);

    /** @private {JsonObject} */
    this.purchaseOptions_ = null;

    /** @private {string} */
    this.loginDialogUrl_ = null;

    installStylesForDoc(this.ampdoc, CSS, () => {}, false, TAG);
  }

  /**
   * Decides whether to show the paywall or not
   * @return {!Promise<!JsonObject>}
   */
  authorize() {
    return this.getPaywallData_()
      .then(
        (response) => {
          // removing the paywall if shown and showing the content
          this.emptyContainer_();
          return {
            access: response.data.access,
            data: JSON.stringify(response),
          };
        },
        (err) => {
          // showing the paywall
          if (!err || !err.response) {
            throw err;
          }

          const {response} = err;
          // showing paywall when error code is 402 i.e payment required
          if (response.status !== 402) {
            throw err;
          }

          // rendering the paywall
          return response
            .json()
            .catch(() => {
              throw err;
            })
            .then((responseJson) => {
              this.parseAuthorizeResponse_(responseJson);
              this.emptyContainer_().then(
                this.renderPurchaseOverlay_.bind(this)
              );
              return {access: false, data: JSON.stringify(responseJson)};
            });
        }
      )
      .catch(() => {
        // showing the content when authorize endpoint fails
        this.emptyContainer_();
        return {access: true};
      });
  }

  /**
   * Add request parameters for the authorize endpoint
   * @return {string}
   * @private
   */
  prepareAuthorizeUrl_() {
    const accessKey = this.fewcentsConfig_['accessKey'];
    const articleIdentifier = this.fewcentsConfig_['articleIdentifier'];
    const category = this.fewcentsConfig_['category'];

    const {hostname} = parseUrlDeprecated();
    const basePath = this.getConfigBasePath_() + CONFIG_PATH_PARAMS;

    const url =
      basePath +
      '&accessKey=' +
      encodeURIComponent(accessKey) +
      '&category=' +
      encodeURIComponent(category) +
      '&articleIdentifier=' +
      encodeURIComponent(articleIdentifier) +
      '&domain=' +
      encodeURIComponent(hostname);

    return url;
  }

  /**
   * Returns the base path for authorize endpoint
   * @private
   * @return {string}
   */
  getConfigBasePath_() {
    const env = this.fewcentsConfig_['environment'];
    if (env === 'development') {
      return CONFIG_BASE_PATH.development;
    } else if (env === 'demo') {
      return CONFIG_BASE_PATH.demo;
    } else {
      return CONFIG_BASE_PATH.production;
    }
  }

  /**
   * Parse the response from authorize endpoint
   * @param {json} response
   * @private
   */
  parseAuthorizeResponse_(response) {
    const purchaseOptionsList = response?.data?.purchaseOptions;
    this.purchaseOptions_ = purchaseOptionsList?.[0];
    this.loginDialogUrl_ = response?.data?.loginUrl;
    const fewCentsBidId = response?.data?.bidId;

    // Setting the fewcentsBidId for re-authorize
    if (fewCentsBidId) {
      this.fewCentsBidId_ = fewCentsBidId;
    }
  }

  /**
   * Get paywall data by calling authorize endpoint
   * @return {!Promise<Object>}
   * @private
   */
  getPaywallData_() {
    let authorizeUrl = this.authorizeUrl_;

    // appending bidId in the authorize url during re-authorize
    if (this.fewCentsBidId_) {
      authorizeUrl = authorizeUrl + '&bidId=' + this.fewCentsBidId_;
    }

    // replacing variable READER_Id, CANONICAL_URL in the authorize url
    const urlPromise = this.accessSource_.buildUrl(
      authorizeUrl,
      /* useAuthData */ false
    );

    return urlPromise
      .then((url) => {
        // replacing variable RETURN_URL in the authorize url
        return this.accessSource_.getLoginUrl(url);
      })
      .then((url) => {
        return this.timer_
          .timeoutPromise(AUTHORIZATION_TIMEOUT, this.xhr_.fetchJson(url, {}))
          .then((res) => {
            return res.json();
          });
      });
  }

  /**
   * Removes the paywall from the element on publisher's page where paywall is displayed
   * @private
   * @return {!Promise}
   */
  emptyContainer_() {
    if (this.containerEmpty_) {
      return Promise.resolve();
    }

    if (this.unlockButtonListener_) {
      this.unlockButtonListener_ = null;
    }

    if (this.alreadyPurchasedListener_) {
      this.alreadyPurchasedListener_ = null;
    }

    return this.vsync_.mutatePromise(() => {
      this.containerEmpty_ = true;
      this.innerContainer_ = null;
      removeChildren(this.getPaywallContainer_());
    });
  }

  /**
   * Return element on publisher's page where paywall will be displayed
   * @return {!Element}
   * @private
   */
  getPaywallContainer_() {
    const containerId = this.fewcentsConfig_['contentSelector'];
    const dialogContainer = this.ampdoc.getElementById(containerId);
    return user().assertElement(
      dialogContainer,
      'No element found with given id',
      containerId
    );
  }

  /**
   * Creates the paywall component and append it to dialog container
   * @private
   */
  renderPurchaseOverlay_() {
    this.dialogContainer_ = this.getPaywallContainer_();
    this.innerContainer_ = createElementWithAttributes(
      this.ampdoc.win.document,
      'div',
      {
        class: TAG_SHORTHAND + '-container',
      }
    );

    this.createLogoAndHeader_();

    this.createAlreadyBoughtElement_();

    this.createPriceAndButton_();

    // 'div' element for reference row and fewcents logo
    const bottomDiv = createElementWithAttributes(
      this.ampdoc.win.document,
      'div',
      {
        class: TAG_SHORTHAND + '-bottom-div',
      }
    );

    // Reference row for terms and conditions
    const refRow = this.createRefRowElement_();
    bottomDiv.appendChild(refRow);

    // Creating fewcents logo for the paywall
    const fewcentsLogo = createElementWithAttributes(
      this.ampdoc.win.document,
      'img',
      {
        class: TAG_SHORTHAND + '-fewcents-image-tag',
        src: this.i18n_['fcPoweredImageRef'],
      }
    );
    bottomDiv.appendChild(fewcentsLogo);
    this.innerContainer_.appendChild(bottomDiv);

    this.dialogContainer_.appendChild(this.innerContainer_);
    this.containerEmpty_ = false;
  }

  /**
   * Creates publisher logo and header text for the paywall
   * @private
   */
  createLogoAndHeader_() {
    const publisherLogo = createElementWithAttributes(
      this.ampdoc.win.document,
      'img',
      {
        class: TAG_SHORTHAND + '-imageTag',
        src: this.fewcentsConfig_['publisherLogoUrl'],
      }
    );
    this.innerContainer_.appendChild(publisherLogo);

    const headerText = createElementWithAttributes(
      this.ampdoc.win.document,
      'div',
      {
        class: TAG_SHORTHAND + '-headerText',
      }
    );

    headerText.textContent = this.i18n_['fcTitleText'];
    this.innerContainer_.appendChild(headerText);
  }

  /**
   * Creates already bought link
   * @private
   */
  createAlreadyBoughtElement_() {
    const alreadyBought = createElementWithAttributes(
      this.ampdoc.win.document,
      'a',
      {
        class: TAG_SHORTHAND + '-already-bought',
        href: this.loginDialogUrl_,
        target: '_blank',
        rel: 'noopener noreferrer',
      }
    );

    alreadyBought.textContent = this.i18n_['fcPromptText'];
    this.alreadyPurchasedListener_ = listen(alreadyBought, 'click', (ev) => {
      this.handlePurchase_(ev);
    });
    this.innerContainer_.appendChild(alreadyBought);
  }

  /**
   * Create elements for article price and unlock button
   * @private
   */
  createPriceAndButton_() {
    const priceAndButtonDiv = createElementWithAttributes(
      this.ampdoc.win.document,
      'div',
      {
        class: TAG_SHORTHAND + '-price-btn-div',
      }
    );
    this.innerContainer_.appendChild(priceAndButtonDiv);

    // Article price element
    const articlePrice = createElementWithAttributes(
      this.ampdoc.win.document,
      'div',
      {
        class: TAG_SHORTHAND + '-article-price',
      }
    );

    articlePrice.textContent = this.purchaseOptions_?.price?.price;
    priceAndButtonDiv.appendChild(articlePrice);

    // Unlock button div element
    const unlockButtonDiv = createElementWithAttributes(
      this.ampdoc.win.document,
      'div',
      {
        class: TAG_SHORTHAND + '-btn-div',
      }
    );

    // Creating unlock button on paywall
    const unlockButton = createElementWithAttributes(
      this.ampdoc.win.document,
      'button',
      {
        class: TAG_SHORTHAND + '-purchase-button',
        style: 'background:'.concat(this.fewcentsConfig_['primaryColor']),
      }
    );

    unlockButton.textContent = this.i18n_['fcButtonText'];
    this.unlockButtonListener_ = listen(unlockButton, 'click', (ev) => {
      this.handlePurchase_(ev);
    });
    unlockButtonDiv.appendChild(unlockButton);
    priceAndButtonDiv.appendChild(unlockButtonDiv);
  }

  /**
   * Create reference elements on paywall
   * @private
   */
  createRefRowElement_() {
    const refRow = createElementWithAttributes(
      this.ampdoc.win.document,
      'div',
      {
        class: TAG_SHORTHAND + '-refRow',
      }
    );

    const terms = createElementWithAttributes(this.ampdoc.win.document, 'a', {
      class: TAG_SHORTHAND + '-refElements',
      href: this.i18n_['fcTermsRef'],
      target: '_blank',
      rel: 'noopener noreferrer',
    });
    terms.textContent = 'Terms';
    refRow.appendChild(terms);
    this.createPartitionbar_(refRow);

    const privacy = createElementWithAttributes(this.ampdoc.win.document, 'a', {
      class: TAG_SHORTHAND + '-refElements',
      href: this.i18n_['fcPrivacyRef'],
      target: '_blank',
      rel: 'noopener noreferrer',
    });
    privacy.textContent = 'Privacy';
    refRow.appendChild(privacy);
    this.createPartitionbar_(refRow);

    const contactUs = createElementWithAttributes(
      this.ampdoc.win.document,
      'a',
      {
        class: TAG_SHORTHAND + '-refElements',
        href: this.i18n_['fcContactUsRef'],
        target: '_blank',
        rel: 'noopener noreferrer',
      }
    );
    contactUs.textContent = 'Contact Us';
    refRow.appendChild(contactUs);
    this.createPartitionbar_(refRow);

    return refRow;
  }

  /**
   * Create partition bar for the reference elements
   * @private
   */
  createPartitionbar_(refRow) {
    const partitionBar = createElementWithAttributes(
      this.ampdoc.win.document,
      'span',
      {
        class: TAG_SHORTHAND + '-partition-bar',
      }
    );
    partitionBar.textContent = '|';
    refRow.appendChild(partitionBar);
  }

  /**
   * Open login dialog when click on unlock button
   * @param {!Event} ev
   * @private
   */
  handlePurchase_(ev) {
    ev.preventDefault();
    const urlPromise = this.accessSource_.buildUrl(
      this.loginDialogUrl_,
      /* useAuthData */ false
    );

    return urlPromise.then((url) => {
      this.accessSource_.loginWithUrl(url);
    });
  }
}


text:
package org.jclouds.scriptbuilder;

import static org.jclouds.scriptbuilder.domain.Statements.appendFile;
import static org.jclouds.scriptbuilder.domain.Statements.call;
import static org.jclouds.scriptbuilder.domain.Statements.exec;
import static org.jclouds.scriptbuilder.domain.Statements.interpret;
import static org.testng.Assert.assertEquals;

import java.io.IOException;
import java.net.MalformedURLException;

import org.jclouds.scriptbuilder.domain.OsFamily;
import org.jclouds.scriptbuilder.domain.ShellToken;
import org.testng.annotations.Test;

import com.google.common.base.Charsets;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Resources;

/**
 * Tests possible uses of InitScript
 */
public class InitScriptTest {
   InitScript testInitScript = InitScript
         .builder()
         .name("mkebsboot")
         .home("/mnt/tmp")
         .exportVariables(ImmutableMap.of("tmpDir", "/mnt/tmp"))
         .run(appendFile("{tmp}{fs}{uid}{fs}scripttest{fs}temp.txt", ImmutableList.<String> of("hello world")),
               exec("find /")).build();

   public void testBuildSimpleWindows() throws MalformedURLException, IOException {
      assertEquals(
            testInitScript.render(OsFamily.WINDOWS),
            Resources.toString(Resources.getResource("test_init." + ShellToken.SH.to(OsFamily.WINDOWS)), Charsets.UTF_8));
   }

   public void testBuildSimpleUNIX() throws MalformedURLException, IOException {
      assertEquals(
            testInitScript.render(OsFamily.UNIX),
            Resources.toString(Resources.getResource("test_init." + ShellToken.SH.to(OsFamily.UNIX)), Charsets.UTF_8));
   }

   public void testBuildEBS() throws MalformedURLException, IOException {
      assertEquals(InitScript
            .builder()
            .name("mkebsboot")
            .home("tmp")
            .logDir("/tmp/logs")
            .exportVariables(ImmutableMap.of("imageDir", "/mnt/tmp", "ebsDevice", "/dev/sdh", "ebsMountPoint", "/mnt/ebs"))
            .run(interpret(
                              "echo creating a filesystem and mounting the ebs volume",
                              "{md} {varl}IMAGE_DIR{varr} {varl}EBS_MOUNT_POINT{varr}",
                              "rm -rf {varl}IMAGE_DIR{varr}/*",
                              "yes| mkfs -t ext3 {varl}EBS_DEVICE{varr} 2>&-",
                              "mount {varl}EBS_DEVICE{varr} {varl}EBS_MOUNT_POINT{varr}",
                              "echo making a local working copy of the boot disk",
                              "rsync -ax --exclude /ubuntu/.bash_history --exclude /home/*/.bash_history --exclude /etc/ssh/ssh_host_* --exclude /etc/ssh/moduli --exclude /etc/udev/rules.d/*persistent-net.rules --exclude /var/lib/ec2/* --exclude=/mnt/* --exclude=/proc/* --exclude=/tmp/* --exclude=/dev/log / {varl}IMAGE_DIR{varr}",
                              "echo preparing the local working copy",
                              "touch {varl}IMAGE_DIR{varr}/etc/init.d/ec2-init-user-data",
                              "echo copying the local working copy to the ebs mount", "{cd} {varl}IMAGE_DIR{varr}",
                              "tar -cSf - * | tar xf - -C {varl}EBS_MOUNT_POINT{varr}", "echo size of ebs",
                              "du -sk {varl}EBS_MOUNT_POINT{varr}", "echo size of source",
                              "du -sk {varl}IMAGE_DIR{varr}", "rm -rf {varl}IMAGE_DIR{varr}/*",
                              "umount {varl}EBS_MOUNT_POINT{varr}", "echo ----COMPLETE----")).build().render(OsFamily.UNIX),
            Resources.toString(Resources.getResource("test_ebs." + ShellToken.SH.to(OsFamily.UNIX)), Charsets.UTF_8));
   }

   InitScript testCallInRun = InitScript.builder().name("testcall").init(exec("echo hello"))
         .run(call("sourceEnvFile", "foo"), exec("find /")).build();

   @Test
   public void testCallInRunUNIX() throws MalformedURLException, IOException {
      assertEquals(
            testCallInRun.render(OsFamily.UNIX),
            Resources.toString(Resources.getResource("test_init_script." + ShellToken.SH.to(OsFamily.UNIX)), Charsets.UTF_8));
   }

}


text:
{% extends "kolibri/base.html" %}
{% load learn_tags %}

{% block content %}
  <script>
    var channelCollection = {{kolibri}}.resources.ChannelResource.getCollection({}, JSON.parse("{{ channelList | escapejs }}"));
    channelCollection.synced = true;
    {{kolibri}}.resources.ContentNodeResource.setChannel("{{ channel_id }}");
    var root_node = JSON.parse("{{ rootnode|escapejs }}");
    var root_node_pk = String(root_node.pk);
    var model = {{kolibri}}.resources.ContentNodeResource.createModel(root_node);
    model.synced = true;
    var collection = {{kolibri}}.resources.ContentNodeResource.getCollection({parent: root_node_pk}, JSON.parse("{{ nodes|escapejs }}"));
    collection.synced = true;
  </script>
  {% learn_async_assets %}
  {% learn_assets %}
{% endblock %}


text:
package org.cqframework.cql.elm.requirements;

import java.util.ArrayList;
import java.util.List;

public class CollapsedElmRequirements {

    private List<ElmRequirement> uniqueRequirements = new ArrayList<ElmRequirement>();
    public Iterable<ElmRequirement> getUniqueRequirements() {
        return uniqueRequirements;
    }

    public void add(ElmRequirement requirement) {
        ElmRequirement existing = getEquivalent(requirement);
        if (existing == null) {
            uniqueRequirements.add(requirement);
        }
        else {
            uniqueRequirements.remove(existing);
            uniqueRequirements.add(ComparableElmRequirement.mergeRequirements(existing, requirement));
        }
    }

    public ElmRequirement getEquivalent(ElmRequirement requirement) {
        for (ElmRequirement existing : uniqueRequirements) {
            if (ComparableElmRequirement.requirementsEquivalent(existing, requirement)) {
                return existing;
            }
        }

        return null;
    }
}


text:
package com.google.javascript.jscomp.modules;

import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableMap;
import com.google.javascript.jscomp.deps.ModuleLoader;
import com.google.javascript.jscomp.modules.ModuleMetadataMap.ModuleMetadata;
import javax.annotation.Nullable;

/**
 * Information for modules, particularly ES modules, that is useful for rewriting. The primary
 * pieces of information are what variables are exported (transitive or local), and what names are
 * imported.
 */
@AutoValue
public abstract class Module {
  // Prevent unwanted subclasses.
  Module() {}

  public abstract ModuleMetadata metadata();

  /** Path of this module. Null if this module is a nested {@code goog.loadModule}. */
  @Nullable
  public abstract ModuleLoader.ModulePath path();

  /**
   * Map of exported identifiers to originating binding.
   *
   *
Note that the keys are different than {@link #boundNames()}. Here the keys are the exported
   * name, not the local name.
   *
   *
Examples:
   *
   *

   *
Locally defined exports (e.g. export let x;, let x; export {x as v};
   *       ) creates an entry with the exported name for the local module's export
   *       definition.
   *
export default function foo() {}; creates an entry with the name "default"
   *       for the local module's default export definition.
   *
export {x as v} from 'mod'; creates an entry with the name "v" for the
   *       export definition x from 'mod'.
   *
import statements make no entries on their own. If imported values are
   *       exported with  export {}; then an entry is created like export {} from
   *       .
   *
exports.foo = bar; creates an entry with the name "foo" for the expression
   *       on the right-hand side. This is not bound to a local name.
   *

   */
  public abstract ImmutableMap<String, Binding> namespace();

  /**
   * Map of local identifiers to originating binding.
   *
   *
This includes all names bound by import and exported names which originate in this module.
   * Used for rewriting in later stages of the compiler.
   *
   *
ES modules may have names bound by both imports and exports. Closure modules only have names
   * bound by imports, as it is impossible to create a new local identifier in an export.
   *
   *
Examples:
   *
   *

   *
import {x as v} from 'mod'; creates an entry with the name "v" for the
   *       export definition x from 'mod'.
   *
import * as ns from 'mod'; creates an entry with the name "ns" with a
   *       binding containing all of mod's bindings.
   *
export default function foo() {} creates an entry with the name "foo" for
   *       the local module's export definition.
   *
export {x as v} from 'mod'; does not create any entry in this module.
   *
const C = goog.require('mod.C') creates an entry with the name "C" for the
   *       binding containing the default export of 'mod.C'
   *

   */
  public abstract ImmutableMap<String, Binding> boundNames();

  /** Map of local identifier name to local export definition. */
  public abstract ImmutableMap<String, Export> localNameToLocalExport();

  /**
   * The specific Closure namespace this module represents, if any. This can be from {@code
   * goog.provide}, {@code goog.module}, or {@code goog.module.declareNamespace}. Null otherwise.
   */
  @Nullable
  public abstract String closureNamespace();

  /** Creates a new builder. */
  public static Builder builder() {
    return new AutoValue_Module.Builder();
  }

  /** Returns this module in builder form. */
  public abstract Builder toBuilder();

  /** Builder for {@link Module}. */
  @AutoValue.Builder
  public abstract static class Builder {
    public abstract Builder metadata(ModuleMetadata value);

    public abstract Builder path(@Nullable ModuleLoader.ModulePath value);

    public abstract Builder namespace(ImmutableMap<String, Binding> value);

    public abstract Builder boundNames(ImmutableMap<String, Binding> value);

    public abstract Builder localNameToLocalExport(ImmutableMap<String, Export> value);

    public abstract Builder closureNamespace(@Nullable String value);

    public abstract Module build();
  }
}


text:
<!DOCTYPE html>
<?php
	$connection=mysqli_connect("127.0.0.1", "root", "", "diklatmedan");
	mysqli_select_db($connection, "");
	$query=mysqli_query($connection, "SELECT * FROM jadwal group by nama_diklat");
?>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Badan Pendidikan dan Pelatihan</title>

  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

  <link rel="stylesheet" href="dist/css/AdminLTE.min.css">

  <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">

  <link rel="stylesheet" href="plugins/iCheck/flat/blue.css">

  <link rel="stylesheet" href="plugins/morris/morris.css">

  <link rel="stylesheet" href="plugins/jvectormap/jquery-jvectormap-1.2.2.css">

  <link rel="stylesheet" href="plugins/datepicker/datepicker3.css">

  <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">

  <link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

  <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  <link rel="stylesheet" type="text/css" href="daterangepicker.css" />

  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">

  <link rel="stylesheet" href="/resources/demos/style.css">

  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.css">

      DIK

      DIKLAT MEDAN

        Toggle navigation

 Halaman Utama

 Cari Jadwal Widyaiswara

 Input Jadwal

 Data Widyaiswara

 Cetak Laporan

        Cetak Laporan Mingguan

      <form class="form-horizontal" method="post" action="cetakLaporan.php">

            Tanggal Cetak

              <input type="date" class="form-control" id="datepicker4" name="tanggal_berjalan" required>

            Nama Diklat

              <select class="form-control" id="listDiklat" name="listDiklat" required>
	              <option></option>
	              <?php while ($dt = mysqli_fetch_array($query)) { ?>
	                  <option>
	                  	<?php echo $dt['nama_diklat']; ?>
	                  </option>
	              <?php } ?>
              </select>

            No. Dokumen

              <input type="text" class="form-control" id="no_dokumen" name="no_dokumen" required>

            No. Revisi

              <input type="text" class="form-control" id="no_revisi" name="no_revisi" required>

            Tanggal Eff

              <input type="date" class="form-control" id="datepicker" name="tanggal_eff" required>

            Tanggal Mulai

              <input type="date" class="form-control" id="datepicker2" name="tanggal_mulai" required>

            Tanggal Selesai

              <input type="date" class="form-control" id="datepicker3" name="tanggal_selesai" required>

            Angkatan

              <input type="text" class="form-control" id="angkatan" name="angkatan" required>

            Tahun

              <select name="tahun" id="yearpicker" required></select>

            <button type="reset" class="btn btn-default">Reset</button>
            <button type="submit" class="btn btn-info pull-right">Cetak</button>

      </form>

    Copyright © 2017-2018 Badan Pendidikan dan Pelatihan Kota Medan . All rights
    reserved.


text:
@implementation EZNetworkArgument
//公共参数
-(NSDictionary *)requestUrlArgument
{
    return nil;
}

-(BOOL)responseCheckErrorCode:(NSDictionary *)dict
{
    return YES;
}

@end


text:
from __future__ import print_function
from __future__ import absolute_import
import contextlib
import logging
import os

import py_utils
from py_utils import binary_manager
from py_utils import cloud_storage
from py_utils import dependency_util
import dependency_manager
from dependency_manager import base_config

from devil import devil_env

from telemetry.core import exceptions
from telemetry.core import util

TELEMETRY_PROJECT_CONFIG = os.path.join(
    util.GetTelemetryDir(), 'telemetry', 'binary_dependencies.json')

CHROME_BINARY_CONFIG = os.path.join(util.GetCatapultDir(), 'common', 'py_utils',
                                    'py_utils', 'chrome_binaries.json')

SUPPORTED_DEP_PLATFORMS = (
    'linux_aarch64', 'linux_x86_64', 'linux_armv7l', 'linux_mips',
    'mac_x86_64', 'mac_arm64',
    'win_x86', 'win_AMD64',
    'android_arm64-v8a', 'android_armeabi-v7a', 'android_arm', 'android_x64',
    'android_x86'
)

PLATFORMS_TO_DOWNLOAD_FOLDER_MAP = {
    'linux_aarch64': 'bin/linux/aarch64',
    'linux_x86_64': 'bin/linux/x86_64',
    'linux_armv7l': 'bin/linux/armv7l',
    'linux_mips': 'bin/linux/mips',
    'mac_x86_64': 'bin/mac/x86_64',
    'mac_arm64': 'bin/mac/arm64',
    'win_x86': 'bin/win/x86',
    'win_AMD64': 'bin/win/AMD64',
    'android_arm64-v8a': 'bin/android/arm64-v8a',
    'android_armeabi-v7a': 'bin/android/armeabi-v7a',
    'android_arm': 'bin/android/arm',
    'android_x64': 'bin/android/x64',
    'android_x86': 'bin/android/x86',
}

NoPathFoundError = dependency_manager.NoPathFoundError
CloudStorageError = dependency_manager.CloudStorageError

_binary_manager = None
_installed_helpers = set()

TELEMETRY_BINARY_BASE_CS_FOLDER = 'binary_dependencies'
TELEMETRY_BINARY_CS_BUCKET = cloud_storage.PUBLIC_BUCKET

def NeedsInit():
  return not _binary_manager

def InitDependencyManager(client_configs):
  if GetBinaryManager():
    raise exceptions.InitializationError(
        'Trying to re-initialize the binary manager with config %s'
        % client_configs)
  configs = []
  if client_configs:
    configs += client_configs
  configs += [TELEMETRY_PROJECT_CONFIG, CHROME_BINARY_CONFIG]
  SetBinaryManager(binary_manager.BinaryManager(configs))

  devil_env.config.Initialize()

@contextlib.contextmanager
def TemporarilyReplaceBinaryManager(manager):
  old_manager = GetBinaryManager()
  try:
    SetBinaryManager(manager)
    yield
  finally:
    SetBinaryManager(old_manager)

def GetBinaryManager():
  return _binary_manager

def SetBinaryManager(manager):
  global _binary_manager # pylint: disable=global-statement
  _binary_manager = manager

def _IsChromeOSLocalMode(os_name):
  """Determines if we're running telemetry on a Chrome OS device.

  Used to differentiate local mode (telemetry running on the CrOS DUT) from
  remote mode (running telemetry on another platform that communicates with
  the CrOS DUT over SSH).
  """
  return os_name == 'chromeos' and py_utils.GetHostOsName() == 'chromeos'

def FetchPath(binary_name, os_name, arch, os_version=None):
  """ Return a path to the appropriate executable for <binary_name>, downloading
      from cloud storage if needed, or None if it cannot be found.
  """
  if GetBinaryManager() is None:
    raise exceptions.InitializationError(
        'Called FetchPath with uninitialized binary manager.')
  return GetBinaryManager().FetchPath(
      binary_name, 'linux' if _IsChromeOSLocalMode(os_name) else os_name,
      arch, os_version)

def LocalPath(binary_name, os_name, arch, os_version=None):
  """ Return a local path to the given binary name, or None if an executable
      cannot be found. Will not download the executable.
      """
  if GetBinaryManager() is None:
    raise exceptions.InitializationError(
        'Called LocalPath with uninitialized binary manager.')
  return GetBinaryManager().LocalPath(binary_name, os_name, arch, os_version)

def FetchBinaryDependencies(
    platform, client_configs, fetch_reference_chrome_binary):
  """ Fetch all binary dependenencies for the given |platform|.

  Note: we don't fetch browser binaries by default because the size of the
  binary is about 2Gb, and it requires cloud storage permission to
  chrome-telemetry bucket.

  Args:
    platform: an instance of telemetry.core.platform
    client_configs: A list of paths (string) to dependencies json files.
    fetch_reference_chrome_binary: whether to fetch reference chrome binary for
      the given platform.
  """
  configs = [
      dependency_manager.BaseConfig(TELEMETRY_PROJECT_CONFIG),
  ]
  dep_manager = dependency_manager.DependencyManager(configs)
  os_name = platform.GetOSName()
  # If we're running directly on a Chrome OS device, fetch the binaries for
  # linux instead, which should be compatible with CrOS. Otherwise, if we're
  # running remotely on CrOS, fetch the binaries for the host platform like
  # we do with android below.
  if _IsChromeOSLocalMode(os_name):
    os_name = 'linux'
  target_platform = '%s_%s' % (os_name, platform.GetArchName())
  dep_manager.PrefetchPaths(target_platform)

  host_platform = None
  fetch_devil_deps = False
  if os_name in ('android', 'chromeos'):
    host_platform = '%s_%s' % (
        py_utils.GetHostOsName(), py_utils.GetHostArchName())
    dep_manager.PrefetchPaths(host_platform)
    if os_name == 'android':
      if host_platform == 'linux_x86_64':
        fetch_devil_deps = True
      else:
        logging.error('Devil only supports 64 bit linux as a host platform. '
                      'Android tests may fail.')

  if fetch_reference_chrome_binary:
    _FetchReferenceBrowserBinary(platform)

  # For now, handle client config separately because the BUILD.gn & .isolate of
  # telemetry tests in chromium src failed to include the files specified in its
  # client config.
  # (https://github.com/catapult-project/catapult/issues/2192)
  # For now this is ok because the client configs usually don't include cloud
  # storage infos.
  # TODO(crbug.com/1111556): remove the logic of swallowing exception once the
  # issue is fixed on Chromium side.
  if client_configs:
    manager = dependency_manager.DependencyManager(
        list(dependency_manager.BaseConfig(c) for c in client_configs))
    try:
      manager.PrefetchPaths(target_platform)
      if host_platform is not None:
        manager.PrefetchPaths(host_platform)

    except dependency_manager.NoPathFoundError as e:
      logging.error('Error when trying to prefetch paths for %s: %s',
                    target_platform, e)

  if fetch_devil_deps:
    devil_env.config.Initialize()
    devil_env.config.PrefetchPaths(arch=platform.GetArchName())
    devil_env.config.PrefetchPaths()

def ReinstallAndroidHelperIfNeeded(binary_name, install_path, device):
  """ Install a binary helper to a specific location.

  Args:
    binary_name: (str) The name of the binary from binary_dependencies.json
    install_path: (str) The path to install the binary at
    device: (device_utils.DeviceUtils) a device to install the helper to
  Raises:
    Exception: When the binary could not be fetched or could not be pushed to
        the device.
  """
  if (device.serial, install_path) in _installed_helpers:
    return
  host_path = FetchPath(binary_name, 'android', device.GetABI())
  if not host_path:
    raise Exception(
        '%s binary could not be fetched as %s' % (binary_name, host_path))
  device.PushChangedFiles([(host_path, install_path)])
  device.RunShellCommand(['chmod', '777', install_path], check_return=True)
  _installed_helpers.add((device.serial, install_path))

def _FetchReferenceBrowserBinary(platform):
  os_name = platform.GetOSName()
  if _IsChromeOSLocalMode(os_name):
    os_name = 'linux'
  arch_name = platform.GetArchName()
  manager = binary_manager.BinaryManager(
      [CHROME_BINARY_CONFIG])
  if os_name == 'android':
    os_version = dependency_util.GetChromeApkOsVersion(
        platform.GetOSVersionName())
    manager.FetchPath(
        'chrome_stable', os_name, arch_name, os_version)
  else:
    manager.FetchPath(
        'chrome_stable', os_name, arch_name)

def UpdateDependency(dependency, dep_local_path, version,
                     os_name=None, arch_name=None):
  config = os.path.join(
      util.GetTelemetryDir(), 'telemetry', 'binary_dependencies.json')

  if not os_name:
    assert not arch_name, 'arch_name is specified but not os_name'
    os_name = py_utils.GetHostOsName()
    arch_name = py_utils.GetHostArchName()
  else:
    assert arch_name, 'os_name is specified but not arch_name'

  dep_platform = '%s_%s' % (os_name, arch_name)

  c = base_config.BaseConfig(config, writable=True)
  try:
    old_version = c.GetVersion(dependency, dep_platform)
    print('Updating from version: {}'.format(old_version))
  except ValueError as e:
    raise RuntimeError(
        ('binary_dependencies.json entry for %s missing or invalid; please add '
         'it first! (need download_path and path_within_archive)') %
        dep_platform) from e

  if dep_local_path:
    c.AddCloudStorageDependencyUpdateJob(
        dependency, dep_platform, dep_local_path, version=version,
        execute_job=True)


text:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { LayersComponent } from './layers.component';
import { LayerHeaderComponent } from './layer-header.component';
import { LayerContentComponent } from './layer-content.component';
import { MatCardModule } from '@angular/material/card';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatRadioModule } from '@angular/material/radio';
import { MatSliderModule } from '@angular/material/slider';
import { ColorPickerComponent } from 'src/app/color-picker/color-picker.component';
import { FormsModule } from '@angular/forms';
import { CheckboardModule, HueModule, SaturationModule, AlphaModule } from 'ngx-color';
import { Component, ViewChild } from '@angular/core';

@Component({
  selector: `host-component`,
  template: `<map-layers-panel
    [mageLayers]="mageLayers"
    [baseLayers]="baseLayers"
    [tileOverlays]="tileOverlays"
    [featureOverlays]="featureOverlays">
  </map-layers-panel>`
})
class TestHostComponent {

  mageLayers = [];
  baseLayers= [];
  tileOverlays = [];
  featureOverlays = [];

  @ViewChild(LayersComponent) layers: LayersComponent;
}

describe('LayersComponent', () => {
  let component: LayersComponent;
  let hostComponent: TestHostComponent;
  let fixture: ComponentFixture<TestHostComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [ FormsModule, MatCardModule, MatFormFieldModule, MatIconModule, MatSliderModule, MatCheckboxModule, MatRadioModule, MatExpansionModule, CheckboardModule, HueModule, SaturationModule, AlphaModule ],
      declarations: [ LayersComponent, LayerHeaderComponent, LayerContentComponent, ColorPickerComponent, TestHostComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(TestHostComponent);
    hostComponent = fixture.componentInstance;
    fixture.detectChanges();
    component = hostComponent.layers;
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });

  it('should reorder', () => {
    spyOn(component.onReorder, 'emit');

    const event: any = {
      currentIndex: 1,
      previousIndex: 0
    }
    const type = 'tile';
    const layers: [any] = [{}];
    component.reorderLayers(event, type, layers);

    expect(component.onReorder.emit).toHaveBeenCalledWith({
      type: type,
      layers: layers,
      currentIndex: 1,
      previousIndex: 0
    });
  });

  it('should not reorder if indices are the same', () => {
    spyOn(component.onReorder, 'emit');

    const event: any = {
      currentIndex: 0,
      previousIndex: 0
    }
    const type = 'tile';
    const layers: [any] = [{}];
    component.reorderLayers(event, type, layers);

    expect(component.onReorder.emit).not.toHaveBeenCalled();
  });
});


text:
import React from 'react';
import './Slide.less';

export default class Slide {
	render() {
		return (

					{this.props.children}

		);
	}
}