text:
package com.ing.baker.il

case class EventOutputTransformer(newEventName: String, ingredientRenames: Map[String, String])


text: Asp.Net Mvc Core for a Demo

redpajama_set_name: RedPajamaGithub


text:
package cn.easyproject.easyee.sh.sys.service;

import cn.easyproject.easyee.sh.base.util.PageBean;
import cn.easyproject.easyee.sh.sys.criteria.SysLogCriteria;
import cn.easyproject.easyee.sh.sys.entity.SysLog;

public interface SysLogService {
	public void add(SysLog sysLog);
	@SuppressWarnings("rawtypes")
	public void findByPage(PageBean pb,SysLogCriteria sysLogCriteria);
}


text:
<meta charset="UTF-8">

flexmark-ext-admonition

flexmark-java extension for Admonition Extension, Material for MkDocs syntax processing

To create block-styled side content. For complete documentation please see the
Admonition Extension, Material for MkDocs documentation. (Personal opinion: Material for
MkDocs is eye-candy. If you have not taken a look at it, you are missing out on a visual
treat.)

Block-Styled Side Content

!!! qualifier "Optional Title"
    block content

No-Heading Content

!!! qualifier ""
    block content

Collapsible Block-Styled Side Content:

Collapsed by default

??? qualifier "Optional Title"
    block content

Open by default

???+ qualifier "Optional Title"
     block content

SVG images and stylesheet included for default qualifiers. User definable qualifiers can be
added by specifying recognized style qualifiers, their aliases and image mapping.

Qualifiers are used to select the icon and the color of the block.

Qualifiers

abstract style

abstract

summary

tldr

bug style

bug

danger style

danger

error

example style

example

snippet

fail style

failure

fail

missing

faq style

question

help

faq

info style

info

todo

note style

note

seealso

quote style

quote

cite

success style

success

check

done

tip style

tip

hint

important

warning style

warning

caution

attention


text:
#ifndef SRC_BFD_JSON_CONFIG_H_
#define SRC_BFD_JSON_CONFIG_H_

#include "bfd/bfd_common.h"

#include <vector>
#include <map>
#include <string>
#include <boost/asio/ip/address.hpp>
#include <rapidjson/document.h>

namespace BFD {
namespace REST {

struct JsonData {
    class Constraint {
     public:
        typedef bool (rapidjson::Value::*TypecheckFunc)() const;

        Constraint(const char* member_name, TypecheckFunc func)
            : member_name(member_name), typecheck_func(func) {}

        const char* member_name;
        TypecheckFunc typecheck_func;
    };

    virtual bool ValidateJsonDocument(const rapidjson::Value& document) = 0;
    virtual bool ParseFromJsonDocument(const rapidjson::Value& document) = 0;
    virtual void EncodeJsonDocument(rapidjson::Value* document,
        rapidjson::Value::AllocatorType *allocator) = 0;

    bool ParseFromJsonString(const std::string& json);
    void EncodeJsonString(std::string* json);

    virtual ~JsonData() {}

 protected:
    bool AreConstraintsMet(const std::vector<Constraint>& constraints,
    const rapidjson::Value& document);
};

struct JsonConfig : public JsonData {
    JsonConfig();
    JsonConfig(boost::asio::ip::address address,
               TimeInterval desired_min_tx_interval,
               TimeInterval required_min_rx_interval,
               int detection_time_multiplier);

    bool ValidateJsonDocument(const rapidjson::Value& document);
    bool ParseFromJsonDocument(const rapidjson::Value& document);
    void EncodeJsonDocument(rapidjson::Value* document,
        rapidjson::Value::AllocatorType *allocator);

    boost::asio::ip::address address;
    TimeInterval desired_min_tx_interval;
    TimeInterval required_min_rx_interval;
    int detection_time_multiplier;
};

struct JsonState : public JsonData {
    virtual bool ValidateJsonDocument(const rapidjson::Value& document);
    virtual bool ParseFromJsonDocument(const rapidjson::Value& document);
    void EncodeJsonDocument(rapidjson::Value* document,
        rapidjson::Value::AllocatorType *allocator);

    JsonConfig session_config;

    Discriminator local_discriminator;
    Discriminator remote_discriminator;
    BFDState bfd_local_state;
    BFDState bfd_remote_state;
    TimeInterval remote_min_rx_interval;
};

struct JsonStateNotification : public JsonData {
    virtual bool ValidateJsonDocument(const rapidjson::Value& document);
    virtual bool ParseFromJsonDocument(const rapidjson::Value& document);
    void EncodeJsonDocument(rapidjson::Value* document,
        rapidjson::Value::AllocatorType *allocator);

    boost::asio::ip::address address;
    BFDState state;
};

struct JsonStateNotificationList : public JsonData {
    virtual bool ValidateJsonDocument(const rapidjson::Value& document);
    virtual bool ParseFromJsonDocument(const rapidjson::Value& document);
    void EncodeJsonDocument(rapidjson::Value* document,
        rapidjson::Value::AllocatorType *allocator);

    std::vector<JsonStateNotification> notifications;
};

struct JsonStateMap : public JsonData {
    typedef std::map<boost::asio::ip::address, BFDState> StateMap;
    StateMap states;

    virtual bool ValidateJsonDocument(const rapidjson::Value& document);
    virtual bool ParseFromJsonDocument(const rapidjson::Value& document);
    void EncodeJsonDocument(rapidjson::Value* document,
        rapidjson::Value::AllocatorType* allocator);
};

}  // namespace REST
}  // namespace BFD

#endif  // SRC_BFD_JSON_CONFIG_H_


text:
package com.google.security.zynamics.zylib.general;

/**
 * This package is the package where all those classes are stored that do not fit into any other
 * package. This package is often the starting point for small classes that are later on moved to a
 * new package when they have grown to bigger size.
 */


text:
<?php
/**
 * Displays
 */
?>
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>CMACC</title>

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

    <![endif]-->

<?php
/*require('./vendor/autoload.php'); */
ini_set("allow_url_include", true);

//This displays the path, current file name, and provides the edit and show options //

$lib_path = LIB_PATH;

$lib_path = LIB_PATH;
$document = `perl $lib_path/parser.pl $path/$dir`;

$minDocLength = 1;

if (strlen($document) > $minDocLength) {

    $document = str_replace("{", "{", $document);
    $document = str_replace("}", "}", $document);

//kludge to let html headers have formatting.

    $document = str_replace("(Curly-)", "{", $document);
    $document = str_replace("(-Curly)", "}", $document);

    $html = $document;
} else {
    $html = "Nothing to Show";
}

include("$lib_path/view-tabs.php");

?>

            <?php echo $html; ?>


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=fn.tx_report_entity_for_temp_id.html">

Redirecting to fn.tx_report_entity_for_temp_id.html...


text:
ember-cli-addon-docs now supports shipping your docs site as a separate app,
rather than using the dummy app.

General steps to convert an existing dummy app to a separate app:

## 1. Decide whether you want a monorepo or a nested app.

Either should work, but they have different pros and cons. With a monorepo you only need to run `yarn install` once and you get efficient sharing of dependencies. But it's also harder for users to point their app directly at an unreleased commit or fork of your addon.

    In my case, I went with a nested app, meaning I have a regular ember-addon, plus a `/docs` folder that contains a regular ember app. So you need to `yarn install` in both before the docs app will work.

## 2. Generate a new app to be your docs app, with `ember new`.

ember-cli doesn't like to generate new apps inside existing apps, so you may need to generate it elsewhere first and then move it into place.

## 3. Make your docs app depend on your addon.

In my case, I did it as an [in repo addon](https://github.com/ember-animation/ember-animated/blob/152943adb41cdf2de8082b679daafffd6f9c3f77/docs/package.json#L70). If you're using a monorepo with yarn workspaces, you can have a regular `devDependency` on it instead.

## 4. Add `ember-cli-addon-docs` to your docs app.

## 5. Set `documentingAddonAt`

Configure the docs app's `ember-cli-build.js` to tell ember-cli-addon-docs to point at the addon:

```js
let app = new EmberApp(defaults, {
  'ember-cli-addon-docs': {
    documentingAddonAt: '..'
  }
});
```

If the addon is authored in v2 Addon Format `ember-cli-addon-docs` will look for the addon source code in `src` folder.
You may need to set `addonSrcFolder` config option if addon uses another folder:

```js
let app = new EmberApp(defaults, {
  'ember-cli-addon-docs': {
    documentingAddonAt: '../addon',
    addonSrcFolder: 'source',
  }
});
```

At this point you should be able to run the docs app and it should look the same as if you had just added ember-cli-addon-docs for the first time to your addon.

## 6. Move all the things

Move all the things (routes, templates, components, styles, etc) in your tests/dummy app into your new docs app. Also move any tests that are specifically about testing the docs app, as opposed to testing the addon. When you're done, you'll still have a dummy app and you can still use it for dev and test, but it won't contain the docs.

## 7. Configure CI

Remember to configure CI to run `ember test` in both the addon and the docs app.

## 8. Configure `.npmignore`

If you have a nested docs app, remember to configure `.npmignore` or equivalent so you don't publish the whole docs app to NPM.


text:
/)accounts
                              success:(void (^)(NSArray* /* NSString * */))success
                              failure:(void (^)(NSError*))failure;
@end

#endif // __WAUSUserDataAccountSystemAccessManager_DEFINED__


text:
class Light;
class Terrain;

class Environment
{
public:
    Environment();
    ~Environment();
    void Render(const glm::mat4& view, const glm::mat4& projection);
    void TransformLight(const glm::mat4& model, const glm::mat4& view);

    void AddLight(Light* light);
    std::vector<Light*> lights_;
protected:
    Terrain* terrain_;
};


text:
package org.openbel.editor.ui.wizards;

import static org.eclipse.dltk.ui.DLTKUIPlugin.getDefault;

import java.util.List;

import org.eclipse.dltk.core.environment.IEnvironment;
import org.eclipse.dltk.ui.wizards.ISourceModuleWizardExtension;
import org.eclipse.dltk.ui.wizards.NewSourceModulePage;
import org.eclipse.dltk.ui.wizards.NewSourceModuleWizard;

/**
 * Wizard for creating a new XBEL file.
 */
public class NewXBELFileWizard extends NewSourceModuleWizard {

    /**
     * {@link NewXBELFileWizard}
     */
    public NewXBELFileWizard() {
        setWindowTitle("New XBEL Document Wizard");
        setDialogSettings(getDefault().getDialogSettings());
    }

    @Override
    public IEnvironment getEnvironment() {
        // TODO Auto-generated method stub
        return super.getEnvironment();
    }

    @Override
    protected List<ISourceModuleWizardExtension> getExtensions() {
        // TODO Auto-generated method stub
        return super.getExtensions();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected NewSourceModulePage createNewSourceModulePage() {
        return new NewXBELFilePage();
    }
}


text:
package clock

import (
	"sync"
	"time"
)

type Ticker interface {
	C() <-chan time.Time
	Stop()
}

type Clock interface {
	Now() time.Time
	Sleep(time.Duration)
	After(time.Duration) <-chan time.Time
	NewTicker(time.Duration) Ticker
}

var Real Clock

func init() {
	Real = realClock{}
}

type realClock struct{}

func (realClock) Now() time.Time {
	return time.Now()
}

func (realClock) Sleep(d time.Duration) {
	time.Sleep(d)
}

func (realClock) After(d time.Duration) <-chan time.Time {
	return time.After(d)
}

func (realClock) NewTicker(d time.Duration) Ticker {
	return realTicker{time.NewTicker(d)}
}

type realTicker struct {
	*time.Ticker
}

func (rt realTicker) C() <-chan time.Time {
	return rt.Ticker.C
}

type Fake interface {
	Clock
	Advance(time.Duration)
}

// A fast fake clock returns from Sleep calls immediately.
//
// Any waiting operation appears to complete immediately, as though time is
// running infinitely fast, but only when waiting.
func NewFast(from Clock) Fake {
	if from == nil {
		from = Real
	}

	return NewFastAt(from.Now())
}

func NewFastAt(t time.Time) Fake {
	return &fastFake{t: t}
}

type fastFake struct {
	t     time.Time
	mutex sync.RWMutex
}

func (f *fastFake) Now() time.Time {
	f.mutex.RLock()
	defer f.mutex.RUnlock()
	t := f.t
	return t
}

func (f *fastFake) Sleep(d time.Duration) {
	f.mutex.Lock()
	defer f.mutex.Unlock()
	f.t = f.t.Add(d)
}

func (f *fastFake) Advance(d time.Duration) {
	f.Sleep(d)
}

func (f *fastFake) After(d time.Duration) <-chan time.Time {
	f.Sleep(d)
	c := make(chan time.Time, 1)
	c <- f.Now()
	return c
}

func (f *fastFake) NewTicker(d time.Duration) Ticker {
	return newFakeTicker(f, d)
}

// A slow clock doesn't return from Sleep calls until Advance has been called
// enough.
func NewSlow(from Clock) Fake {
	if from == nil {
		from = Real
	}

	return NewSlowAt(from.Now())
}

func NewSlowAt(t time.Time) Fake {
	return &slowFake{t: t}
}

type slowFake struct {
	t        time.Time
	mutex    sync.RWMutex
	sleepers []*slowSleeper
}

type slowSleeper struct {
	until time.Time
	done  chan<- time.Time
}

func (f *slowFake) Now() time.Time {
	f.mutex.RLock()
	defer f.mutex.RUnlock()
	t := f.t
	return t
}

func (f *slowFake) Sleep(d time.Duration) {
	<-f.After(d)
}

func (f *slowFake) Advance(d time.Duration) {
	f.mutex.Lock()
	defer f.mutex.Unlock()

	t2 := f.t.Add(d)
	var newSleepers []*slowSleeper
	for _, s := range f.sleepers {
		if t2.Sub(s.until) >= 0 {
			s.done <- t2
		} else {
			newSleepers = append(newSleepers, s)
		}
	}

	f.sleepers = newSleepers
	f.t = t2
}

func (f *slowFake) After(d time.Duration) <-chan time.Time {
	f.mutex.Lock()
	defer f.mutex.Unlock()

	done := make(chan time.Time, 1)
	if d == 0 {
		done <- f.t
		return done
	}

	s := &slowSleeper{
		until: f.t.Add(d),
		done:  done,
	}

	f.sleepers = append(f.sleepers, s)
	return done
}

func (f *slowFake) NewTicker(d time.Duration) Ticker {
	return newFakeTicker(f, d)
}

type fakeTicker struct {
	clock    Clock
	c        chan time.Time
	stopChan chan struct{}
}

func newFakeTicker(c Clock, d time.Duration) Ticker {
	ft := &fakeTicker{
		clock:    c,
		c:        make(chan time.Time, 1),
		stopChan: make(chan struct{}),
	}
	go ft.tickLoop(d)
	return ft
}

func (ft *fakeTicker) tickLoop(d time.Duration) {
	for {
		ft.clock.Sleep(d)
		select {
		case ft.c <- ft.clock.Now():
		case <-ft.stopChan:
			return
		}
	}
}

func (ft *fakeTicker) C() <-chan time.Time {
	return ft.c
}

func (ft *fakeTicker) Stop() {
	close(ft.stopChan)
}

// © 2015 Jonathan Boulle   Apache 2.0 License


text:
@interface PodsDummy_CMTools : NSObject
@end
@implementation PodsDummy_CMTools
@end


text:
package org.keycloak.storage.ldap;

import org.jboss.logging.Logger;
import org.keycloak.common.util.MultivaluedHashMap;
import org.keycloak.component.ComponentModel;
import org.keycloak.storage.ldap.idm.store.ldap.LDAPIdentityStore;
import org.keycloak.storage.ldap.mappers.LDAPConfigDecorator;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Marek Posolda
 */
public class LDAPIdentityStoreRegistry {

    private static final Logger logger = Logger.getLogger(LDAPIdentityStoreRegistry.class);

    private Map<String, LDAPIdentityStoreContext> ldapStores = new ConcurrentHashMap<>();

    public LDAPIdentityStore getLdapStore(ComponentModel ldapModel, Map<ComponentModel, LDAPConfigDecorator> configDecorators) {
        LDAPIdentityStoreContext context = ldapStores.get(ldapModel.getId());

        // Ldap config might have changed for the realm. In this case, we must re-initialize
        MultivaluedHashMap<String, String> configModel = ldapModel.getConfig();
        LDAPConfig ldapConfig = new LDAPConfig(configModel);
        for (Map.Entry<ComponentModel, LDAPConfigDecorator> entry : configDecorators.entrySet()) {
            ComponentModel mapperModel = entry.getKey();
            LDAPConfigDecorator decorator = entry.getValue();

            decorator.updateLDAPConfig(ldapConfig, mapperModel);
        }

        if (context == null || !ldapConfig.equals(context.config)) {
            logLDAPConfig(ldapModel.getName(), ldapConfig);

            LDAPIdentityStore store = createLdapIdentityStore(ldapConfig);
            context = new LDAPIdentityStoreContext(ldapConfig, store);
            ldapStores.put(ldapModel.getId(), context);
        }
        return context.store;
    }

    // Don't log LDAP password
    private void logLDAPConfig(String fedProviderDisplayName, LDAPConfig ldapConfig) {
        logger.infof("Creating new LDAP Store for the LDAP storage provider: '%s', LDAP Configuration: %s", fedProviderDisplayName, ldapConfig.toString());
    }

    /**
     * Create LDAPIdentityStore to be cached in the local registry
     */
    public static LDAPIdentityStore createLdapIdentityStore(LDAPConfig cfg) {
        checkSystemProperty("com.sun.jndi.ldap.connect.pool.authentication", "none simple");
        checkSystemProperty("com.sun.jndi.ldap.connect.pool.initsize", "1");
        checkSystemProperty("com.sun.jndi.ldap.connect.pool.maxsize", "1000");
        checkSystemProperty("com.sun.jndi.ldap.connect.pool.prefsize", "5");
        checkSystemProperty("com.sun.jndi.ldap.connect.pool.timeout", "300000");
        checkSystemProperty("com.sun.jndi.ldap.connect.pool.protocol", "plain");
        checkSystemProperty("com.sun.jndi.ldap.connect.pool.debug", "off");

        return new LDAPIdentityStore(cfg);
    }

    private static void checkSystemProperty(String name, String defaultValue) {
        if (System.getProperty(name) == null) {
            System.setProperty(name, defaultValue);
        }
    }

    private class LDAPIdentityStoreContext {

        private LDAPIdentityStoreContext(LDAPConfig config, LDAPIdentityStore store) {
            this.config = config;
            this.store = store;
        }

        private LDAPConfig config;
        private LDAPIdentityStore store;
    }
}


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

import java.math.*;

import javax.annotation.Generated;

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

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

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

    public GetContactResult unmarshall(JsonUnmarshallerContext context) throws Exception {
        GetContactResult getContactResult = new GetContactResult();

        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 getContactResult;
        }

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

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("ContactArn", targetDepth)) {
                    context.nextToken();
                    getContactResult.setContactArn(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("Alias", targetDepth)) {
                    context.nextToken();
                    getContactResult.setAlias(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("DisplayName", targetDepth)) {
                    context.nextToken();
                    getContactResult.setDisplayName(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("Type", targetDepth)) {
                    context.nextToken();
                    getContactResult.setType(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("Plan", targetDepth)) {
                    context.nextToken();
                    getContactResult.setPlan(PlanJsonUnmarshaller.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 getContactResult;
    }

    private static GetContactResultJsonUnmarshaller instance;

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


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Matsush. Mycol. Mem. 7: 57 (1993)

#### Original name
Monodictys peruviana Matsush.

### Remarks
null


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link rel="shortcut icon" type="image/x-icon" href="../../../../../../favicon.ico" />
<title>RecoveryDecision | Android Developers</title>

<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
<link href="../../../../../../assets/css/default.css" rel="stylesheet" type="text/css">

<link href="../../../../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">

          	Quicknav
			      Quicknav

                  Design

Develop

Distribute

Links

Google Play Developer Console

Android Developers Blog

About Android

Android Sites

Android.com

Android Developers

Android Open Source Project

Languages

          <select name="language" onChange="changeLangPref(this.value, true)">
              <option value="en">English</option>
              <option value="es">Español</option>
              <option value="ja">日本語</option>
              <option value="ko">한국어</option>
              <option value="ru">Русский</option>
              <option value="zh-CN">中文 (中国)</option>
              <option value="zh-TW">中文 (台灣)</option>
          </select>

      <form onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../../../../')"
onkeyup="return search_changed(event, false, '../../../../../../')" />
      </form>

        close

Get Started

Style

Patterns

Building Blocks

Downloads

Videos

Training

API Guides

Reference

Tools

Get the SDK

Google Services

Google Play

Publishing

Promoting

App Quality

Spotlight

Open Distribution

Results

Loading...

Training

API Guides

Reference

Tools

Google Services

to top

          API level:

            <select id="apiLevelSelector">

            </select>

Android APIs

  com.google.android.gms

  com.google.android.gms.ads

  com.google.android.gms.ads.identifier

  com.google.android.gms.ads.mediation

  com.google.android.gms.ads.mediation.admob

  com.google.android.gms.ads.mediation.customevent

  com.google.android.gms.appstate

  com.google.android.gms.auth

  com.google.android.gms.common

  com.google.android.gms.common.data

  com.google.android.gms.common.images

  com.google.android.gms.games

  com.google.android.gms.games.achievement

  com.google.android.gms.games.leaderboard

  com.google.android.gms.games.multiplayer

  com.google.android.gms.games.multiplayer.realtime

  com.google.android.gms.gcm

  com.google.android.gms.location

  com.google.android.gms.maps

  com.google.android.gms.maps.model

  com.google.android.gms.panorama

  com.google.android.gms.plus

  com.google.android.gms.plus.model.moments

  com.google.android.gms.plus.model.people

  com.google.android.gms.wallet

Classes

GoogleAuthUtil

RecoveryDecision

Exceptions

GoogleAuthException

GooglePlayServicesAvailabilityException

UserRecoverableAuthException

UserRecoverableNotifiedException

      fullscreen
      Use Tree NavigationUse Panel Navigation

Summary:

  Inherited Constants

  | Fields

  | Ctors

  | Methods

  | Inherited Methods

| [Expand All]

    public

    class

RecoveryDecision

    extends Object

      implements

        Parcelable

        java.lang.Object

               ↳

        com.google.android.gms.auth.RecoveryDecision

Summary

  [Expand]

Inherited Constants

  From interface
android.os.Parcelable

        int
        CONTENTS_FILE_DESCRIPTOR

        int
        PARCELABLE_WRITE_RETURN_VALUE

Fields

          <nobr>
          public
          static
          final
          RecoveryDecisionCreator</nobr>
          CREATOR

          <nobr>
          public

          boolean</nobr>
          isRecoveryInfoNeeded
          Is true if either the account has no recovery information or it
 was updated long time back (controlled by server, default 1 year).

          <nobr>
          public

          boolean</nobr>
          isRecoveryInterstitialAllowed
          Is true iff the user has permission to update the account.

          <nobr>
          public

          PendingIntent</nobr>
          recoveryIntent
          A PendingIntent to an activity that gathers recovery information for the given account.

          <nobr>
          public

          PendingIntent</nobr>
          recoveryIntentWithoutIntro
          A PendingIntent to an activity that gathers recovery information for the given account.

          <nobr>
          public

          boolean</nobr>
          showRecoveryInterstitial
          Represents the decision and should be obeyed by the client.

Public Constructors

        <nobr>

            </nobr>

        <nobr>
        RecoveryDecision()</nobr>

Public Methods

        <nobr>

            int</nobr>

        <nobr>
        describeContents()</nobr>

        <nobr>

            int</nobr>

        <nobr>
        getVersionCode()</nobr>

        <nobr>

            void</nobr>

        <nobr>
        writeToParcel(Parcel out, int flags)</nobr>

  [Expand]

Inherited Methods

From class

  java.lang.Object

        <nobr>

            Object</nobr>

        <nobr>
        clone()</nobr>

        <nobr>

            boolean</nobr>

        <nobr>
        equals(Object arg0)</nobr>

        <nobr>

            void</nobr>

        <nobr>
        finalize()</nobr>

        <nobr>

            final

            Class<?></nobr>

        <nobr>
        getClass()</nobr>

        <nobr>

            int</nobr>

        <nobr>
        hashCode()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        notify()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        notifyAll()</nobr>

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long arg0, int arg1)</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long arg0)</nobr>

From interface

  android.os.Parcelable

        <nobr>
            abstract

            int</nobr>

        <nobr>
        describeContents()</nobr>

        <nobr>
            abstract

            void</nobr>

        <nobr>
        writeToParcel(Parcel arg0, int arg1)</nobr>

Fields

        public
        static
        final
        RecoveryDecisionCreator

        CREATOR

        public

        boolean

        isRecoveryInfoNeeded

Is true if either the account has no recovery information or it
 was updated long time back (controlled by server, default 1 year).

        public

        boolean

        isRecoveryInterstitialAllowed

Is true iff the user has permission to update the account.
 Dasher accounts can have recovery information edit disabled by the administrator.
 Eg: @google.com

        public

        PendingIntent

        recoveryIntent

A PendingIntent to an activity that gathers recovery information for the given account.
 This intent will be null iff isRecoveryInterstitialAllowed is false.

        public

        PendingIntent

        recoveryIntentWithoutIntro

A PendingIntent to an activity that gathers recovery information for the given account.
 This intent will be null iff isRecoveryInterstitialAllowed is false.
 This intent directly skips to the input activity without showing the intro message.

        public

        boolean

        showRecoveryInterstitial

Represents the decision and should be obeyed by the client. The remaining
 two flags are provided as additional information for one off decisions. This value
 is true iff isRecoveryInfoNeeded is true, isRecoveryInterstitialAllowed is
 true and a specified period (controlled by server, default 2 months) has passed
 since the user was shown a prompt for recovery information on any google property
 (Android, Web, etc.)

Public Constructors

        public

      RecoveryDecision
      ()

Public Methods

        public

        int

      describeContents
      ()

        public

        int

      getVersionCode
      ()

        public

        void

      writeToParcel
      (Parcel out, int flags)

  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the
  Content License.

    Android  r — 25 Oct 2013 17:03

    About Android  |
    Legal  |
    Support


text:
#ifndef FUNCTIONMANAGER_H
#define FUNCTIONMANAGER_H

#include <QStringList>
#include <QQuickView>
#include <QQuickItem>
#include <QObject>

#include "scenevalue.h"
#include "treemodel.h"

class Doc;
class Function;
class SceneEditor;
class FunctionEditor;
class GenericDMXSource;

typedef struct
{
    quint32 m_fID;
    QQuickItem *m_item;
} selectedFunction;

class FunctionManager : public QObject
{
    Q_OBJECT

    Q_PROPERTY(quint32 startupFunctionID READ startupFunctionID WRITE setStartupFunctionID NOTIFY startupFunctionIDChanged)

    Q_PROPERTY(QVariant functionsList READ functionsList NOTIFY functionsListChanged)
    Q_PROPERTY(int functionsFilter READ functionsFilter CONSTANT)
    Q_PROPERTY(QString searchFilter READ searchFilter WRITE setSearchFilter NOTIFY searchFilterChanged)
    Q_PROPERTY(int selectedFunctionCount READ selectedFunctionCount NOTIFY selectedFunctionCountChanged)
    Q_PROPERTY(int selectedFolderCount READ selectedFolderCount NOTIFY selectedFolderCountChanged)
    Q_PROPERTY(bool isEditing READ isEditing NOTIFY isEditingChanged)
    Q_PROPERTY(int viewPosition READ viewPosition WRITE setViewPosition NOTIFY viewPositionChanged)

    Q_PROPERTY(int sceneCount READ sceneCount NOTIFY sceneCountChanged)
    Q_PROPERTY(int chaserCount READ chaserCount NOTIFY chaserCountChanged)
    Q_PROPERTY(int sequenceCount READ sequenceCount NOTIFY sequenceCountChanged)
    Q_PROPERTY(int efxCount READ efxCount NOTIFY efxCountChanged)
    Q_PROPERTY(int collectionCount READ collectionCount NOTIFY collectionCountChanged)
    Q_PROPERTY(int rgbMatrixCount READ rgbMatrixCount NOTIFY rgbMatrixCountChanged)
    Q_PROPERTY(int scriptCount READ scriptCount NOTIFY scriptCountChanged)
    Q_PROPERTY(int showCount READ showCount NOTIFY showCountChanged)
    Q_PROPERTY(int audioCount READ audioCount NOTIFY audioCountChanged)
    Q_PROPERTY(int videoCount READ videoCount NOTIFY videoCountChanged)

    Q_PROPERTY(QStringList audioExtensions READ audioExtensions CONSTANT)
    Q_PROPERTY(QStringList pictureExtensions READ pictureExtensions CONSTANT)
    Q_PROPERTY(QStringList videoExtensions READ videoExtensions CONSTANT)

    Q_PROPERTY(bool previewEnabled READ previewEnabled WRITE setPreviewEnabled NOTIFY previewEnabledChanged)

public:
    FunctionManager(QQuickView *view, Doc *doc, QObject *parent = 0);
    ~FunctionManager();

    quint32 startupFunctionID() const;
    void setStartupFunctionID(quint32 fid);

signals:
    void startupFunctionIDChanged();

    /*********************************************************************
     * Functions
     *********************************************************************/
public:
    /** Read only property to expose the function tree to the QML UI */
    QVariant functionsList();

    /** Get a list of Functions that use $fid */
    Q_INVOKABLE QVariantList usageList(quint32 fid);

    /** Get a list of the currently selected Function IDs, suitable to be used in QML */
    Q_INVOKABLE QVariantList selectedFunctionsID();

    /** Get a list of the currently selected item names, suitable to be used in QML */
    Q_INVOKABLE QStringList selectedItemNames();

    /** Enable/disable the display of a Function type in the functions tree */
    Q_INVOKABLE void setFunctionFilter(quint32 filter, bool enable);
    int functionsFilter() const;

    /** Get/Set a string to filter Function names */
    QString searchFilter() const;
    void setSearchFilter(QString searchFilter);

    /** Create a new Function with the specified $type
      * If the optional fixturesList is provided, fixture IDs
      * will be added to the Function where possible.
      */
    Q_INVOKABLE quint32 createFunction(int type, QVariantList fixturesList = QVariantList());

    /** Create a new Audio/Video Function for each
     *  file path provided in fileList.
     */
    Q_INVOKABLE quint32 createAudioVideoFunction(int type, QStringList fileList = QStringList());

    /** Return a reference to a Function with the specified $id */
    Q_INVOKABLE Function *getFunction(quint32 id);

    /** Return the associated qrc icon resource for the specified Function $type */
    Q_INVOKABLE QString functionIcon(int type);

    Q_INVOKABLE QString functionPath(quint32 id);

    /** Enable/disable the Function preview feature */
    bool previewEnabled() const;
    void setPreviewEnabled(bool enable);

    /** Add $fID to the list of the currently selected Function IDs,
     *  considering $multiSelection as an append/replace action */
    Q_INVOKABLE void selectFunctionID(quint32 fID, bool multiSelection);

    /** Get the QML resource for a Function editor that can edit $funcID */
    Q_INVOKABLE QString getEditorResource(int funcID);

    /** Set $fID as the current Function ID being edited */
    Q_INVOKABLE void setEditorFunction(quint32 fID, bool requestUI, bool back);

    /** Return a reference of the currently open Function editor */
    FunctionEditor *currentEditor() const;

    /** Returns if the UI is editing a Function */
    bool isEditing() const;

    void deleteFunction(quint32 fid);

    /** Delete the list of Function IDs in $IDList. This happens AFTER a popup confirmation */
    Q_INVOKABLE void deleteFunctions(QVariantList IDList);

    /** Move the currently selected Function to the specified $newPath */
    Q_INVOKABLE void moveFunctions(QString newPath);

    /** Clone the currently selected Functions */
    Q_INVOKABLE void cloneFunctions();

    /** Generic method to delete a list of item IDs specified in $list.
     *  This is used from within a Function editor and items can be of any type
     *  such as Functions, Fixtures, etc. as long as they have an ID.
     *  This happens AFTER a popup confirmation */
    Q_INVOKABLE void deleteEditorItems(QVariantList list);

    /** Rename the currently selected items (functions and/or folders)
     *  with the provided $newName.
     *  If $numbering is true, then $startNumber and $digits will compose
     *  a progress number following $newName */
    Q_INVOKABLE void renameSelectedItems(QString newName, bool numbering, int startNumber, int digits);

    /** Returns the number of the currently selected Functions */
    int selectedFunctionCount() const;

    int sceneCount() const { return m_sceneCount; }
    int chaserCount() const { return m_chaserCount; }
    int sequenceCount() const { return m_sequenceCount; }
    int efxCount() const { return m_efxCount; }
    int collectionCount() const { return m_collectionCount; }
    int rgbMatrixCount() const { return m_rgbMatrixCount; }
    int scriptCount() const { return m_scriptCount; }
    int showCount() const { return m_showCount; }
    int audioCount() const { return m_audioCount; }
    int videoCount() const { return m_videoCount; }

    QStringList audioExtensions() const;
    QStringList pictureExtensions() const;
    QStringList videoExtensions() const;

    void setViewPosition(int viewPosition);
    int viewPosition() const;

protected:
    quint32 addFunctiontoDoc(Function *func, QString name, bool select);
    void addFunctionTreeItem(Function *func);
    void updateFunctionsTree();
    void clearTree();
    void moveFunction(quint32 fID, QString newPath);

signals:
    void functionsListChanged();
    void searchFilterChanged();
    void sceneCountChanged();
    void chaserCountChanged();
    void sequenceCountChanged();
    void efxCountChanged();
    void collectionCountChanged();
    void rgbMatrixCountChanged();
    void scriptCountChanged();
    void showCountChanged();
    void audioCountChanged();
    void videoCountChanged();
    void selectedFunctionCountChanged(int count);
    void previewEnabledChanged();
    void isEditingChanged(bool editing);
    void viewPositionChanged(int viewPosition);

public slots:
    void slotDocLoaded();
    void slotFunctionAdded(quint32 fid);

private:
    /** Reference of the QML view */
    QQuickView *m_view;
    /** Reference of the project workspace */
    Doc *m_doc;
    /** Reference to the Functions tree model */
    TreeModel *m_functionTree;
    /** The QML ListView position in pixel for state restoring */
    int m_viewPosition;

    /** Flag that hold if Functions preview is enabled or not */
    bool m_previewEnabled;

    /** List of the Function IDs currently selected
     *  and previewed, if preview is enabled */
    QVariantList m_selectedIDList;

    quint32 m_filter;
    QString m_searchFilter;

    int m_sceneCount, m_chaserCount, m_sequenceCount, m_efxCount;
    int m_collectionCount, m_rgbMatrixCount, m_scriptCount;
    int m_showCount, m_audioCount, m_videoCount;

    FunctionEditor *m_currentEditor;
    FunctionEditor *m_sceneEditor;

    /*********************************************************************
     * Folders
     *********************************************************************/
public:
    /** Select a folder with the given $path */
    Q_INVOKABLE void selectFolder(QString path, bool multiSelection);

    /** Return the number of currently selected folders */
    int selectedFolderCount() const;

    /** Change the path of an existing folder and all its children */
    Q_INVOKABLE void setFolderPath(QString oldAbsPath, QString newPath, bool isRelative);

    /** Create an empty folder with path starting from the currently
     *  selected item */
    Q_INVOKABLE void createFolder();

    /** Delete the currently selected folders. If a folder is not empty,
     *  delete also all the sub items in it */
    Q_INVOKABLE void deleteSelectedFolders();

signals:
    void selectedFolderCountChanged(int count);

private:
    /** List of the folder paths that don't include any Function yet */
    QStringList m_emptyFolderList;
    /** List of the folders currently selected */
    QStringList m_selectedFolderList;

    /*********************************************************************
     * DMX values (dumping and Scene editor)
     *********************************************************************/
public:

    /** Return the currently set channel values */
    QList <SceneValue> dumpValues() const;

    /** Reset the currently set channel values */
    void resetDumpValues();

    /** Dump DMX values provided by $dumpValues, filtered by the provided $selectedFixtures
     *  and the provided $channelMask.
     *  The new Scene will be named with $name if not empty, otherwise with an autogenerated name */
    void dumpOnNewScene(QList<SceneValue> dumpValues, QList<quint32> selectedFixtures,
                        quint32 channelMask, QString name);

    /** Dump DMX values provided by $dumpValues, filtered by the provided $selectedFixtures
     *  and the provided $channelMask. Values are dumped on an existing Scene with $sceneID */
    void dumpOnScene(QList<SceneValue> dumpValues, QList<quint32> selectedFixtures,
                     quint32 channelMask, quint32 sceneID);

    Q_INVOKABLE void setChannelValue(quint32 fxID, quint32 channel, uchar value);

protected:
    quint32 getChannelTypeMask(quint32 fxID, quint32 channel);
};

#endif // FUNCTIONMANAGER_H


text:
..  Copyright (c) 2014-present PlatformIO <contact@platformio.org>
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
       http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

.. _board_teensy_teensy2:

Teensy 2.0
==========

.. contents::

Hardware
--------

Platform :ref:`platform_teensy`: Teensy is a complete USB-based microcontroller development system, in a very small footprint, capable of implementing many types of projects. All programming is done via the USB port. No special programmer is needed, only a standard USB cable and a PC or Macintosh with a USB port.

.. list-table::

  * - **Microcontroller**
    - ATMEGA32U4
  * - **Frequency**
    - 16MHz
  * - **Flash**
    - 31.50KB
  * - **RAM**
    - 2.50KB
  * - **Vendor**
    - `Teensy <https://www.pjrc.com/store/teensy.html?utm_source=platformio.org&utm_medium=docs>`__

Configuration
-------------

Please use ``teensy2`` ID for :ref:`projectconf_env_board` option in :ref:`projectconf`:

.. code-block:: ini

  [env:teensy2]
  platform = teensy
  board = teensy2

You can override default Teensy 2.0 settings per build environment using
``board_***`` option, where ``***`` is a JSON object path from
board manifest `teensy2.json <https://github.com/platformio/platform-teensy/blob/master/boards/teensy2.json>`_. For example,
``board_build.mcu``, ``board_build.f_cpu``, etc.

.. code-block:: ini

  [env:teensy2]
  platform = teensy
  board = teensy2

  ; change microcontroller
  board_build.mcu = atmega32u4

  ; change MCU frequency
  board_build.f_cpu = 16000000L

Uploading
---------
Teensy 2.0 supports the following uploading protocols:

* ``teensy-cli``
* ``teensy-gui``

Default protocol is ``teensy-gui``

You can change upload protocol using :ref:`projectconf_upload_protocol` option:

.. code-block:: ini

  [env:teensy2]
  platform = teensy
  board = teensy2

  upload_protocol = teensy-gui

Debugging
---------
:ref:`piodebug` currently does not support Teensy 2.0 board.

Frameworks
----------
.. list-table::
    :header-rows:  1

    * - Name
      - Description

    * - :ref:`framework_arduino`
      - Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences


text:
from django.db import models

class Bar(models.Model):
    name = models.CharField(max_length=255)

    class Meta:
        app_label = 'app_waiting_migration'


text:
package br.unb.cic.iris.persistence.test;

import static br.unb.cic.iris.model.IrisFolder.INBOX;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import br.unb.cic.iris.core.IrisServiceLocator;
import br.unb.cic.iris.model.EntityFactory;
import br.unb.cic.iris.model.IrisFolder;
import br.unb.cic.iris.persistence.FolderDAO;
import br.unb.cic.iris.persistence.IrisPersistenceException;

@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public abstract class FolderDaoTest {
	protected static FolderDAO dao;
	protected static EntityFactory entityFactory;

	static String ID;

	@BeforeClass
	public static void runOnceBeforeClass() {
		dao = IrisServiceLocator.instance().getDaoFactory().createFolderDAO();
		entityFactory = IrisServiceLocator.instance().getEntityFactory();
		assertNotNull("Folder DAO shouldn't be null", dao);
	}

	@Test
	public void test01SaveFolder() throws IrisPersistenceException{
		System.out.println("testSaveFolder");
		IrisFolder folder = dao.createFolder(INBOX);
		System.out.println("Folder created: "+folder.getId());
		assertNotNull("Folder shouldn't be null", folder);
		assertNotNull("Folder ID shouldn't be null", folder.getId());
		ID = folder.getId();
	}

	@Test(expected=IrisPersistenceException.class)
	public void test01SaveFolderFailBlankName() throws IrisPersistenceException{
		System.out.println("testSaveFolderFailBlankName");
		IrisFolder folder = dao.createFolder("");
		assertNull("Folder should be null", folder);
	}

	@Test(expected=IrisPersistenceException.class)
	public void test01SaveFolderFailNullName() throws IrisPersistenceException{
		System.out.println("testSaveFolderFailNullName");
		IrisFolder folder = dao.createFolder(null);
		assertNull("Folder should be null", folder);
	}

	@Test(expected=IrisPersistenceException.class)
	public void test01SaveFolderFailSpaceName() throws IrisPersistenceException{
		System.out.println("testSaveFolderFailSpaceName");
		IrisFolder folder = dao.createFolder(" ");
		assertNull("Folder should be null", folder);
	}

	@Test
	public void test02FindByName() throws IrisPersistenceException {
		System.out.println("testFindByName");
		try {
			dao.createFolder(INBOX);
		} catch (IrisPersistenceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		IrisFolder folder = dao.findByName(INBOX);
		assertNotNull("Folder shouldn't be null", folder);
		assertEquals("Folder name should be: "+INBOX, INBOX, folder.getName());
	}

	//@Test(expected=IrisPersistenceException.class)
	@Test(expected=NullPointerException.class)
	public void test02FindByNameFailNullName() throws IrisPersistenceException {
		System.out.println("testFindByNameFailNullName");
		IrisFolder folder = dao.findByName(null);
		assertNull("Folder should be null", folder);
	}

	@Test
	public void test03FindByID() throws IrisPersistenceException {
		System.out.println("testFindByID");
		IrisFolder folder = dao.findById(ID);
		assertNotNull("Folder shouldn't be null", folder);
		assertEquals("Folder ID should be: "+ID, ID, folder.getId());
		assertEquals("Folder name should be: "+INBOX, INBOX, folder.getName());
	}
}


text:
/* globals google */
/* eslint-disable no-unused-vars */

import { config } from '../config';
import MediatorEvents from '../enums/mediatorEvents';
import MediatorEventModel from '../models/mediatorEventModel';

export default class AbstractPinStrategy {
    generateMultiplePins( pinsArray, pinType, holidayType ) {
        const pins = [];

        if ( pinsArray === undefined ) {
            pinsArray = config.pins.data;
        }

        pinsArray.forEach( ( pin ) => {
            if ( pin.type === pinType ) {
                pins.push( this._generatePin( pin ) );
            }
        } );

        return pins;
    }

    generateMultipleContent( pinsArray, pinType ) {
        const views = [];

        if ( pinsArray === undefined ) {
            pinsArray = config.pins.data;
        }

        pinsArray.forEach( ( pin ) => {
            if ( pin.type === pinType ) {
                if ( pin.view === undefined ) {
                    this._generateView( pin );

                    if ( pin.view !== null ) {
                        views.push( pin.view );
                    }
                } else {
                    views.push( pin.view );
                }
            }
        } );

        return views;
    }

    generateDetailsContent( pin ) {
        return this._generateDetailsView( pin );
    }

    onPinClick( pin ) {
        const activePin = config.pins.activePin;

        if ( activePin && activePin.marker ) {
            activePin.marker.classList.remove( 'is-active' );
        }

        if ( pin && pin.marker ) {
            pin.marker.classList.add( 'is-active' );
        }

        const mediatorEvent = new MediatorEventModel();
        mediatorEvent.eventType = MediatorEvents.pinClicked;
        mediatorEvent.targetPin = pin;

        config.mediator.stateChanged( mediatorEvent );
    }

    onPinMouseover( pin ) {
        if ( !pin ) return;

        if ( pin.marker ) {
            pin.marker.classList.add( 'is-hover' );
            pin.richMarker.setPosition( new google.maps.LatLng(pin.lat || 0, pin.lng || 0) );
        }

        if ( pin.view ) {
            pin.view.classList.add( 'is-hover' );
        }
    }

    onPinMouseout( pin ) {
        if ( !pin ) return;

        if ( pin.marker ) {
            pin.marker.classList.remove( 'is-hover' );
            pin.richMarker.setPosition( new google.maps.LatLng(pin.lat || 0, pin.lng || 0) );
        }

        if ( pin.view ) {
            pin.view.classList.remove( 'is-hover' );
        }
    }

    checkPinVisibility( pin ) {
        return true;
    }

    addActiveClass( pin ) {
        if ( pin && pin.marker ) {
            pin.marker.classList.add( 'is-active' );
            pin.richMarker.setPosition( new google.maps.LatLng(pin.lat || 0, pin.lng || 0) );
        }
    }

    removeActiveClass( pin ) {
        if ( pin && pin.marker ) {
            pin.marker.classList.remove( 'is-active' );
            pin.richMarker.setPosition( new google.maps.LatLng(pin.lat || 0, pin.lng || 0) );
        }
    }

    _generateContent( params ) {
        if ( !params.pin[params.key] ) {
            params.pin[params.key] = this._html2dom( params.template( params.pin ) );
        }

        return params.pin;
    }

    _generatePin() {
    }

    _generateView() {
    }

    _generateDetailsView() {
    }

    _html2dom( html ) {
        const container = document.createElement( 'div' );
        container.innerHTML = html;
        return container.firstChild;
    }
}


text:
<?php

use Kris\LaravelFormBuilder\Fields\ChoiceType;

class ChoiceTypeTest extends FormBuilderTestCase
{
    /** @test */
    public function it_creates_choice_as_select()
    {
        $options = [
            'attr' => ['class' => 'choice-class'],
            'choices' => ['yes' => 'Yes', 'no' => 'No'],
            'selected' => 'yes'
        ];

        $choice = new ChoiceType('some_choice', 'choice', $this->plainForm, $options);

        $choice->render();

        $this->assertEquals(1, count($choice->getChildren()));

        $this->assertEquals('yes', $choice->getOption('selected'));
    }

    /** @test */
    public function it_creates_choice_as_checkbox_list()
    {
        $options = [
            'attr' => ['class' => 'choice-class-something'],
            'choices' => [1 => 'monday', 2 => 'tuesday'],
            'selected' => 'tuesday',
            'multiple' => true,
            'expanded' => true
        ];

        $choice = new ChoiceType('some_choice', 'choice', $this->plainForm, $options);

        $choice->render();

        $this->assertEquals(2, count($choice->getChildren()));

        $this->assertEquals('tuesday', $choice->getOption('selected'));

        $this->assertContainsOnlyInstancesOf('Kris\LaravelFormBuilder\Fields\CheckableType', $choice->getChildren());
    }

    /** @test */
    public function it_creates_choice_as_radio_buttons()
    {
        $options = [
            'attr' => ['class' => 'choice-class-something'],
            'choices' => [1 => 'yes', 2 => 'no'],
            'selected' => 'no',
            'expanded' => true
        ];

        $choice = new ChoiceType('some_choice', 'choice', $this->plainForm, $options);

        $choice->render();

        $this->assertEquals(2, count($choice->getChildren()));

        $this->assertInstanceOf(
            'Kris\LaravelFormBuilder\Fields\CheckableType',
            $choice->getChild(1)
        );

        $this->assertEquals('no', $choice->getOption('selected'));

        $this->assertContainsOnlyInstancesOf('Kris\LaravelFormBuilder\Fields\CheckableType', $choice->getChildren());
    }

    /** @test */
    public function it_sets_proper_name_for_multiple()
    {
        $this->plainForm->add('users', 'select', [
            'choices' => [1 => 'user1', 2 => 'user2'],
            'attr' => [
                'multiple' => 'multple'
            ]
        ]);

        $this->plainForm->renderForm();

        $this->assertEquals('users[]', $this->plainForm->users->getName());
    }

    /** @test */
    public function it_can_override_choices()
    {
        $options = [
            'choices' => ['yes' => 'Yes', 'no' => 'No'],
            'selected' => 'test',
            'data_override' => function ($choices, $field) {
                $choices['test'] = 'test';

                return $choices;
            }
        ];

        $choice = new ChoiceType('some_choice', 'choice', $this->plainForm, $options);

        $choice->render();

        $this->assertEquals(3, count($choice->getOption('choices')));

        $this->assertEquals('test', $choice->getOption('selected'));
    }
}


text:
package grpc

import (
	"context"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestServer_ServeGRPC(t *testing.T) {
	assert.Equal(t, nil, nil)

	//test empty
	serviceEmpty := New(nil, nil, nil)
	assert.Equal(t, &Server{
		e:               nil,
		requestDecoder:  nil,
		responseEncoder: nil,
	}, serviceEmpty)

	//test dummy service
	emptyEndpoint := func(ctx context.Context, res interface{}) (response interface{}, err error) {
		return res, nil
	}
	decoder := func(ctx context.Context, i interface{}) (interface{}, error) {
		return i, nil
	}
	encoder := func(ctx context.Context, i interface{}) (interface{}, error) { return i, nil }
	serviceDummy := New(emptyEndpoint, decoder, encoder)
	serviceDummyNaive := &Server{
		e:               emptyEndpoint,
		requestDecoder:  decoder,
		responseEncoder: encoder,
	}
	decoderVal, _ := serviceDummy.requestDecoder(nil, "baju")
	decoderNaiveVal, _ := serviceDummyNaive.requestDecoder(nil, "baju")
	assert.Equal(t, decoderNaiveVal, decoderVal)

	decoderVal, _ = serviceDummy.responseEncoder(nil, "baju")
	decoderNaiveVal, _ = serviceDummyNaive.requestDecoder(nil, "baju")
	assert.Equal(t, decoderNaiveVal, decoderVal)

	_, res, _ := serviceDummy.ServeGRPC(context.Background(), "baju")
	assert.Equal(t, "baju", res)
}


text:
"""
.. _tut_reproduce_erf:

=======================
Computing ERFs from HCP
=======================

In this tutorial we compare different ways of arriving at event related
fields (ERF) starting from different HCP outputs. We will first reprocess
the HCP dat from scratch, then read the preprocessed epochs, finally
read the ERF files. Subsequently we will compare these outputs.
"""
# Author: Denis A. Engemann
# License: BSD 3 clause

import os.path as op

import numpy as np
import matplotlib.pyplot as plt
import mne
import hcp
import hcp.preprocessing as preproc

mne.set_log_level('WARNING')

# we assume our data is inside its designated folder under $HOME
storage_dir = op.expanduser('~')
hcp_params = dict(
    hcp_path=op.join(storage_dir, 'mne-hcp-data', 'HCP'),
    subject='105923',
    data_type='task_working_memory')

##############################################################################
# We first reprocess the data from scratch
#
# That is, almost from scratch. We're relying on the ICA solutions and
# data annotations.
#
# In order to arrive at the final ERF we need to pool over two runs.
# for each run we need to read the raw data, all annotations, apply
# the reference sensor compensation, the ICA, bandpass filter, baseline
# correction and decimation (downsampling)

# these values are looked up from the HCP manual
tmin, tmax = -1.5, 2.5
decim = 4
event_id = dict(face=1)
baseline = (-0.5, 0)

# we first collect events
trial_infos = list()
for run_index in [0, 1]:
    trial_info = hcp.read_trial_info(run_index=run_index, **hcp_params)
    trial_infos.append(trial_info)

# trial_info is a dict
# it contains a 'comments' vector that maps on the columns of 'codes'
# 'codes is a matrix with its length corresponding to the number of trials
print(trial_info['stim']['comments'][:10])  # which column?
print(set(trial_info['stim']['codes'][:, 3]))  # check values

# so according to this we need to use the column 7 (index 6)
# for the time sample and column 4 (index 3) to get the image types
# with this information we can construct our event vectors

all_events = list()
for trial_info in trial_infos:
    events = np.c_[
        trial_info['stim']['codes'][:, 6] - 1,  # time sample
        np.zeros(len(trial_info['stim']['codes'])),
        trial_info['stim']['codes'][:, 3]  # event codes
    ].astype(int)
    events = events[np.argsort(events[:, 0])]  # chronological order
    # for some reason in the HCP data the time events may not always be unique
    unique_subset = np.nonzero(np.r_[1, np.diff(events[:, 0])])[0]
    events = events[unique_subset]  # use diff to find first unique events

    all_events.append(events)

# now we can go ahead
evokeds = list()
for run_index, events in zip([0, 1], all_events):

    raw = hcp.read_raw(run_index=run_index, **hcp_params)
    raw.load_data()
    # apply ref channel correction and drop ref channels
    # preproc.apply_ref_correction(raw)

    annots = hcp.read_annot(run_index=run_index, **hcp_params)
    # construct MNE annotations
    bad_seg = (annots['segments']['all']) / raw.info['sfreq']
    annotations = mne.Annotations(
        bad_seg[:, 0], (bad_seg[:, 1] - bad_seg[:, 0]),
        description='bad')

    raw.annotations = annotations
    raw.info['bads'].extend(annots['channels']['all'])
    raw.pick_types(meg=True, ref_meg=False)

    #  Note: MNE complains on Python 2.7
    raw.filter(0.50, None, method='iir',
               iir_params=dict(order=4, ftype='butter'), n_jobs=1)
    raw.filter(None, 60, method='iir',
               iir_params=dict(order=4, ftype='butter'), n_jobs=1)

    # read ICA and remove EOG ECG
    # note that the HCP ICA assumes that bad channels have already been removed
    ica_mat = hcp.read_ica(run_index=run_index, **hcp_params)

    # We will select the brain ICs only
    exclude = annots['ica']['ecg_eog_ic']
    preproc.apply_ica_hcp(raw, ica_mat=ica_mat, exclude=exclude)

    # now we can epoch
    events = np.sort(events, 0)
    epochs = mne.Epochs(raw, events=events[events[:, 2] == 1],
                        event_id=event_id, tmin=tmin, tmax=tmax,
                        reject=None, baseline=baseline, decim=decim,
                        preload=True)

    evoked = epochs.average()
    # now we need to add back out channels for comparison across runs.
    evoked = preproc.interpolate_missing(evoked, **hcp_params)
    evokeds.append(evoked)
    del epochs, raw

##############################################################################
# Now we can compute the same ERF based on the preprocessed epochs
#
# These are obtained from the 'tmegpreproc' pipeline.
# Things are pythonized and simplified however, so

evokeds_from_epochs_hcp = list()

for run_index, events in zip([0, 1], all_events):

    unique_subset = np.nonzero(np.r_[1, np.diff(events[:, 0])])[0]
    # use diff to find first unique events
    this_events = events[unique_subset]
    subset = np.in1d(events[:, 2], event_id.values())

    epochs_hcp = hcp.read_epochs(run_index=run_index, **hcp_params)

    # subset epochs, add events and id
    epochs_hcp = epochs_hcp[unique_subset][subset]
    epochs_hcp.events[:, 2] = events[subset, 2]
    epochs_hcp.event_id = event_id

    evoked = epochs_hcp['face'].average()

    del epochs_hcp
    # These epochs have different channels.
    # We use a designated function to re-apply the channels and interpolate
    # them.

    evoked.baseline = baseline
    evoked.apply_baseline()
    evoked = preproc.interpolate_missing(evoked, **hcp_params)

    evokeds_from_epochs_hcp.append(evoked)

##############################################################################
# Finally we can read the actual official ERF file
#
# These are obtained from the 'eravg' pipelines.
# We read the matlab file, MNE-HCP is doing some conversions, and then we
# search our condition of interest. Here we're looking at the image as onset.
# and we want the average, not the standard deviation.

evoked_hcp = None
hcp_evokeds = hcp.read_evokeds(onset='stim', **hcp_params)

for ev in hcp_evokeds:
    if not ev.comment == 'Wrkmem_LM-TIM-face_BT-diff_MODE-mag':
        continue

# Once more we add and interpolate missing channels
evoked_hcp = preproc.interpolate_missing(ev, **hcp_params)

##############################################################################
# Time to compare the outputs
#

evoked = mne.combine_evoked(evokeds, weights='equal')
evoked_from_epochs_hcp = mne.combine_evoked(
    evokeds_from_epochs_hcp, weights='equal')

fig1, axes = plt.subplots(3, 1, figsize=(12, 8))

evoked.plot(axes=axes[0], show=False)
axes[0].set_title('MNE-HCP')

evoked_from_epochs_hcp.plot(axes=axes[1], show=False)
axes[1].set_title('HCP epochs')

evoked_hcp.plot(axes=axes[2], show=False)
axes[2].set_title('HCP evoked')
fig1.canvas.draw()

plt.show()

# now some correlations

plt.figure()
r1 = np.corrcoef(evoked_from_epochs_hcp.data.ravel(),
                 evoked_hcp.data.ravel())[0][1]
plt.plot(evoked_from_epochs_hcp.data.ravel()[::10] * 1e15,
         evoked_hcp.data.ravel()[::10] * 1e15,
         linestyle='None', marker='o', alpha=0.1,
         mec='orange', color='orange')
plt.annotate("r=%0.3f" % r1, xy=(-300, 250))
plt.ylabel('evoked from HCP epochs')
plt.xlabel('evoked from HCP evoked')
plt.show()

plt.figure()
r1 = np.corrcoef(evoked.data.ravel(), evoked_hcp.data.ravel())[0][1]
plt.plot(evoked.data.ravel()[::10] * 1e15,
         evoked_hcp.data.ravel()[::10] * 1e15,
         linestyle='None', marker='o', alpha=0.1,
         mec='orange', color='orange')
plt.annotate("r=%0.3f" % r1, xy=(-300, 250))
plt.ylabel('evoked from scratch with MNE-HCP')
plt.xlabel('evoked from HCP evoked file')
plt.show()


text:
#import "HUBActionHandlerMock.h"

#import "HUBActionContext.h"

NS_ASSUME_NONNULL_BEGIN

@interface HUBActionHandlerMock ()

@property (nonatomic, strong, readonly) NSMutableArray<id<HUBActionContext>> *mutableContexts;

@end

@implementation HUBActionHandlerMock

- (instancetype)init
{
    self = [super init];

    if (self) {
        _mutableContexts = [NSMutableArray new];
    }

    return self;
}

#pragma mark - Property overrides

- (NSArray<id<HUBActionContext>> *)contexts
{
    return [self.mutableContexts copy];
}

#pragma mark - HUBActionHandler

- (BOOL)handleActionWithContext:(id<HUBActionContext>)context
{
    if (self.block == nil) {
        return NO;
    }

    [self.mutableContexts addObject:context];

    return self.block(context);
}

@end

NS_ASSUME_NONNULL_END


text:
import { Component, OnInit } from '@angular/core';
import { Service383Service } from '../../services/service-383.service';

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

  constructor(private _service: Service383Service) { }

  ngOnInit() {
  }

}


text:
package utils

import (
	"fmt"
	"github.com/Sirupsen/logrus"
	"github.com/spf13/viper"
	"os"
	"os/exec"
)

// Convert yarn clustername to IP address
func Clustername2ip(clustername string) string {
	ip := viper.GetString("resource_managers." + clustername)
	return ip
}

//Execute the command
func Run_command(command string) {
	cmd := exec.Command("/bin/bash", "-c", command)
	out, err := cmd.CombinedOutput()
	if err != nil {
		fmt.Println(err)
	}
	if string(out) == "" {
		return
	}
	fmt.Println(string(out))
}

//Get a logger
func Logger() *logrus.Logger {
	logfile := "magpie.log"
	var logger = logrus.New()
	f, err := os.OpenFile(logfile, os.O_APPEND|os.O_RDWR, 0666)
	logger.Out = f
	if err != nil {
		os.Create(logfile)
		fmt.Println("Logfile", logfile, "not exist,created automatically.")
	}
	return logger
}


text:
//===--- Version.cpp - Swift Version Number -------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines several version-related utility functions for Swift.
//
//===----------------------------------------------------------------------===//

#include "clang/Basic/CharInfo.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/SmallString.h"
#include "swift/AST/DiagnosticsParse.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/Version.h"

#include <vector>

#define TOSTR2(X) #X
#define TOSTR(X) TOSTR2(X)

#ifdef SWIFT_VERSION_PATCHLEVEL
/// Helper macro for SWIFT_VERSION_STRING.
#define SWIFT_MAKE_VERSION_STRING(X, Y, Z) TOSTR(X) "." TOSTR(Y) "." TOSTR(Z)

/// A string that describes the Swift version number, e.g., "1.0".
#define SWIFT_VERSION_STRING                                                   \
  SWIFT_MAKE_VERSION_STRING(SWIFT_VERSION_MAJOR, SWIFT_VERSION_MINOR,          \
                            SWIFT_VERSION_PATCHLEVEL)
#else
/// Helper macro for SWIFT_VERSION_STRING.
#define SWIFT_MAKE_VERSION_STRING(X, Y) TOSTR(X) "." TOSTR(Y)

/// A string that describes the Swift version number, e.g., "1.0".
#define SWIFT_VERSION_STRING                                                   \
  SWIFT_MAKE_VERSION_STRING(SWIFT_VERSION_MAJOR, SWIFT_VERSION_MINOR)
#endif

#if __has_include("LLVMRevision.inc")
# include "LLVMRevision.inc"
#endif
#if __has_include("ClangRevision.inc")
# include "ClangRevision.inc"
#endif
#if __has_include("SwiftRevision.inc")
# include "SwiftRevision.inc"
#endif

namespace swift {
namespace version {

/// Print a string of the form "LLVM xxxxx, Clang yyyyy, Swift zzzzz",
/// where each placeholder is the revision for the associated repository.
static void printFullRevisionString(raw_ostream &out) {
  // Arbitrarily truncate to 10 characters. This should be enough to unique
  // Git hashes for the time being, and certainly enough for SVN revisions,
  // while keeping the version string from being ridiculously long.
#if defined(LLVM_REVISION)
  out << "LLVM " << StringRef(LLVM_REVISION).slice(0, 10);
# if defined(CLANG_REVISION) || defined(SWIFT_REVISION)
  out << ", ";
# endif
#endif

#if defined(CLANG_REVISION)
  out << "Clang " << StringRef(CLANG_REVISION).slice(0, 10);
# if defined(SWIFT_REVISION)
  out << ", ";
# endif
#endif

#if defined(SWIFT_REVISION)
  out << "Swift " << StringRef(SWIFT_REVISION).slice(0, 10);
#endif
}

void splitVersionComponents(
  SmallVectorImpl<std::pair<StringRef, SourceRange>> &SplitComponents,
                            StringRef &VersionString, SourceLoc Loc,
                            DiagnosticEngine *Diags, bool skipQuote = false) {
  SourceLoc Start = (Loc.isValid() && skipQuote) ? Loc.getAdvancedLoc(1) : Loc;
  SourceLoc End = Start;

  // Split the version string into tokens separated by the '.' character.
  while (!VersionString.empty()) {
    StringRef SplitComponent, Rest;
    std::tie(SplitComponent, Rest) = VersionString.split('.');

    if (Loc.isValid()) {
      End = End.getAdvancedLoc(SplitComponent.size());
    }
    auto Range = Loc.isValid() ? SourceRange(Start, End) : SourceRange();
    if (Loc.isValid())
      End = End.getAdvancedLoc(1);
    Start = End;
    SplitComponents.push_back({SplitComponent, Range});
    VersionString = Rest;
  }
}

Version Version::parseCompilerVersionString(
  StringRef VersionString, SourceLoc Loc, DiagnosticEngine *Diags) {

  Version CV;
  SmallString<16> digits;
  llvm::raw_svector_ostream OS(digits);
  SmallVector<std::pair<StringRef, SourceRange>, 5> SplitComponents;

  auto checkVersionComponent = [&](unsigned Component, SourceRange Range) {
    unsigned limit = CV.Components.size() == 0 ? 9223371 : 999;

    if (Component > limit) {
      if (Diags)
        Diags->diagnose(Range.Start,
                        diag::compiler_version_component_out_of_range, limit);
      else
        llvm_unreachable("Compiler version component out of range");
    }
  };

  splitVersionComponents(SplitComponents, VersionString, Loc, Diags,
                         /*skipQuote=*/true);

  uint64_t ComponentNumber;

  for (size_t i = 0; i < SplitComponents.size(); ++i) {
    StringRef SplitComponent;
    SourceRange Range;
    std::tie(SplitComponent, Range) = SplitComponents[i];

    // Version components can't be empty.
    if (SplitComponent.empty()) {
      if (Diags)
        Diags->diagnose(Range.Start, diag::empty_version_component);
      else
        llvm_unreachable("Found empty compiler version component");
      continue;
    }

    // The second version component isn't used for comparison.
    if (i == 1) {
      if (!SplitComponent.equals("*")) {
        if (Diags) {
          Diags->diagnose(Range.Start, diag::unused_compiler_version_component)
          .fixItReplaceChars(Range.Start, Range.End, "*");
        } else {
          llvm_unreachable("Expected * for second compiler version component");
        }
      }

      CV.Components.push_back(0);
      continue;
    }

    // All other version components must be numbers.
    if (!SplitComponent.getAsInteger(10, ComponentNumber)) {
      checkVersionComponent(ComponentNumber, Range);
      CV.Components.push_back(ComponentNumber);
      continue;
    } else if (Diags) {
      Diags->diagnose(Range.Start,
                      diag::version_component_not_number);
    } else {
      llvm_unreachable("Invalid character in _compiler_version condition");
    }
  }

  if (CV.Components.size() > 5) {
    if (Diags) {
      Diags->diagnose(Loc, diag::compiler_version_too_many_components);
    } else {
      llvm_unreachable("Compiler version must not have more than 5 components");
    }
  }

  return CV;
}

Optional<Version> Version::parseVersionString(StringRef VersionString,
                                              SourceLoc Loc,
                                              DiagnosticEngine *Diags) {
  Version TheVersion;
  SmallString<16> digits;
  llvm::raw_svector_ostream OS(digits);
  SmallVector<std::pair<StringRef, SourceRange>, 5> SplitComponents;
  // Skip over quote character in string literal.

  if (VersionString.empty()) {
    if (Diags)
      Diags->diagnose(Loc, diag::empty_version_string);
    return None;
  }

  splitVersionComponents(SplitComponents, VersionString, Loc, Diags);

  uint64_t ComponentNumber;
  bool isValidVersion = true;

  for (size_t i = 0; i < SplitComponents.size(); ++i) {
    StringRef SplitComponent;
    SourceRange Range;
    std::tie(SplitComponent, Range) = SplitComponents[i];

    // Version components can't be empty.
    if (SplitComponent.empty()) {
      if (Diags)
        Diags->diagnose(Range.Start, diag::empty_version_component);

      isValidVersion = false;
      continue;
    }

    // All other version components must be numbers.
    if (!SplitComponent.getAsInteger(10, ComponentNumber)) {
      TheVersion.Components.push_back(ComponentNumber);
      continue;
    } else {
      if (Diags)
        Diags->diagnose(Range.Start,
                        diag::version_component_not_number);
      isValidVersion = false;
    }
  }

  return isValidVersion ? Optional<Version>(TheVersion) : None;
}

Version Version::getCurrentCompilerVersion() {
#ifdef SWIFT_COMPILER_VERSION
  auto currentVersion = Version::parseVersionString(
    SWIFT_COMPILER_VERSION, SourceLoc(), nullptr);
  assert(currentVersion.hasValue() &&
         "Embedded Swift language version couldn't be parsed: '"
         SWIFT_COMPILER_VERSION
         "'");
  return currentVersion.getValue();
#else
  return Version();
#endif
}

Version Version::getCurrentLanguageVersion() {
#ifndef SWIFT_VERSION_STRING
#error Swift language version is not set!
#endif
  auto currentVersion = Version::parseVersionString(
    SWIFT_VERSION_STRING, SourceLoc(), nullptr);
  assert(currentVersion.hasValue() &&
         "Embedded Swift language version couldn't be parsed: '"
         SWIFT_VERSION_STRING
         "'");
  return currentVersion.getValue();
}

raw_ostream &operator<<(raw_ostream &os, const Version &version) {
  if (version.empty())
    return os;
  os << version[0];
  for (size_t i = 1, e = version.size(); i != e; ++i)
    os << '.' << version[i];
  return os;
}

std::string
Version::preprocessorDefinition(StringRef macroName,
                                ArrayRef<uint64_t> componentWeights) const {
  uint64_t versionConstant = 0;

  for (size_t i = 0, e = std::min(componentWeights.size(), Components.size());
       i < e; ++i) {
    versionConstant += componentWeights[i] * Components[i];
  }

  std::string define("-D");
  llvm::raw_string_ostream(define) << macroName << '=' << versionConstant;
  // This isn't using stream.str() so that we get move semantics.
  return define;
}

bool
Version::isValidEffectiveLanguageVersion() const
{
  // Whitelist of backward-compatibility versions that we permit passing as
  // -swift-version <vers>
  char const *whitelist[] = {
    "3",
    "3.0",
  };
  for (auto const i : whitelist) {
    auto v = parseVersionString(i, SourceLoc(), nullptr);
    assert(v.hasValue());
    if (v == *this)
      return true;
  }
  return false;
}

bool operator>=(const class Version &lhs,
                const class Version &rhs) {

  // The empty compiler version represents the latest possible version,
  // usually built from the source repository.
  if (lhs.empty())
    return true;

  auto n = std::min(lhs.size(), rhs.size());

  for (size_t i = 0; i < n; ++i) {
    if (lhs[i] < rhs[i])
      return false;
    else if (lhs[i] > rhs[i])
      return true;
  }
  return lhs.size() >= rhs.size();
}

bool operator==(const class Version &lhs,
                const class Version &rhs) {
  if (lhs.size() != rhs.size())
    return false;
  for (size_t i = 0; i < lhs.size(); ++i) {
    if (lhs[i] != rhs[i])
      return false;
  }
  return true;
}

std::pair<unsigned, unsigned> getSwiftNumericVersion() {
  return { SWIFT_VERSION_MAJOR, SWIFT_VERSION_MINOR };
}

std::string getSwiftFullVersion(Version effectiveVersion) {
  std::string buf;
  llvm::raw_string_ostream OS(buf);

#ifdef SWIFT_VENDOR
  OS << SWIFT_VENDOR " ";
#endif

  OS << "Swift version " SWIFT_VERSION_STRING;
#ifndef SWIFT_COMPILER_VERSION
  OS << "-dev";
#endif

  if (!(effectiveVersion == Version::getCurrentLanguageVersion())) {
    OS << " effective-" << effectiveVersion;
  }

#if defined(SWIFT_COMPILER_VERSION)
  OS << " (swiftlang-" SWIFT_COMPILER_VERSION;
#if defined(CLANG_COMPILER_VERSION)
  OS << " clang-" CLANG_COMPILER_VERSION;
#endif
  OS << ")";
#elif defined(LLVM_REVISION) || defined(CLANG_REVISION) || \
      defined(SWIFT_REVISION)
  OS << " (";
  printFullRevisionString(OS);
  OS << ")";
#endif

  // Suppress unused function warning
  (void) printFullRevisionString;

  return OS.str();
}

} // end namespace version
} // end namespace swift


text:
package fakes

import (
	"sync"
	"time"

	"github.com/cloudfoundry/bosh-utils/logger"
)

type FakeLogger struct {
	DebugStub        func(string, string, ...interface{})
	debugMutex       sync.RWMutex
	debugArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}
	DebugWithDetailsStub        func(string, string, ...interface{})
	debugWithDetailsMutex       sync.RWMutex
	debugWithDetailsArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}
	ErrorStub        func(string, string, ...interface{})
	errorMutex       sync.RWMutex
	errorArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}
	ErrorWithDetailsStub        func(string, string, ...interface{})
	errorWithDetailsMutex       sync.RWMutex
	errorWithDetailsArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}
	FlushStub        func() error
	flushMutex       sync.RWMutex
	flushArgsForCall []struct {
	}
	flushReturns struct {
		result1 error
	}
	flushReturnsOnCall map[int]struct {
		result1 error
	}
	FlushTimeoutStub        func(time.Duration) error
	flushTimeoutMutex       sync.RWMutex
	flushTimeoutArgsForCall []struct {
		arg1 time.Duration
	}
	flushTimeoutReturns struct {
		result1 error
	}
	flushTimeoutReturnsOnCall map[int]struct {
		result1 error
	}
	HandlePanicStub        func(string)
	handlePanicMutex       sync.RWMutex
	handlePanicArgsForCall []struct {
		arg1 string
	}
	InfoStub        func(string, string, ...interface{})
	infoMutex       sync.RWMutex
	infoArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}
	ToggleForcedDebugStub        func()
	toggleForcedDebugMutex       sync.RWMutex
	toggleForcedDebugArgsForCall []struct {
	}
	UseRFC3339TimestampsStub        func()
	useRFC3339TimestampsMutex       sync.RWMutex
	useRFC3339TimestampsArgsForCall []struct {
	}
	WarnStub        func(string, string, ...interface{})
	warnMutex       sync.RWMutex
	warnArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeLogger) Debug(arg1 string, arg2 string, arg3 ...interface{}) {
	fake.debugMutex.Lock()
	fake.debugArgsForCall = append(fake.debugArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}{arg1, arg2, arg3})
	fake.recordInvocation("Debug", []interface{}{arg1, arg2, arg3})
	fake.debugMutex.Unlock()
	if fake.DebugStub != nil {
		fake.DebugStub(arg1, arg2, arg3...)
	}
}

func (fake *FakeLogger) DebugCallCount() int {
	fake.debugMutex.RLock()
	defer fake.debugMutex.RUnlock()
	return len(fake.debugArgsForCall)
}

func (fake *FakeLogger) DebugCalls(stub func(string, string, ...interface{})) {
	fake.debugMutex.Lock()
	defer fake.debugMutex.Unlock()
	fake.DebugStub = stub
}

func (fake *FakeLogger) DebugArgsForCall(i int) (string, string, []interface{}) {
	fake.debugMutex.RLock()
	defer fake.debugMutex.RUnlock()
	argsForCall := fake.debugArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeLogger) DebugWithDetails(arg1 string, arg2 string, arg3 ...interface{}) {
	fake.debugWithDetailsMutex.Lock()
	fake.debugWithDetailsArgsForCall = append(fake.debugWithDetailsArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}{arg1, arg2, arg3})
	fake.recordInvocation("DebugWithDetails", []interface{}{arg1, arg2, arg3})
	fake.debugWithDetailsMutex.Unlock()
	if fake.DebugWithDetailsStub != nil {
		fake.DebugWithDetailsStub(arg1, arg2, arg3...)
	}
}

func (fake *FakeLogger) DebugWithDetailsCallCount() int {
	fake.debugWithDetailsMutex.RLock()
	defer fake.debugWithDetailsMutex.RUnlock()
	return len(fake.debugWithDetailsArgsForCall)
}

func (fake *FakeLogger) DebugWithDetailsCalls(stub func(string, string, ...interface{})) {
	fake.debugWithDetailsMutex.Lock()
	defer fake.debugWithDetailsMutex.Unlock()
	fake.DebugWithDetailsStub = stub
}

func (fake *FakeLogger) DebugWithDetailsArgsForCall(i int) (string, string, []interface{}) {
	fake.debugWithDetailsMutex.RLock()
	defer fake.debugWithDetailsMutex.RUnlock()
	argsForCall := fake.debugWithDetailsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeLogger) Error(arg1 string, arg2 string, arg3 ...interface{}) {
	fake.errorMutex.Lock()
	fake.errorArgsForCall = append(fake.errorArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}{arg1, arg2, arg3})
	fake.recordInvocation("Error", []interface{}{arg1, arg2, arg3})
	fake.errorMutex.Unlock()
	if fake.ErrorStub != nil {
		fake.ErrorStub(arg1, arg2, arg3...)
	}
}

func (fake *FakeLogger) ErrorCallCount() int {
	fake.errorMutex.RLock()
	defer fake.errorMutex.RUnlock()
	return len(fake.errorArgsForCall)
}

func (fake *FakeLogger) ErrorCalls(stub func(string, string, ...interface{})) {
	fake.errorMutex.Lock()
	defer fake.errorMutex.Unlock()
	fake.ErrorStub = stub
}

func (fake *FakeLogger) ErrorArgsForCall(i int) (string, string, []interface{}) {
	fake.errorMutex.RLock()
	defer fake.errorMutex.RUnlock()
	argsForCall := fake.errorArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeLogger) ErrorWithDetails(arg1 string, arg2 string, arg3 ...interface{}) {
	fake.errorWithDetailsMutex.Lock()
	fake.errorWithDetailsArgsForCall = append(fake.errorWithDetailsArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}{arg1, arg2, arg3})
	fake.recordInvocation("ErrorWithDetails", []interface{}{arg1, arg2, arg3})
	fake.errorWithDetailsMutex.Unlock()
	if fake.ErrorWithDetailsStub != nil {
		fake.ErrorWithDetailsStub(arg1, arg2, arg3...)
	}
}

func (fake *FakeLogger) ErrorWithDetailsCallCount() int {
	fake.errorWithDetailsMutex.RLock()
	defer fake.errorWithDetailsMutex.RUnlock()
	return len(fake.errorWithDetailsArgsForCall)
}

func (fake *FakeLogger) ErrorWithDetailsCalls(stub func(string, string, ...interface{})) {
	fake.errorWithDetailsMutex.Lock()
	defer fake.errorWithDetailsMutex.Unlock()
	fake.ErrorWithDetailsStub = stub
}

func (fake *FakeLogger) ErrorWithDetailsArgsForCall(i int) (string, string, []interface{}) {
	fake.errorWithDetailsMutex.RLock()
	defer fake.errorWithDetailsMutex.RUnlock()
	argsForCall := fake.errorWithDetailsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeLogger) Flush() error {
	fake.flushMutex.Lock()
	ret, specificReturn := fake.flushReturnsOnCall[len(fake.flushArgsForCall)]
	fake.flushArgsForCall = append(fake.flushArgsForCall, struct {
	}{})
	fake.recordInvocation("Flush", []interface{}{})
	fake.flushMutex.Unlock()
	if fake.FlushStub != nil {
		return fake.FlushStub()
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.flushReturns
	return fakeReturns.result1
}

func (fake *FakeLogger) FlushCallCount() int {
	fake.flushMutex.RLock()
	defer fake.flushMutex.RUnlock()
	return len(fake.flushArgsForCall)
}

func (fake *FakeLogger) FlushCalls(stub func() error) {
	fake.flushMutex.Lock()
	defer fake.flushMutex.Unlock()
	fake.FlushStub = stub
}

func (fake *FakeLogger) FlushReturns(result1 error) {
	fake.flushMutex.Lock()
	defer fake.flushMutex.Unlock()
	fake.FlushStub = nil
	fake.flushReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeLogger) FlushReturnsOnCall(i int, result1 error) {
	fake.flushMutex.Lock()
	defer fake.flushMutex.Unlock()
	fake.FlushStub = nil
	if fake.flushReturnsOnCall == nil {
		fake.flushReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.flushReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeLogger) FlushTimeout(arg1 time.Duration) error {
	fake.flushTimeoutMutex.Lock()
	ret, specificReturn := fake.flushTimeoutReturnsOnCall[len(fake.flushTimeoutArgsForCall)]
	fake.flushTimeoutArgsForCall = append(fake.flushTimeoutArgsForCall, struct {
		arg1 time.Duration
	}{arg1})
	fake.recordInvocation("FlushTimeout", []interface{}{arg1})
	fake.flushTimeoutMutex.Unlock()
	if fake.FlushTimeoutStub != nil {
		return fake.FlushTimeoutStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.flushTimeoutReturns
	return fakeReturns.result1
}

func (fake *FakeLogger) FlushTimeoutCallCount() int {
	fake.flushTimeoutMutex.RLock()
	defer fake.flushTimeoutMutex.RUnlock()
	return len(fake.flushTimeoutArgsForCall)
}

func (fake *FakeLogger) FlushTimeoutCalls(stub func(time.Duration) error) {
	fake.flushTimeoutMutex.Lock()
	defer fake.flushTimeoutMutex.Unlock()
	fake.FlushTimeoutStub = stub
}

func (fake *FakeLogger) FlushTimeoutArgsForCall(i int) time.Duration {
	fake.flushTimeoutMutex.RLock()
	defer fake.flushTimeoutMutex.RUnlock()
	argsForCall := fake.flushTimeoutArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeLogger) FlushTimeoutReturns(result1 error) {
	fake.flushTimeoutMutex.Lock()
	defer fake.flushTimeoutMutex.Unlock()
	fake.FlushTimeoutStub = nil
	fake.flushTimeoutReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeLogger) FlushTimeoutReturnsOnCall(i int, result1 error) {
	fake.flushTimeoutMutex.Lock()
	defer fake.flushTimeoutMutex.Unlock()
	fake.FlushTimeoutStub = nil
	if fake.flushTimeoutReturnsOnCall == nil {
		fake.flushTimeoutReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.flushTimeoutReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeLogger) HandlePanic(arg1 string) {
	fake.handlePanicMutex.Lock()
	fake.handlePanicArgsForCall = append(fake.handlePanicArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("HandlePanic", []interface{}{arg1})
	fake.handlePanicMutex.Unlock()
	if fake.HandlePanicStub != nil {
		fake.HandlePanicStub(arg1)
	}
}

func (fake *FakeLogger) HandlePanicCallCount() int {
	fake.handlePanicMutex.RLock()
	defer fake.handlePanicMutex.RUnlock()
	return len(fake.handlePanicArgsForCall)
}

func (fake *FakeLogger) HandlePanicCalls(stub func(string)) {
	fake.handlePanicMutex.Lock()
	defer fake.handlePanicMutex.Unlock()
	fake.HandlePanicStub = stub
}

func (fake *FakeLogger) HandlePanicArgsForCall(i int) string {
	fake.handlePanicMutex.RLock()
	defer fake.handlePanicMutex.RUnlock()
	argsForCall := fake.handlePanicArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeLogger) Info(arg1 string, arg2 string, arg3 ...interface{}) {
	fake.infoMutex.Lock()
	fake.infoArgsForCall = append(fake.infoArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}{arg1, arg2, arg3})
	fake.recordInvocation("Info", []interface{}{arg1, arg2, arg3})
	fake.infoMutex.Unlock()
	if fake.InfoStub != nil {
		fake.InfoStub(arg1, arg2, arg3...)
	}
}

func (fake *FakeLogger) InfoCallCount() int {
	fake.infoMutex.RLock()
	defer fake.infoMutex.RUnlock()
	return len(fake.infoArgsForCall)
}

func (fake *FakeLogger) InfoCalls(stub func(string, string, ...interface{})) {
	fake.infoMutex.Lock()
	defer fake.infoMutex.Unlock()
	fake.InfoStub = stub
}

func (fake *FakeLogger) InfoArgsForCall(i int) (string, string, []interface{}) {
	fake.infoMutex.RLock()
	defer fake.infoMutex.RUnlock()
	argsForCall := fake.infoArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeLogger) ToggleForcedDebug() {
	fake.toggleForcedDebugMutex.Lock()
	fake.toggleForcedDebugArgsForCall = append(fake.toggleForcedDebugArgsForCall, struct {
	}{})
	fake.recordInvocation("ToggleForcedDebug", []interface{}{})
	fake.toggleForcedDebugMutex.Unlock()
	if fake.ToggleForcedDebugStub != nil {
		fake.ToggleForcedDebugStub()
	}
}

func (fake *FakeLogger) ToggleForcedDebugCallCount() int {
	fake.toggleForcedDebugMutex.RLock()
	defer fake.toggleForcedDebugMutex.RUnlock()
	return len(fake.toggleForcedDebugArgsForCall)
}

func (fake *FakeLogger) ToggleForcedDebugCalls(stub func()) {
	fake.toggleForcedDebugMutex.Lock()
	defer fake.toggleForcedDebugMutex.Unlock()
	fake.ToggleForcedDebugStub = stub
}

func (fake *FakeLogger) UseRFC3339Timestamps() {
	fake.useRFC3339TimestampsMutex.Lock()
	fake.useRFC3339TimestampsArgsForCall = append(fake.useRFC3339TimestampsArgsForCall, struct {
	}{})
	fake.recordInvocation("UseRFC3339Timestamps", []interface{}{})
	fake.useRFC3339TimestampsMutex.Unlock()
	if fake.UseRFC3339TimestampsStub != nil {
		fake.UseRFC3339TimestampsStub()
	}
}

func (fake *FakeLogger) UseRFC3339TimestampsCallCount() int {
	fake.useRFC3339TimestampsMutex.RLock()
	defer fake.useRFC3339TimestampsMutex.RUnlock()
	return len(fake.useRFC3339TimestampsArgsForCall)
}

func (fake *FakeLogger) UseRFC3339TimestampsCalls(stub func()) {
	fake.useRFC3339TimestampsMutex.Lock()
	defer fake.useRFC3339TimestampsMutex.Unlock()
	fake.UseRFC3339TimestampsStub = stub
}

func (fake *FakeLogger) Warn(arg1 string, arg2 string, arg3 ...interface{}) {
	fake.warnMutex.Lock()
	fake.warnArgsForCall = append(fake.warnArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 []interface{}
	}{arg1, arg2, arg3})
	fake.recordInvocation("Warn", []interface{}{arg1, arg2, arg3})
	fake.warnMutex.Unlock()
	if fake.WarnStub != nil {
		fake.WarnStub(arg1, arg2, arg3...)
	}
}

func (fake *FakeLogger) WarnCallCount() int {
	fake.warnMutex.RLock()
	defer fake.warnMutex.RUnlock()
	return len(fake.warnArgsForCall)
}

func (fake *FakeLogger) WarnCalls(stub func(string, string, ...interface{})) {
	fake.warnMutex.Lock()
	defer fake.warnMutex.Unlock()
	fake.WarnStub = stub
}

func (fake *FakeLogger) WarnArgsForCall(i int) (string, string, []interface{}) {
	fake.warnMutex.RLock()
	defer fake.warnMutex.RUnlock()
	argsForCall := fake.warnArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeLogger) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.debugMutex.RLock()
	defer fake.debugMutex.RUnlock()
	fake.debugWithDetailsMutex.RLock()
	defer fake.debugWithDetailsMutex.RUnlock()
	fake.errorMutex.RLock()
	defer fake.errorMutex.RUnlock()
	fake.errorWithDetailsMutex.RLock()
	defer fake.errorWithDetailsMutex.RUnlock()
	fake.flushMutex.RLock()
	defer fake.flushMutex.RUnlock()
	fake.flushTimeoutMutex.RLock()
	defer fake.flushTimeoutMutex.RUnlock()
	fake.handlePanicMutex.RLock()
	defer fake.handlePanicMutex.RUnlock()
	fake.infoMutex.RLock()
	defer fake.infoMutex.RUnlock()
	fake.toggleForcedDebugMutex.RLock()
	defer fake.toggleForcedDebugMutex.RUnlock()
	fake.useRFC3339TimestampsMutex.RLock()
	defer fake.useRFC3339TimestampsMutex.RUnlock()
	fake.warnMutex.RLock()
	defer fake.warnMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeLogger) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ logger.Logger = new(FakeLogger)