text:
package com.heyzap.sdk;

import org.json.JSONException;
import org.json.JSONObject;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.Html;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.heyzap.http.RequestParams;

public class LeaderboardScoreDialogTop extends ClickableToast {
    private Context context;
    private String gamePackage;
    private String score;
    private String displayScore;
    private String levelId;
    private boolean fromSdk;
    private View.OnClickListener showInGameOverlayOrLaunchLeaderboardActivity;
    private JSONObject response;
    private Runnable autoHide;
    private View wrapper;
    private String bestDisplayScore = null;
    private long shownAt;
    private boolean personalBest;
    private Drawable gameIcon;

    public LeaderboardScoreDialogTop(Context context, JSONObject response, String gamePackage, String score, String displayScore, String levelId) {
        this(context, response, gamePackage, score, displayScore, levelId, null, null);
    }

    public LeaderboardScoreDialogTop(Context context, JSONObject response, String gamePackage, String score, String displayScore, String levelId,
            String personalBestFromPhone, Drawable gameIcon) {
        super(context);
        this.response = response;
        this.gamePackage = gamePackage;
        this.context = context;
        this.score = score;
        this.displayScore = displayScore;
        this.levelId = levelId;
        this.gameIcon = gameIcon;

        if (response == null && personalBestFromPhone != null) {
            // we need to submit the score silently
            this.bestDisplayScore = personalBestFromPhone;

            RequestParams requestParams = LeaderboardScoreLauncher.getNewScoreRequestParams(score, displayScore, levelId);

            SDKRestClient.post(context, "/in_game_api/leaderboard/new_score", requestParams, new SDKResponseHandler() {

                @Override
                public void onSuccess(JSONObject response) {
                    try {
                        String bestScore = response.getString("best_score");
                        String bestDisplayScore = response.getString("best_display_score");
                        JSONObject level = response.getJSONObject("level");
                        String levelId = level.getString("id");
                        boolean lowestScoreFirst = level.getBoolean("lowest_score_first");
                        LeaderboardScoreLauncher.saveLeaderboardInfoOnPhone(LeaderboardScoreDialogTop.this.context, Float.parseFloat(bestScore),
                                bestDisplayScore, levelId, lowestScoreFirst, true);
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }

                @Override
                public void onFailure(Throwable e) {
                }
            });

        } else {
            try {
                bestDisplayScore = response.getString("best_display_score");
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }

        this.setContentView(Rzap.layout("leaderboard_score_dialog_top"));

        showInGameOverlayOrLaunchLeaderboardActivity = new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // This is what this class does in the Heyzap SDK:
                HeyzapAnalytics.trackEvent(getContext(), "score-overlay-clicked-top");
                HeyzapLib.showInGameOverlay(LeaderboardScoreDialogTop.this.context, null, "top");
                LeaderboardScoreDialogTop.this.hide();
            }
        };

        wrapper = findViewById(Rzap.id("wrapper"));
        wrapper.setOnClickListener(showInGameOverlayOrLaunchLeaderboardActivity);

        // Use portrait width, regardless of orientation
        RelativeLayout container = (RelativeLayout) findViewById(Rzap.id("container"));
        FrameLayout.LayoutParams p = (FrameLayout.LayoutParams) container.getLayoutParams();
        WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics metrics = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(metrics);
        p.width = Math.min(metrics.widthPixels, metrics.heightPixels);
        container.setLayoutParams(p);

        final Animation slide = AnimationUtils.loadAnimation(getContext(), Rzap.anim("slide_from_top"));
        Logger.log("starting slide in");
        wrapper.startAnimation(slide);

        autoHide = new Runnable() {

            @Override
            public void run() {
                LeaderboardScoreDialogTop.this.hide();
            }
        };

        wrapper.postDelayed(autoHide, 7000);
    }

    public void setFromSdk(boolean fromSdk) {
        this.fromSdk = fromSdk;
    }

    @Override
    public WindowManager.LayoutParams getWmParams() {
        WindowManager.LayoutParams params = super.getWmParams();
        params.gravity = Gravity.TOP;
        params.width = WindowManager.LayoutParams.FILL_PARENT;
        params.verticalMargin = 0.0f;
        params.horizontalMargin = 0.0f;
        params.flags &= ~WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
        params.flags |= WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;

        return params;
    }

    public void hide() {
        wrapper.removeCallbacks(autoHide);

        slideUp(new Runnable() {

            @Override
            public void run() {
                LeaderboardScoreDialogTop.super.hide();
            }
        });
    }

    public void slideUp(Runnable after) {
        slide(Rzap.anim("slide_up"), after);
    }

    public void slide(int anim, Runnable after) {
        Animation animation = AnimationUtils.loadAnimation(getContext(), anim);
        wrapper.startAnimation(animation);
        if (after != null) {
            wrapper.postDelayed(after, (int) animation.getDuration());
        }
    }

    private void setupViews() {
        TextView titleView = (TextView) this.findViewById(Rzap.id("title"));
        TextView ctaView = (TextView) this.findViewById(Rzap.id("cta"));
        ImageView pictureView = (ImageView) this.findViewById(Rzap.id("picture"));

        titleView.setText(Html.fromHtml(String.format("You scored %s!", displayScore)));

        if (personalBest) {
            ctaView.setText(Html.fromHtml(String.format("New personal best! Sign in to save.", displayScore)));
        } else {
            ctaView.setText(Html.fromHtml(String.format("Personal best: %s. Sign in to save.", bestDisplayScore)));
        }
        ctaView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);

        pictureView.setBackgroundResource(Rzap.drawable("icon_default_people"));
        if (gameIcon != null) {
            pictureView.setImageDrawable(gameIcon);
        }
    }

    @Override
    public void show() {
        HeyzapAnalytics.trackEvent(getContext(), "score-overlay-shown-top");
        shownAt = System.currentTimeMillis();
        setupViews();
        super.show();
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_OUTSIDE && System.currentTimeMillis() > shownAt + 1000) {
            this.hide();
            return false;
        } else {
            return super.onTouchEvent(event);
        }
    }

    public void setPersonalBest(boolean personalBest) {
        this.personalBest = personalBest;
    }

}


text:
ref_fasta_file=../reseq_data/reference/dmel-all-chromosome-r5.41.fasta
sam_ore_bams=../bam_alignments/sam.bam\ ../bam_alignments/ore.bam
bc_bams=../bam_alignments/bc_long.bam\ ../bam_alignments/bc_short_1.bam\ ../bam_alignments/bc_short_2.bam\ ../bam_alignments/bc_short_3.bam\ ../bam_alignments/bc_short_4.bam
bsa_bams=../bam_alignments/bsa_high_1.bam\ ../bam_alignments/bsa_high_2.bam\ ../bam_alignments/bsa_low_3.bam\ ../bam_alignments/bsa_low_4.bam
vcf_file=../snp_data/all_snps.vcf
snp_list_file=snp_list.txt
pileup_file=../snp_data/all_pileup.txt

#Change the current working directory
cd $PBS_O_WORKDIR

#Generate a list of SNPs we want to output pileups for
grep '^[^#]' $vcf_file | cut -f 1,2 > $snp_list_file

#Generate the pileup
samtools mpileup -l $snp_list_file -f $ref_fasta_file $sam_ore_bams $bc_bams $bsa_bams > $pileup_file

redpajama_set_name: RedPajamaGithub


text:
package com.ray3k.skincomposer.installer;

import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.Touchable;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;

/**
 *
 * @author Raymond
 */
public class InfoTable extends Table {

    public InfoTable(final Skin skin, final Stage stage) {
        pad(10.0f);

        var label = new Label(Core.readAndReplace("about.txt"), skin, "small");
        label.setWrap(true);
        label.setTouchable(Touchable.disabled);
        add(label).growX().expandY().top();

        row();
        var textButton = new TextButton("OK", skin);
        add(textButton).growX().height(30.0f);
        textButton.addListener(new ChangeListener() {
            @Override
            public void changed(ChangeListener.ChangeEvent event, Actor actor) {
                Core.transition(InfoTable.this, new MenuTable(skin, stage));
            }
        });
    }
}


text:
"""Gerrit client for GAE environment."""

from collections import namedtuple

# pylint: disable=W0611
from gitiles.googlesource import (GoogleSourceServiceClient, Error,
                                  AuthenticationError)

Owner = namedtuple('Owner', ['name', 'email', 'username'])

Revision = namedtuple('Revision', [
    # Commit sha, such as d283186300411e4d05ef0ced6c29fe77e8767a43.
    'commit',
    # Ordinal of the revision within a GerritChange, starting from 1.
    'number',
    # A ref where this commit can be fetched.
    'fetch_ref',
])

Change = namedtuple('Change', [
    # A "long" change id, such as
    # chromium/src~master~If1bfd2e7d0ad2c14908e5d45a513b5335d36ff01
    'id',
    # A "short" change id, such as If1bfd2e7d0ad2c14908e5d45a513b5335d36ff01
    'change_id',
    'project',
    'branch',
    'subject',
    # Owner of the Change, of type Owner.
    'owner',
    # Sha of the current revision's commit.
    'current_revision',
    # A list of Revision objects.
    'revisions',
])

class GerritClient(GoogleSourceServiceClient):
  """Client class for Gerrit operations."""

  def get_change(self, change_id, include_all_revisions=True,
                 include_owner_details=False):
    """Gets a single Gerrit change by id.

    Returns Change object, or None if change was not found.
    """
    path = 'changes/%s' % change_id
    if include_owner_details:
      path += '/detail'
    if include_all_revisions:
      path += '?o=ALL_REVISIONS'
    data = self._fetch(path)
    if data is None:
      return None

    owner = None
    ownerData = data.get('owner')
    if ownerData:  # pragma: no branch
      owner = Owner(
          name=ownerData.get('name'),
          email=ownerData.get('email'),
          username=ownerData.get('username'),
      )

    revisions = [Revision(
        commit=key,
        number=int(value['_number']),
        fetch_ref=value['fetch']['http']['ref'],
    ) for key, value in data.get('revisions', {}).iteritems()]
    revisions.sort(key=lambda r: r.number)

    return Change(
        id=data['id'],
        project=data.get('project'),
        branch=data.get('branch'),
        subject=data.get('subject'),
        change_id=data.get('change_id'),
        current_revision=data.get('current_revision'),
        revisions=revisions,
        owner=owner,
    )

  def set_review(self, change_id, revision, message=None, labels=None,
                 notify=None):
    """Sets review on a revision.

    Args:
      change_id: Gerrit change id, such as project~branch~I1234567890.
      revision: a commit sha for the patchset to review.
      message: text message.
      labels: a dict of label names and their values, such as {'Verified': 1}.
      notify: who to notify. Supported values:
        None - use default behavior, same as 'ALL'.
        'NONE': do not notify anyone.
        'OWNER': notify owner of the change_id.
        'OWNER_REVIEWERS': notify owner and OWNER_REVIEWERS.
        'ALL': notify anyone interested in the Change.
    """
    if notify is not None:
      notify = str(notify).upper()
    assert notify in (None, 'NONE', 'OWNER', 'OWNER_REVIEWERS', 'ALL')
    body = {
        'message': message,
        'labels': labels,
        'notify': notify,
    }
    body = {k:v for k, v in body.iteritems() if v is not None}

    path = 'changes/%s/revisions/%s/review' % (change_id, revision)
    self._fetch(path, method='POST', body=body)


text:
/*****************************************************************************
 SymmetricAlgorithmTests.h

 Contains test cases for symmetrical algorithms (i.e., AES and DES)
 *****************************************************************************/

#ifndef _SOFTHSM_V2_SYMENCRYPTDECRYPTTESTS_H
#define _SOFTHSM_V2_SYMENCRYPTDECRYPTTESTS_H

#include <cppunit/extensions/HelperMacros.h>
#include "cryptoki.h"

class SymmetricAlgorithmTests : public CppUnit::TestFixture
{
	CPPUNIT_TEST_SUITE(SymmetricAlgorithmTests);
	CPPUNIT_TEST(testAesEncryptDecrypt);
	CPPUNIT_TEST(testDesEncryptDecrypt);
#ifdef HAVE_AES_KEY_WRAP
	CPPUNIT_TEST(testAesWrapUnwrap);
#endif
	CPPUNIT_TEST(testNullTemplate);
	CPPUNIT_TEST(testNonModifiableDesKeyGeneration);
	CPPUNIT_TEST_SUITE_END();

public:
	void testAesEncryptDecrypt();
	void testDesEncryptDecrypt();
	void testAesWrapUnwrap();
	void testNullTemplate();
	void testNonModifiableDesKeyGeneration();

	void setUp();
	void tearDown();

protected:
	CK_RV generateAesKey(CK_SESSION_HANDLE hSession, CK_BBOOL bToken, CK_BBOOL bPrivate, CK_OBJECT_HANDLE &hKey);
#ifndef WITH_FIPS
	CK_RV generateDesKey(CK_SESSION_HANDLE hSession, CK_BBOOL bToken, CK_BBOOL bPrivate, CK_OBJECT_HANDLE &hKey);
	CK_RV generateDes2Key(CK_SESSION_HANDLE hSession, CK_BBOOL bToken, CK_BBOOL bPrivate, CK_OBJECT_HANDLE &hKey);
#endif
	CK_RV generateDes3Key(CK_SESSION_HANDLE hSession, CK_BBOOL bToken, CK_BBOOL bPrivate, CK_OBJECT_HANDLE &hKey);
	void aesEncryptDecrypt(CK_MECHANISM_TYPE mechanismType, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey);
#ifndef WITH_FIPS
	void desEncryptDecrypt(CK_MECHANISM_TYPE mechanismType, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey);
#endif
	void des3EncryptDecrypt(CK_MECHANISM_TYPE mechanismType, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey);
	void aesWrapUnwrap(CK_MECHANISM_TYPE mechanismType, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey);
#ifdef HAVE_AES_KEY_WRAP_PAD
	CK_RV generateRsaPrivateKey(CK_SESSION_HANDLE hSession, CK_BBOOL bToken, CK_BBOOL bPrivate, CK_OBJECT_HANDLE &hKey);
#endif
};

#endif // !_SOFTHSM_V2_SYMENCRYPTDECRYPTTESTS_H


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
    <title>XIMEX-XDE</title>

    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
    <link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
    <link rel="shortcut icon" href="img/icon.png" />
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons"
          rel="stylesheet">

Services

Shipping Tools

Global Compliance

        XIMEX-XDE
        menu

LOG IN

        menu

Ship Now

Track and Trace

How to Shiparrow_drop_down

Help Centerarrow_drop_down

About our companyarrow_drop_down

Ship Now

Track and Trace

How to Shiparrow_drop_down

Help Centerarrow_drop_down

About our companyarrow_drop_down

Track & Trace

        <form class="col s12">

Waybill Details

                        <input id="disabled" class="validate" type="text" value="6" disabled="">

                            Waybill Number

                        <input id="disabled" class="validate" type="text" value="6" disabled="">

                            Waybill Date

                        <input id="disabled" class="validate" type="text" value="6" disabled="">

                            Waybill Status

Shipper

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Full Name

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                E-mail Address

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Birthday

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Gender

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Contact Number

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Country

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Address

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Branch Name

Consignee

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Full Name

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                E-mail Address

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Birthday

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Gender

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Contact Number

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Country

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Address

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Area Group Destination

Package Description

                                Handling Instruction
                                Quantity
                                Length(cm)
                                Width(cm)
                                Height(cm)
                                Weight(kg)

Service

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Declared Value

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Pouch

History

                                    Date
                                    Remarks

Summary

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Total Price

                            <input id="disabled" class="validate" type="text" value="6" disabled="">

                                Created By:

        </form>


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

<TITLE>
AnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything (Google Annotations Gallery 1.0.1)
</TITLE>

<META NAME="date" CONTENT="2010-04-06">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: REQUIRED | OPTIONAL

DETAIL: ELEMENT

com.google.gag.annotation.enforceable

Annotation Type AnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything

@Retention(value=CLASS)
@Target(value=PARAMETER)
public @interface AnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything

Causes the annnotated numeric parameter to evaluate to the Answer to the
 Ultimate Question of Life, the Universe and Everything.

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: REQUIRED | OPTIONAL

DETAIL: ELEMENT


text:
package indi.nut.myspring.web.servlet;

/**
 * Created by nut on 2016/12/29.
 */
public class HandlerExecutionChain {

    private final Object handler;

    public HandlerExecutionChain(Object handler){
        this.handler = handler;
    }

    public Object getHandler() {
        return handler;
    }
}


text:
namespace performance_manager {

class Node;

// NodeAttachedData allows external observers of the graph to store data that is
// associated with a graph node, providing lifetime management as a service.
//
// External (to performance_manager) implementations of NodeAttachedData should
// derive from ExternalNodeAttachedDataImpl. For internal implementations refer
// to NodeAttachedDataImpl and see node_attached_data_impl.h.
class NodeAttachedData {
 public:
  NodeAttachedData();

  NodeAttachedData(const NodeAttachedData&) = delete;
  NodeAttachedData& operator=(const NodeAttachedData&) = delete;

  virtual ~NodeAttachedData();

  // Returns the 'key' associated with this type of NodeAttachedData. This needs
  // to be unique per data type or bad things happen.
  virtual const void* GetKey() const = 0;
};

// Implements NodeAttachedData for a given UserDataType.
//
// In order for a UserDataType to be attached to a node of type |NodeType| it
// must have a constructor of the form "UserDataType(const NodeType* node)".
template <typename UserDataType>
class ExternalNodeAttachedDataImpl : public NodeAttachedData {
 public:
  ExternalNodeAttachedDataImpl() = default;

  ExternalNodeAttachedDataImpl(const ExternalNodeAttachedDataImpl&) = delete;
  ExternalNodeAttachedDataImpl& operator=(const ExternalNodeAttachedDataImpl&) =
      delete;

  ~ExternalNodeAttachedDataImpl() override = default;

  // NodeAttachedData implementation:
  const void* GetKey() const override { return &kUserDataKey; }

  // Gets the user data for the given |node|, creating it if it doesn't yet
  // exist.
  template <typename NodeType>
  static UserDataType* GetOrCreate(const NodeType* node);

  // Gets the user data for the given |node|, returning nullptr if it doesn't
  // exist.
  template <typename NodeType>
  static UserDataType* Get(const NodeType* node);

  // Destroys the user data associated with the given node, returning true
  // on success or false if the user data did not exist to begin with.
  template <typename NodeType>
  static bool Destroy(const NodeType* node);

 private:
  static const int kUserDataKey = 0;
  static const void* UserDataKey() { return &kUserDataKey; }
};

// Everything below this point is pure implementation detail.

// Provides access for setting/getting data in the map based storage. Not
// intended to be used directly, but rather by (External)NodeAttachedDataImpl.
class NodeAttachedDataMapHelper {
 public:
  // Attaches the provided |data| to the provided |node|. This should only be
  // called if the data does not exist (GetFromMap returns nullptr), and will
  // DCHECK otherwise.
  static void AttachInMap(const Node* node,
                          std::unique_ptr<NodeAttachedData> data);

  // Retrieves the data associated with the provided |node| and |key|. This
  // returns nullptr if no data exists.
  static NodeAttachedData* GetFromMap(const Node* node, const void* key);

  // Detaches the data associated with the provided |node| and |key|. It is
  // harmless to call this when no data exists.
  static std::unique_ptr<NodeAttachedData> DetachFromMap(const Node* node,
                                                         const void* key);
};

// Implementation of ExternalNodeAttachedDataImpl, which is declared in the
// corresponding public header. This helps keep the public headers as clean as
// possible.

// static
template <typename UserDataType>
constexpr int ExternalNodeAttachedDataImpl<UserDataType>::kUserDataKey;

template <typename UserDataType>
template <typename NodeType>
UserDataType* ExternalNodeAttachedDataImpl<UserDataType>::GetOrCreate(
    const NodeType* node) {
  if (auto* data = Get(node))
    return data;
  std::unique_ptr<UserDataType> data = std::make_unique<UserDataType>(node);
  auto* raw_data = data.get();
  auto* base = static_cast<const Node*>(node);
  NodeAttachedDataMapHelper::AttachInMap(base, std::move(data));
  return raw_data;
}

template <typename UserDataType>
template <typename NodeType>
UserDataType* ExternalNodeAttachedDataImpl<UserDataType>::Get(
    const NodeType* node) {
  auto* base = static_cast<const Node*>(node);
  auto* data = NodeAttachedDataMapHelper::GetFromMap(base, UserDataKey());
  if (!data)
    return nullptr;
  DCHECK_EQ(UserDataKey(), data->GetKey());
  return static_cast<UserDataType*>(data);
}

template <typename UserDataType>
template <typename NodeType>
bool ExternalNodeAttachedDataImpl<UserDataType>::Destroy(const NodeType* node) {
  auto* base = static_cast<const Node*>(node);
  std::unique_ptr<NodeAttachedData> data =
      NodeAttachedDataMapHelper::DetachFromMap(base, UserDataKey());
  return data.get();
}

}  // namespace performance_manager

#endif  // COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_GRAPH_NODE_ATTACHED_DATA_H_


text:
$r.contextHelpWithWrapper("org.olat.presentation.ims.qti.exporter","arch-test-csv.html","help.arch-test-csv")
$r.render("backLink")

	$r.translate("wizard.nodetitle"): $nodetitle

$r.render("dcForm")


text:
"""Tests for nsl.estimator.adversarial_regularization."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import os
import shutil
import tempfile

from absl.testing import parameterized
import neural_structured_learning.configs as nsl_configs
import neural_structured_learning.estimator as nsl_estimator
import numpy as np
import tensorflow as tf
from tensorflow import estimator as tf_estimator

from tensorflow.python.framework import test_util  # pylint: disable=g-direct-tensorflow-import

FEATURE_NAME = 'x'
WEIGHT_VARIABLE = 'linear/linear_model/' + FEATURE_NAME + '/weights'
BIAS_VARIABLE = 'linear/linear_model/bias_weights'

def single_batch_input_fn(features, labels=None):
  def input_fn():
    inputs = features if labels is None else (features, labels)
    dataset = tf.data.Dataset.from_tensor_slices(inputs)
    return dataset.batch(len(features))
  return input_fn

class AdversarialRegularizationTest(tf.test.TestCase, parameterized.TestCase):

  def setUp(self):
    super(AdversarialRegularizationTest, self).setUp()
    self.model_dir = tempfile.mkdtemp()

  def tearDown(self):
    if self.model_dir:
      shutil.rmtree(self.model_dir)
    super(AdversarialRegularizationTest, self).tearDown()

  def build_linear_regressor(self, weight, bias):
    with tf.Graph().as_default():
      tf.Variable(weight, name=WEIGHT_VARIABLE)
      tf.Variable(bias, name=BIAS_VARIABLE)
      tf.Variable(100, name=tf.GraphKeys.GLOBAL_STEP, dtype=tf.int64)

      with tf.Session() as sess:
        sess.run([tf.global_variables_initializer()])
        tf.train.Saver().save(sess, os.path.join(self.model_dir, 'model.ckpt'))

    fc = tf.feature_column.numeric_column(FEATURE_NAME,
                                          shape=np.array(weight).shape)
    return tf_estimator.LinearRegressor(
        feature_columns=(fc,), model_dir=self.model_dir, optimizer='SGD')

  @test_util.run_v1_only('Requires tf.GraphKeys')
  def test_adversarial_wrapper_not_affecting_predictions(self):
    # base model: y = x + 2
    base_est = self.build_linear_regressor(weight=[[1.0]], bias=[2.0])
    adv_est = nsl_estimator.add_adversarial_regularization(base_est)
    input_fn = single_batch_input_fn({FEATURE_NAME: np.array([[1.0], [2.0]])})
    predictions = adv_est.predict(input_fn=input_fn)
    predicted_scores = [x['predictions'] for x in predictions]
    self.assertAllClose([[3.0], [4.0]], predicted_scores)

  @parameterized.named_parameters([
      ('fgsm', 0.1, 1, None),
      ('pgd', 0.1, 3, 0.25),
  ])
  @test_util.run_v1_only('Requires tf.GraphKeys')
  def test_adversarial_wrapper_adds_regularization(self, adv_step_size,
                                                   pgd_iterations, pgd_epsilon):
    # base model: y = w*x+b = 4*x1 + 3*x2 + 2
    weight = np.array([[4.0], [3.0]], dtype=np.float32)
    bias = np.array([2.0], dtype=np.float32)
    x0, y0 = np.array([[1.0, 1.0]]), np.array([8.0])
    learning_rate = 0.01

    base_est = self.build_linear_regressor(weight=weight, bias=bias)
    adv_config = nsl_configs.make_adv_reg_config(
        multiplier=1.0,  # equal weight on original and adv examples
        adv_step_size=adv_step_size,
        pgd_iterations=pgd_iterations,
        pgd_epsilon=pgd_epsilon)
    adv_est = nsl_estimator.add_adversarial_regularization(
        base_est,
        optimizer_fn=lambda: tf.train.GradientDescentOptimizer(learning_rate),
        adv_config=adv_config)
    input_fn = single_batch_input_fn({FEATURE_NAME: x0}, y0)
    adv_est.train(input_fn=input_fn, steps=1)

    # Computes the gradients on original and adversarial examples.
    orig_pred = np.dot(x0, weight) + bias  # [9.0]
    orig_grad_w = 2 * (orig_pred - y0) * x0.T  # [[2.0], [2.0]]
    orig_grad_b = 2 * (orig_pred - y0).reshape((1,))  # [2.0]
    grad_x = 2 * (orig_pred - y0) * weight.T  # [[8.0, 6.0]]
    # Gradient direction is independent of x, so perturbing for multiple
    # iterations is the same as scaling the perturbation.
    perturbation_magnitude = pgd_iterations * adv_step_size
    if pgd_epsilon is not None:
      perturbation_magnitude = np.minimum(perturbation_magnitude, pgd_epsilon)
    perturbation = perturbation_magnitude * grad_x / np.linalg.norm(grad_x)
    x_adv = x0 + perturbation  # fgm: [[1.08, 1.06]]; pgd: [[1.20, 1.15]]
    adv_pred = np.dot(x_adv, weight) + bias  # fgm: [9.5]; pgd: [10.25]
    adv_grad_w = 2 * (adv_pred - y0) * x_adv.T  # fgm: [[3.24], [3.18]]
    adv_grad_b = 2 * (adv_pred - y0).reshape((1,))  # fgm: [3.0]; pgd: [4.5]

    new_bias = bias - learning_rate * (orig_grad_b + adv_grad_b)
    new_weight = weight - learning_rate * (orig_grad_w + adv_grad_w)
    self.assertAllClose(new_bias, adv_est.get_variable_value(BIAS_VARIABLE))
    self.assertAllClose(new_weight, adv_est.get_variable_value(WEIGHT_VARIABLE))

  @test_util.run_v1_only('Requires tf.train.GradientDescentOptimizer')
  def test_adversarial_wrapper_saving_batch_statistics(self):
    x0 = np.array([[0.9, 0.1], [0.2, -0.8], [-0.7, -0.3], [-0.4, 0.6]])
    y0 = np.array([1, 0, 1, 0])
    input_fn = single_batch_input_fn({FEATURE_NAME: x0}, y0)
    fc = tf.feature_column.numeric_column(FEATURE_NAME, shape=[2])
    base_est = tf_estimator.DNNClassifier(
        hidden_units=[4],
        feature_columns=[fc],
        model_dir=self.model_dir,
        activation_fn=lambda x: tf.abs(x) + 0.1,
        dropout=None,
        batch_norm=True)
    adv_est = nsl_estimator.add_adversarial_regularization(
        base_est,
        optimizer_fn=lambda: tf.train.GradientDescentOptimizer(0.005))

    adv_est.train(input_fn=input_fn, steps=1)
    moving_mean = adv_est.get_variable_value(
        'dnn/hiddenlayer_0/batchnorm_0/moving_mean')
    moving_variance = adv_est.get_variable_value(
        'dnn/hiddenlayer_0/batchnorm_0/moving_variance')
    # The activation function always returns a positive number, so the batch
    # mean cannot be zero if updated successfully.
    self.assertNotAllClose(moving_mean, np.zeros(moving_mean.shape))
    self.assertNotAllClose(moving_variance, np.ones(moving_variance.shape))

if __name__ == '__main__':
  tf.test.main()


text:
package main

import (
	"strings"

	"github.com/sybrexsys/RapidKV/datamodel"
)

func lpushCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	return db.ProcessValue(key, true, func(elem *Element) (datamodel.CustomDataType, bool) {
		var arr datamodel.DataArray
		if elem.Value == nil {
			arr = datamodel.CreateArray(10)
			elem.Value = arr
		} else {
			var ok bool
			arr, ok = elem.Value.(datamodel.DataArray)
			if !ok {
				return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value"), false
			}
		}

		for i := 0; i < command.Count(); i++ {
			newval, err := getKey(command, i)
			if err != nil {
				return datamodel.CreateError("ERR Unknown parameter"), false
			}
			arr.Insert(0, datamodel.CreateString(newval))
		}
		result := datamodel.CreateInt(arr.Count())
		return result, true
	})
}

func rpushCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	return db.ProcessValue(key, true, func(elem *Element) (datamodel.CustomDataType, bool) {
		var arr datamodel.DataArray
		if elem.Value == nil {
			arr = datamodel.CreateArray(10)
			elem.Value = arr
		} else {
			var ok bool
			arr, ok = elem.Value.(datamodel.DataArray)
			if !ok {
				return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value"), false
			}
		}

		for i := 0; i < command.Count(); i++ {
			newval, err := getKey(command, i)
			if err != nil {
				return datamodel.CreateError("ERR Unknown parameter"), false
			}
			arr.Add(datamodel.CreateString(newval))
		}
		result := datamodel.CreateInt(arr.Count())
		return result, true
	})
}

func rpopCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	res := db.ProcessValue(key, true, func(elem *Element) (datamodel.CustomDataType, bool) {
		var arr datamodel.DataArray
		if elem.Value == nil {
			elem.Value = arr
			return datamodel.CreateNull(), false
		}

		arr, ok := elem.Value.(datamodel.DataArray)
		if !ok {
			return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value"), false
		}
		cnt := arr.Count()
		if cnt == 0 {
			return datamodel.CreateNull(), false
		}
		res := arr.Get(cnt - 1)
		arr.Remove(cnt - 1)
		return res, true
	})
	return res
}

func lpopCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	res := db.ProcessValue(key, true, func(elem *Element) (datamodel.CustomDataType, bool) {
		var arr datamodel.DataArray
		if elem.Value == nil {
			elem.Value = arr
			return datamodel.CreateNull(), false
		}

		arr, ok := elem.Value.(datamodel.DataArray)
		if !ok {
			return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value"), false
		}
		cnt := arr.Count()
		if cnt == 0 {
			return datamodel.CreateNull(), false
		}
		res := arr.Get(0)
		arr.Remove(0)
		return res, true
	})
	return res
}

func lpushxCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	return db.ProcessValue(key, true, func(elem *Element) (datamodel.CustomDataType, bool) {
		var arr datamodel.DataArray
		if elem.Value == nil {
			return datamodel.CreateInt(0), false
		}

		arr, ok := elem.Value.(datamodel.DataArray)
		if !ok {
			return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value"), false
		}

		newval, err := getKey(command, 0)
		if err != nil {
			return datamodel.CreateError("ERR Unknown parameter"), false
		}
		arr.Insert(0, datamodel.CreateString(newval))

		result := datamodel.CreateInt(arr.Count())
		return result, true
	})
}

func rpushxCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	return db.ProcessValue(key, true, func(elem *Element) (datamodel.CustomDataType, bool) {
		var arr datamodel.DataArray
		if elem.Value == nil {
			return datamodel.CreateInt(0), false
		}

		arr, ok := elem.Value.(datamodel.DataArray)
		if !ok {
			return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value"), false
		}

		newval, err := getKey(command, 0)
		if err != nil {
			return datamodel.CreateError("ERR Unknown parameter"), false
		}
		arr.Add(datamodel.CreateString(newval))

		result := datamodel.CreateInt(arr.Count())
		return result, true
	})
}

func llenCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	return db.GetValueAndProcess(key, func(val datamodel.CustomDataType, present bool) datamodel.CustomDataType {
		if !present {
			return datamodel.CreateInt(0)
		}
		arr, okstr := val.(datamodel.DataArray)
		if !okstr {
			return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value")
		}
		return datamodel.CreateInt(arr.Count())
	})
}

func lindexCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	idx, err := getInt(command, 0)
	if err != nil {
		return datamodel.CreateError("ERR Unknown parameter")
	}
	return db.GetValueAndProcess(key, func(val datamodel.CustomDataType, present bool) datamodel.CustomDataType {
		if !present {
			return datamodel.CreateNull()
		}
		arr, okstr := val.(datamodel.DataArray)
		if !okstr {
			return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value")
		}

		if idx < 0 {
			idx = arr.Count() + idx
		}
		return arr.Get(idx).Copy()
	})
}

func linsertCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	loc, err := getKey(command, 0)
	if err != nil {
		return datamodel.CreateError("ERR Unknown parameter")
	}
	var isbefore bool
	loc = strings.ToLower(loc)
	if loc == "before" {
		isbefore = true
	} else if loc == "after" {
		isbefore = false
	} else {
		return datamodel.CreateError("ERR Unknown parameter")
	}
	search, err := getKey(command, 1)
	if err != nil {
		return datamodel.CreateError("ERR Unknown parameter")
	}
	value, err := getKey(command, 2)
	if err != nil {
		return datamodel.CreateError("ERR Unknown parameter")
	}
	return db.ProcessValue(key, true, func(elem *Element) (datamodel.CustomDataType, bool) {
		var arr datamodel.DataArray
		if elem.Value == nil {
			return datamodel.CreateInt(0), false
		}

		arr, ok := elem.Value.(datamodel.DataArray)
		if !ok {
			return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value"), false
		}

		cnt := arr.Count()
		idx := -1
		for i := 0; i < cnt; i++ {
			item, ok := arr.Get(i).(datamodel.DataString)
			if !ok {
				continue
			}
			if item.Get() == search {
				idx = i
				break
			}
		}
		if idx == -1 {
			return datamodel.CreateInt(-1), false
		}
		if !isbefore {
			idx++
		}
		arr.Insert(idx, datamodel.CreateString(value))
		result := datamodel.CreateInt(arr.Count())
		return result, true
	})
}

func ltrimCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	fromval, err := getInt(command, 0)
	if err != nil {
		return datamodel.CreateError("ERR Unknown parameter")
	}
	toval, err := getInt(command, 1)
	if err != nil {
		return datamodel.CreateError("ERR Unknown parameter")
	}
	return db.ProcessValue(key, true, func(elem *Element) (datamodel.CustomDataType, bool) {
		var arr datamodel.DataArray
		if elem.Value == nil {
			return datamodel.CreateSimpleString("OK"), false
		}

		arr, ok := elem.Value.(datamodel.DataArray)
		if !ok {
			return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value"), false
		}

		cnt := arr.Count()
		if fromval < 0 {
			fromval = cnt + fromval
		}
		if toval < 0 {
			toval = cnt + toval
		}

		if fromval < 0 {
			fromval = 0
		}
		if toval < 0 {
			toval = 0
		}
		if fromval >= cnt || fromval > toval {
			elem.Value = datamodel.CreateArray(10)
			return datamodel.CreateSimpleString("OK"), false
		}
		steps := toval - fromval + 1
		for i := 0; i < steps; i++ {
			arr.Remove(fromval)
		}
		return datamodel.CreateSimpleString("OK"), false
	})
}

func lsetCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	idx, err := getInt(command, 0)
	if err != nil {
		return datamodel.CreateError("ERR Unknown parameter")
	}

	value, err := getKey(command, 1)
	if err != nil {
		return datamodel.CreateError("ERR Unknown parameter")
	}

	return db.ProcessValue(key, true, func(elem *Element) (datamodel.CustomDataType, bool) {
		var arr datamodel.DataArray
		if elem.Value == nil {
			return datamodel.CreateError("ERR No such key"), false
		}

		arr, ok := elem.Value.(datamodel.DataArray)
		if !ok {
			return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value"), false
		}

		cnt := arr.Count()

		if idx < 0 {
			idx = cnt - idx
		}
		if idx < 0 || idx >= cnt {
			return datamodel.CreateError("ERR Out of range"), false
		}
		arr.Remove(idx)
		arr.Insert(idx, datamodel.CreateString(value))
		result := datamodel.CreateSimpleString("OK")
		return result, true
	})
}

func lrangeCommand(db *Database, key string, command datamodel.DataArray) datamodel.CustomDataType {
	fromval, err := getInt(command, 0)
	if err != nil {
		return datamodel.CreateError("ERR Unknown parameter")
	}

	toval, err := getInt(command, 1)
	if err != nil {
		return datamodel.CreateError("ERR Unknown parameter")
	}
	return db.GetValueAndProcess(key, func(val datamodel.CustomDataType, present bool) datamodel.CustomDataType {
		if !present {
			return datamodel.CreateArray(0)
		}

		arr, okstr := val.(datamodel.DataArray)
		if !okstr {
			return datamodel.CreateError("WRONGTYPE Operation against a key holding the wrong kind of value")
		}

		cnt := arr.Count()

		if fromval < 0 {
			fromval = cnt + fromval
		}
		if toval < 0 {
			toval = cnt + toval
		}

		if fromval < 0 {
			fromval = 0
		}
		if toval < 0 {
			toval = 0
		}

		if toval >= cnt {
			toval = cnt - 1
		}

		if fromval > toval {
			return datamodel.CreateArray(0)
		}

		res := datamodel.CreateArray(toval - fromval + 1)
		for i := fromval; i <= toval; i++ {
			res.Add(arr.Get(i).Copy())
		}
		return res
	})
}


text:
package uk.co.fivium.dmda.Server.Enumerations;

public enum LoggingModes {
    CONSOLE("console")
  , FILE("file")
  , NONE("none");

  private final String mMode;
  private LoggingModes(String pMode){
    mMode = pMode;
  }

  public String getText(){
    return mMode;
  }
}


text:
const merge = require('webpack-merge');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const TerserJSPlugin = require('terser-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');

const common = require('./webpack.common.js');

module.exports = merge.smartStrategy({
    'module.rules.use': 'replace'
})(common, {
    mode: 'production',
    output: {
        filename: 'js/[name].[contenthash].js'
    },
    optimization: {
        moduleIds: 'hashed',
        minimizer: [new TerserJSPlugin({}), new OptimizeCSSAssetsPlugin({})],
        splitChunks: {
            cacheGroups: {
                vendor: {
                    test: /[\\/]node_modules[\\/]/,
                    name: 'vendors',
                    chunks: 'all',
                },
            }
        }
    },
    plugins: [
        new CleanWebpackPlugin(),
        new MiniCssExtractPlugin({
            filename: '[name].[contenthash].css',
            chunkFilename: '[id].[contenthash].css',
        }),
    ],
    module: {
        rules: [
            {
                test: /\.css$/i,
                use: [MiniCssExtractPlugin.loader, 'css-loader'],
            },
            {
                test: /\.scss$/i,
                use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
            },
        ],
    },
});


text:
.class Lcom/android/server/connectivity/Vpn$1;
.super Lcom/android/server/net/BaseNetworkObserver;
.source "Vpn.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/connectivity/Vpn;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/server/connectivity/Vpn;

# direct methods
.method constructor <init>(Lcom/android/server/connectivity/Vpn;)V
    .locals 0
    .param p1, "this$0"    # Lcom/android/server/connectivity/Vpn;

    .prologue
    .line 734
    iput-object p1, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-direct {p0}, Lcom/android/server/net/BaseNetworkObserver;-><init>()V

    return-void
.end method

# virtual methods
.method public interfaceRemoved(Ljava/lang/String;)V
    .locals 3
    .param p1, "interfaze"    # Ljava/lang/String;

    .prologue
    .line 746
    iget-object v1, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    monitor-enter v1

    .line 747
    :try_start_0
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-static {v0}, Lcom/android/server/connectivity/Vpn;->-get4(Lcom/android/server/connectivity/Vpn;)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-static {v0, p1}, Lcom/android/server/connectivity/Vpn;->-wrap0(Lcom/android/server/connectivity/Vpn;Ljava/lang/String;)I

    move-result v0

    if-nez v0, :cond_0

    .line 748
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    const/4 v2, 0x0

    invoke-static {v0, v2}, Lcom/android/server/connectivity/Vpn;->-set4(Lcom/android/server/connectivity/Vpn;Landroid/app/PendingIntent;)Landroid/app/PendingIntent;

    .line 749
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    const/4 v2, 0x0

    invoke-static {v0, v2}, Lcom/android/server/connectivity/Vpn;->-set5(Lcom/android/server/connectivity/Vpn;Ljava/util/List;)Ljava/util/List;

    .line 750
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    const/4 v2, 0x0

    invoke-static {v0, v2}, Lcom/android/server/connectivity/Vpn;->-set0(Lcom/android/server/connectivity/Vpn;Lcom/android/internal/net/VpnConfig;)Lcom/android/internal/net/VpnConfig;

    .line 751
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    const/4 v2, 0x0

    invoke-static {v0, v2}, Lcom/android/server/connectivity/Vpn;->-set2(Lcom/android/server/connectivity/Vpn;Ljava/lang/String;)Ljava/lang/String;

    .line 752
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-static {v0}, Lcom/android/server/connectivity/Vpn;->-get1(Lcom/android/server/connectivity/Vpn;)Lcom/android/server/connectivity/Vpn$Connection;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 753
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-static {v0}, Lcom/android/server/connectivity/Vpn;->-get2(Lcom/android/server/connectivity/Vpn;)Landroid/content/Context;

    move-result-object v0

    iget-object v2, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-static {v2}, Lcom/android/server/connectivity/Vpn;->-get1(Lcom/android/server/connectivity/Vpn;)Lcom/android/server/connectivity/Vpn$Connection;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/content/Context;->unbindService(Landroid/content/ServiceConnection;)V

    .line 754
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    const/4 v2, 0x0

    invoke-static {v0, v2}, Lcom/android/server/connectivity/Vpn;->-set1(Lcom/android/server/connectivity/Vpn;Lcom/android/server/connectivity/Vpn$Connection;)Lcom/android/server/connectivity/Vpn$Connection;

    .line 755
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-static {v0}, Lcom/android/server/connectivity/Vpn;->-wrap2(Lcom/android/server/connectivity/Vpn;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_0
    :goto_0
    monitor-exit v1

    .line 745
    return-void

    .line 756
    :cond_1
    :try_start_1
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-static {v0}, Lcom/android/server/connectivity/Vpn;->-get5(Lcom/android/server/connectivity/Vpn;)Lcom/android/server/connectivity/Vpn$LegacyVpnRunner;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 757
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-static {v0}, Lcom/android/server/connectivity/Vpn;->-get5(Lcom/android/server/connectivity/Vpn;)Lcom/android/server/connectivity/Vpn$LegacyVpnRunner;

    move-result-object v0

    invoke-virtual {v0}, Lcom/android/server/connectivity/Vpn$LegacyVpnRunner;->exit()V

    .line 758
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    const/4 v2, 0x0

    invoke-static {v0, v2}, Lcom/android/server/connectivity/Vpn;->-set3(Lcom/android/server/connectivity/Vpn;Lcom/android/server/connectivity/Vpn$LegacyVpnRunner;)Lcom/android/server/connectivity/Vpn$LegacyVpnRunner;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 746
    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method

.method public interfaceStatusChanged(Ljava/lang/String;Z)V
    .locals 2
    .param p1, "interfaze"    # Ljava/lang/String;
    .param p2, "up"    # Z

    .prologue
    .line 737
    iget-object v1, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    monitor-enter v1

    .line 738
    if-nez p2, :cond_0

    :try_start_0
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-static {v0}, Lcom/android/server/connectivity/Vpn;->-get5(Lcom/android/server/connectivity/Vpn;)Lcom/android/server/connectivity/Vpn$LegacyVpnRunner;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 739
    iget-object v0, p0, Lcom/android/server/connectivity/Vpn$1;->this$0:Lcom/android/server/connectivity/Vpn;

    invoke-static {v0}, Lcom/android/server/connectivity/Vpn;->-get5(Lcom/android/server/connectivity/Vpn;)Lcom/android/server/connectivity/Vpn$LegacyVpnRunner;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/android/server/connectivity/Vpn$LegacyVpnRunner;->check(Ljava/lang/String;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_0
    monitor-exit v1

    .line 736
    return-void

    .line 737
    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method


text:
package org.scale.database

import com.typesafe.config.ConfigFactory
import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global
import reactivemongo.api.{ DefaultDB, DB, MongoDriver }
import reactivemongo.api.collections.default.BSONCollection
import scala.util.Try
import java.util.Collections
import scala.collection.JavaConversions._

trait MongoConfig {
  val config = ConfigFactory.load
  private val servers = config.getStringList("mongodb.servers")
  private val dbName = config.getString("mongodb.db")

  private val driver = new MongoDriver
  val connection = driver.connection(servers)
  def db = connection(dbName)
}


text:
using Elasticsearch.Net;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nest
{
	public partial interface ICatAliasesRequest { }

	public partial class CatAliasesRequest { }

	public partial class CatAliasesDescriptor { }
}


text:
const DWORD MS_VC_EXCEPTION = 0x406D1388;
#pragma pack(push,8)
typedef struct tagTHREADNAME_INFO
{
    DWORD dwType; // Must be 0x1000.
    LPCSTR szName; // Pointer to name (in user addr space).
    DWORD dwThreadID; // Thread ID (-1=caller thread).
    DWORD dwFlags; // Reserved for future use, must be zero.
 } THREADNAME_INFO;
#pragma pack(pop)
inline void SetThreadName(DWORD dwThreadID, const char* threadName) {
    THREADNAME_INFO info;
    info.dwType = 0x1000;
    info.szName = threadName;
    info.dwThreadID = dwThreadID;
    info.dwFlags = 0;
#pragma warning(push)
#pragma warning(disable: 6320 6322)
    __try{
        RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info);
    }
    __except (EXCEPTION_EXECUTE_HANDLER){
    }
#pragma warning(pop)
}

ThreadPool::ThreadPool() {

}

ThreadPool::~ThreadPool() {
	Destroy();
}

// 指定数のワーカースレッドを持つスレッドプールを作成する
bool ThreadPool::Create(size_t thread_count) {
	if(!worker_threads_.empty())
		return false;

	worker_threads_.resize(thread_count);
	running_tasks_.resize(thread_count);
	running_tasks_locks_.resize(thread_count);

	for(size_t i = 0; i < thread_count; i++) {
		WorkerThreadArg* pArg = new WorkerThreadArg();
		pArg->thread_pool_ = this;
		pArg->index_ = i;
		HANDLE handle = reinterpret_cast<HANDLE>(_beginthreadex(NULL, 0, &ThreadPool::ThreadProc, pArg, 0, NULL));
		if(handle == NULL)
			return false;

		worker_threads_[i] = handle;
	}

	return true;
}

// スレッドプールを破棄する、実行中のタスクには終了要求を行い、キュー内の未実行タスクは直接破棄する、スレッドアンセーフ
void ThreadPool::Destroy() {
	if(worker_threads_.empty())
		return;

	// ※以降 Create() が呼び出されるまで、Run() が呼び出されてはいけない

	// キュー内のタスクを破棄する
	{
		ThreadQueue<Task*>& wq = worker_queue_;

		// Pop() によるブロックを全て解除する
		worker_queue_.Quit();

		// 未実行タスクを破棄する
		LockGuard<ThreadQueue<Task*>> lock(&wq);
		for(size_t i = 0, n = wq.Count(); i < n; i++) {
			Task* pTask = wq[i];
			pTask->OnDestroy();
			delete pTask;
		}
		worker_queue_.Clear();
	}

	// 実行中タスクへ終了要求を行う
	for(size_t i = 0, n = worker_threads_.size(); i < n; i++) {
		LockGuard<CriticalSection> lock(&running_tasks_locks_[i]);

		Task* pTask = running_tasks_[i];
		if(pTask != NULL) {
			pTask->RequestStop();
		}
	}

	// スレッドを停止
	LockGuard<CriticalSection> scope_guard(&lock_);
	::WaitForMultipleObjects(static_cast<DWORD>(worker_threads_.size()), &worker_threads_[0], TRUE, INFINITE);
	for(std::vector<HANDLE>::const_iterator iter = worker_threads_.begin(); iter != worker_threads_.end(); ++iter) {
		::CloseHandle(*iter);
	}
	worker_threads_.clear();

	// 変数クリア
	running_tasks_.clear();
	running_tasks_locks_.clear();
	worker_queue_.Destroy();
	worker_queue_.Initialize();
}

// 指定されたタスクをキューへ登録する、登録されたタスクは不要になった際に delete される、スレッドセーフ
void ThreadPool::QueueUserWorkItem(Task* pTask) {
	worker_queue_.Push(pTask);
}

UINT ThreadPool::ThreadProc(void* pData) {
	WorkerThreadArg* pArg = reinterpret_cast<WorkerThreadArg*>(pData);
	UINT result = pArg->thread_pool_->WorkerThread(pArg->index_);
	delete pArg;
	return result;
}

//
//	ワーカースレッド処理
//
UINT ThreadPool::WorkerThread(int index) {
	SetThreadName(::GetCurrentThreadId(), "ThreadPool");

	CriticalSection& cs = running_tasks_locks_[index];
	LockGuard<CriticalSection> lock(&cs);

	for(;;) {
		// キューからタスクを取得し
		Task* pTask;
		if(!worker_queue_.Pop(pTask)) {
			running_tasks_[index] = NULL;
			break;
		}
		running_tasks_[index] = pTask;
		cs.Unlock();

		// 実行する
		pTask->DoTask();
		pTask->OnTaskEnd();
		pTask->OnDestroy();

		// もう用済みなので破棄する
		cs.Lock();
		running_tasks_[index] = NULL;
		delete pTask;
	}

	return 0;
}


text:
package aws

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/iam"
	"github.com/hashicorp/vault/logical"
	"github.com/hashicorp/vault/logical/framework"
	"github.com/mitchellh/mapstructure"
)

func pathUser(b *backend) *framework.Path {
	return &framework.Path{
		Pattern: "creds/" + framework.GenericNameRegex("name"),
		Fields: map[string]*framework.FieldSchema{
			"name": &framework.FieldSchema{
				Type:        framework.TypeString,
				Description: "Name of the role",
			},
		},

		Callbacks: map[logical.Operation]framework.OperationFunc{
			logical.ReadOperation: b.pathUserRead,
		},

		HelpSynopsis:    pathUserHelpSyn,
		HelpDescription: pathUserHelpDesc,
	}
}

func (b *backend) pathUserRead(
	req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
	policyName := d.Get("name").(string)

	// Read the policy
	policy, err := req.Storage.Get("policy/" + policyName)
	if err != nil {
		return nil, fmt.Errorf("error retrieving role: %s", err)
	}
	if policy == nil {
		return logical.ErrorResponse(fmt.Sprintf(
			"Role '%s' not found", policyName)), nil
	}

	// Use the helper to create the secret
	return b.secretAccessKeysCreate(
		req.Storage, req.DisplayName, policyName, string(policy.Value))
}

func pathUserRollback(req *logical.Request, _kind string, data interface{}) error {
	var entry walUser
	if err := mapstructure.Decode(data, &entry); err != nil {
		return err
	}
	username := entry.UserName

	// Get the client
	client, err := clientIAM(req.Storage)
	if err != nil {
		return err
	}

	// Get information about this user
	groupsResp, err := client.ListGroupsForUser(&iam.ListGroupsForUserInput{
		UserName: aws.String(username),
		MaxItems: aws.Int64(1000),
	})
	if err != nil {
		return err
	}
	groups := groupsResp.Groups

	// Inline (user) policies
	policiesResp, err := client.ListUserPolicies(&iam.ListUserPoliciesInput{
		UserName: aws.String(username),
		MaxItems: aws.Int64(1000),
	})
	if err != nil {
		return err
	}
	policies := policiesResp.PolicyNames

	// Attached managed policies
	manPoliciesResp, err := client.ListAttachedUserPolicies(&iam.ListAttachedUserPoliciesInput{
		UserName: aws.String(username),
		MaxItems: aws.Int64(1000),
	})
	if err != nil {
		return err
	}
	manPolicies := manPoliciesResp.AttachedPolicies

	keysResp, err := client.ListAccessKeys(&iam.ListAccessKeysInput{
		UserName: aws.String(username),
		MaxItems: aws.Int64(1000),
	})
	if err != nil {
		return err
	}
	keys := keysResp.AccessKeyMetadata

	// Revoke all keys
	for _, k := range keys {
		_, err = client.DeleteAccessKey(&iam.DeleteAccessKeyInput{
			AccessKeyId: k.AccessKeyId,
			UserName:    aws.String(username),
		})
		if err != nil {
			return err
		}
	}

	// Detach managed policies
	for _, p := range manPolicies {
		_, err = client.DetachUserPolicy(&iam.DetachUserPolicyInput{
			UserName:  aws.String(username),
			PolicyArn: p.PolicyArn,
		})
		if err != nil {
			return err
		}
	}

	// Delete any inline (user) policies
	for _, p := range policies {
		_, err = client.DeleteUserPolicy(&iam.DeleteUserPolicyInput{
			UserName:   aws.String(username),
			PolicyName: p,
		})
		if err != nil {
			return err
		}
	}

	// Remove the user from all their groups
	for _, g := range groups {
		_, err = client.RemoveUserFromGroup(&iam.RemoveUserFromGroupInput{
			GroupName: g.GroupName,
			UserName:  aws.String(username),
		})
		if err != nil {
			return err
		}
	}

	// Delete the user
	_, err = client.DeleteUser(&iam.DeleteUserInput{
		UserName: aws.String(username),
	})
	if err != nil {
		return err
	}

	return nil
}

type walUser struct {
	UserName string
}

const pathUserHelpSyn = `
Generate an access key pair for a specific role.
`

const pathUserHelpDesc = `
This path will generate a new, never before used key pair for
accessing AWS. The IAM policy used to back this key pair will be
the "name" parameter. For example, if this backend is mounted at "aws",
then "aws/creds/deploy" would generate access keys for the "deploy" role.

The access keys will have a lease associated with them. The access keys
can be revoked by using the lease ID.
`


text:
Before("@dynamodb") do
  @service = Aws::DynamoDB::Resource.new
  @client = @service.client
end

After("@dynamodb") do
  # shared cleanup logic
end


text:
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var ExchangeVersion_1 = require("../../Enumerations/ExchangeVersion");
var GetNonIndexableItemDetailsResponse_1 = require("../Responses/GetNonIndexableItemDetailsResponse");
var SearchPageDirection_1 = require("../../Enumerations/SearchPageDirection");
var ServiceValidationException_1 = require("../../Exceptions/ServiceValidationException");
var ExtensionMethods_1 = require("../../ExtensionMethods");
var Strings_1 = require("../../Strings");
var XmlElementNames_1 = require("../XmlElementNames");
var XmlNamespace_1 = require("../../Enumerations/XmlNamespace");
var SimpleServiceRequestBase_1 = require("./SimpleServiceRequestBase");
/**
 * @internal Represents a GetNonIndexableItemDetailsRequest request.
 *
 * @sealed
 */
var GetNonIndexableItemDetailsRequest = (function (_super) {
    __extends(GetNonIndexableItemDetailsRequest, _super);
    /**
     * @internal Initializes a new instance of the **GetNonIndexableItemDetailsRequest** class.
     *
     * @param   {ExchangeService}   service   The service.
     */
    function GetNonIndexableItemDetailsRequest(service) {
        _super.call(this, service);
        /**
         * Mailboxes
         */
        this.Mailboxes = null;
        /**
         * @Nullable Page size
         */
        this.PageSize = null;
        /**
         * Page item reference
         */
        this.PageItemReference = null;
        /**
         * @Nullable Page direction
         */
        this.PageDirection = null;
        /**
         * Whether to search archive only
         */
        this.SearchArchiveOnly = false;
    }
    /**
     * @internal Executes this request.
     *
     * @return  {IPromise<GetNonIndexableItemDetailsResponse>}      Service response  :Promise.
     */
    GetNonIndexableItemDetailsRequest.prototype.Execute = function () {
        return this.InternalExecute().then(function (serviceResponse) {
            return serviceResponse;
        });
    };
    /**
     * @internal Gets the request version.
     *
     * @return  {ExchangeVersion}      Earliest Exchange version in which this request is supported.
     */
    GetNonIndexableItemDetailsRequest.prototype.GetMinimumRequiredServerVersion = function () {
        return ExchangeVersion_1.ExchangeVersion.Exchange2013;
    };
    /**
     * @internal Gets the name of the response XML element.
     *
     * @return  {string}      XML element name.
     */
    GetNonIndexableItemDetailsRequest.prototype.GetResponseXmlElementName = function () {
        return XmlElementNames_1.XmlElementNames.GetNonIndexableItemDetailsResponse;
    };
    /**
     * @internal Gets the name of the XML element.
     *
     * @return  {string}      XML element name.
     */
    GetNonIndexableItemDetailsRequest.prototype.GetXmlElementName = function () {
        return XmlElementNames_1.XmlElementNames.GetNonIndexableItemDetails;
    };
    /**
     * @internal Parses the response.
     *
     * @param   {any}   jsonBody   The js object response body.
     * @return  {any}              Response object.
     */
    GetNonIndexableItemDetailsRequest.prototype.ParseResponse = function (jsonBody) {
        var response = new GetNonIndexableItemDetailsResponse_1.GetNonIndexableItemDetailsResponse();
        response.LoadFromXmlJsObject(jsonBody, this.Service);
        return response;
    };
    /**
     * @internal Validate request.
     */
    GetNonIndexableItemDetailsRequest.prototype.Validate = function () {
        _super.prototype.Validate.call(this);
        if (this.Mailboxes == null || this.Mailboxes.length == 0) {
            throw new ServiceValidationException_1.ServiceValidationException(Strings_1.Strings.MailboxesParameterIsNotSpecified);
        }
    };
    /**
     * @internal Writes the elements to XML writer.
     *
     * @param   {EwsServiceXmlWriter}   writer   The writer.
     */
    GetNonIndexableItemDetailsRequest.prototype.WriteElementsToXml = function (writer) {
        writer.WriteStartElement(XmlNamespace_1.XmlNamespace.Messages, XmlElementNames_1.XmlElementNames.Mailboxes);
        for (var _i = 0, _a = this.Mailboxes; _i < _a.length; _i++) {
            var mailbox = _a[_i];
            writer.WriteElementValue(XmlNamespace_1.XmlNamespace.Types, XmlElementNames_1.XmlElementNames.LegacyDN, mailbox);
        }
        writer.WriteEndElement();
        if (this.PageSize) {
            writer.WriteElementValue(XmlNamespace_1.XmlNamespace.Messages, XmlElementNames_1.XmlElementNames.PageSize, this.PageSize);
        }
        if (!ExtensionMethods_1.StringHelper.IsNullOrEmpty(this.PageItemReference)) {
            writer.WriteElementValue(XmlNamespace_1.XmlNamespace.Messages, XmlElementNames_1.XmlElementNames.PageItemReference, this.PageItemReference);
        }
        if (this.PageDirection) {
            writer.WriteElementValue(XmlNamespace_1.XmlNamespace.Messages, XmlElementNames_1.XmlElementNames.PageDirection, SearchPageDirection_1.SearchPageDirection[this.PageDirection]);
        }
        writer.WriteElementValue(XmlNamespace_1.XmlNamespace.Messages, XmlElementNames_1.XmlElementNames.SearchArchiveOnly, this.SearchArchiveOnly);
    };
    return GetNonIndexableItemDetailsRequest;
}(SimpleServiceRequestBase_1.SimpleServiceRequestBase));
exports.GetNonIndexableItemDetailsRequest = GetNonIndexableItemDetailsRequest;


text:
[![CocoaPods Version](https://img.shields.io/cocoapods/v/GTScrollNavigationBar.svg)](http://cocoadocs.org/docsets/GTScrollNavigationBar) [![Build Status](https://travis-ci.org/luugiathuy/GTScrollNavigationBar.svg?branch=master)](https://travis-ci.org/luugiathuy/GTScrollNavigationBar) [![Coverage Status](https://coveralls.io/repos/luugiathuy/GTScrollNavigationBar/badge.svg?branch=master&service=github)](https://coveralls.io/github/luugiathuy/GTScrollNavigationBar?branch=master)

A lightweight scrollable UINavigationBar that follows a UIScrollView. This project was inspired by the navigation bar functionality seen in the Chrome, Facebook and Instagram iOS apps.

![GTScrollNavigationBar Screenshot 1](http://luugiathuy.com/images/GTScrollNavigationBar1.png) ![GTScrollNavigationBar Screenshot 2](http://luugiathuy.com/images/GTScrollNavigationBar2.png)

## Installation

### CocoaPods

Add pod `GTScrollNavigationBar` to your Podfile.

### Manually

Add the `GTScrollNavigationBar` folder to your project. `GTScrollNavigationBar` uses ARC, so if you have a project that doesn't use ARC, add the `-fobjc-arc` compiler flag to the `GTScrollNavigationBar` files.

## Usage

Set up the navigation controller to use `GTScrollNavigationBar`:

```objective-c
#import "GTScrollNavigationBar.h"

self.navController = [[UINavigationController alloc] initWithNavigationBarClass:[GTScrollNavigationBar class]
                                                                   toolbarClass:nil];
[self.navController setViewControllers:@[self.mainViewController] animated:NO];
```

In your view controller which has a `UIScrollView`, e.g. `UITableViewController`, set the UIScrollView object to the `GTScrollNavigationBar` in `viewWillAppear:` or `viewDidAppear:` by:

```objective-c
self.navigationController.scrollNavigationBar.scrollView = self.tableView;
```

To unfollow the scrollView, simply set `scrollView` property to `nil`

```objective-c
self.navigationController.scrollNavigationBar.scrollView = nil;
```

Implement `scrollViewDidScrollToTop:` in the view controller to reset the navigation bar's position

```objective-c
- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
{
    [self.navigationController.scrollNavigationBar resetToDefaultPositionWithAnimation:NO];
}
```

## Contact

[@luugiathuy](http://twitter.com/luugiathuy)


text:
.. _reports-bold:

BOLD images
===========
One individual report per input functional timeseries will be generated
in the path ``<output_dir>/reports/sub-IDxxx_task-name_bold.html```.
An example report is given
`here <http://web.stanford.edu/group/poldracklab/mriqc/reports/sub-50013_task-rest_bold.html>`_.

The individual report for the functional images is structured as follows:

.. _reports-bold-summary:

Summary
-------
The first section summarizes some important information:

  * subject identifier, date and time of execution of
    ``mriqc``, software version;
  * workflow details and flags raised during execution; and
  * the extracted IQMs.

.. _reports-bold-visual:

Visual reports
--------------
The section with visual reports contains:

#. Mosaic view of the average BOLD signal.

   .. figure:: ../resources/reports-bold_mean.png
     :alt: mean epi mosaic

#. Mosaic view of the temporal standard deviation.

   .. figure:: ../resources/reports-bold_sd.png
     :alt: sd of epi mosaic

#. Summary plot, showing the slice-wise
   signal intensity at the extremes for the identification
   of spikes, the outliers metric, the DVARS and the
   :abbr:`FD (framewise displacement)`. Finally the
   so-called carpetplot [Power2016]_

   .. figure:: ../resources/reports-bold_summary.png
     :alt: fMRI summary plot

.. _reports-bold-verbose:

Verbose reports
---------------
If mriqc was run with the ``--verbose-reports`` flag, the
following plots will be appended:

#. Mosaic view of the average BOLD signal, zoomed-in
   to the bounding box of brain activation.

   .. figure:: ../resources/reports-bold_mean_zoom.png
     :alt: zoomed mean epi mosaic

#. Mosaic view of the average BOLD signal, with background
   enhancement.

   .. figure:: ../resources/reports-bold_mean_bg.png
     :alt: mean epi background mosaic

#. One rows of axial views at different Z-axis points
   showing the calculated brain mask.

   .. figure:: ../resources/reports-bold_mask.png
     :alt: bold brainmasks

#. Mosaic view with animation for assessment of the
   co-registration to MNI space (roll over the image
   to activate the animation).

   .. figure:: ../resources/reports-bold_mni.png
     :alt: bold-mni coregistration

.. _reports-bold-metadata:

Metadata
--------
If some metadata was found in the BIDS structure, it is
reported here.

.. topic:: References

  .. [Power2016] Power JD, A simple but useful way to assess fMRI scan qualities.
     NeuroImage. 2016. doi: `10.1016/j.neuroimage.2016.08.009 <http://doi.org/10.1016/j.neuroimage.2016.08.009>`_


text:
(function() {
  "use strict";

  App.FeaturedProductView = Ember.View.extend({
    tagName: 'li',
    classNameBindings: ['isFourthChild:omega'],

    isFourthChild: function() {
      return this.get('index') % 4 === 0;
    }.property('index')
  });

})();


text:
using System;
using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.AcceptanceCriteria;
using FluentNHibernate.Conventions.Inspections;
using FluentNHibernate.Conventions.Instances;

namespace Quarks.FluentNHibernate.Conventions.Reference
{
	class ForeignKey : IReferenceConvention, IReferenceConventionAcceptance
	{
		public void Apply(IManyToOneInstance instance)
		{
			instance.ForeignKey(getForeignKeyName(instance.Property.DeclaringType, instance.Property.PropertyType));
		}

		/// <summary>
		/// Ignore properties that have already been set.
		/// </summary>
		public void Accept(IAcceptanceCriteria<IManyToOneInspector> criteria)
		{
			criteria.Expect(x => string.IsNullOrEmpty(x.ForeignKey));
		}

		static string getForeignKeyName(Type referencingType, Type referencedType)
		{
			return string.Format("FK_{0}_{1}", referencingType.GetTableName(), referencedType.GetTableName());
		}
	}
}


text:
package proguard.classfile.attribute.preverification;

import proguard.classfile.*;
import proguard.classfile.attribute.CodeAttribute;
import proguard.classfile.attribute.preverification.visitor.*;

/**
 * This StackMapFrame represents a "full frame".
 *
 * @author Eric Lafortune
 */
public class FullFrame extends StackMapFrame
{
    public int                variablesCount;
    public VerificationType[] variables;
    public int                stackCount;
    public VerificationType[] stack;

    /**
     * Creates an uninitialized FullFrame.
     */
    public FullFrame()
    {
    }

    /**
     * Creates a FullFrame with the given variables and stack.
     */
    public FullFrame(int                offsetDelta,
                     VerificationType[] variables,
                     VerificationType[] stack)
    {
        this(offsetDelta,
             variables.length,
             variables,
             stack.length,
             stack);
    }

    /**
     * Creates a FullFrame with the given variables and stack.
     */
    public FullFrame(int                offsetDelta,
                     int                variablesCount,
                     VerificationType[] variables,
                     int                stackCount,
                     VerificationType[] stack)
    {
        this.u2offsetDelta  = offsetDelta;
        this.variablesCount = variablesCount;
        this.variables      = variables;
        this.stackCount     = stackCount;
        this.stack          = stack;
    }

    /**
     * Applies the given verification type visitor to all variables.
     */
    public void variablesAccept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VerificationTypeVisitor verificationTypeVisitor)
    {
        for (int index = 0; index < variablesCount; index++)
        {
            variables[index].variablesAccept(clazz, method, codeAttribute, offset, index, verificationTypeVisitor);
        }
    }

    /**
     * Applies the given verification type visitor to all stack.
     */
    public void stackAccept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VerificationTypeVisitor verificationTypeVisitor)
    {
        for (int index = 0; index < stackCount; index++)
        {
            stack[index].stackAccept(clazz, method, codeAttribute, offset, index, verificationTypeVisitor);
        }
    }

    // Implementations for StackMapFrame.

    public int getTag()
    {
        return FULL_FRAME;
    }

    public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, StackMapFrameVisitor stackMapFrameVisitor)
    {
        stackMapFrameVisitor.visitFullFrame(clazz, method, codeAttribute, offset, this);
    }

    // Implementations for Object.

    public boolean equals(Object object)
    {
        if (!super.equals(object))
        {
            return false;
        }

        FullFrame other = (FullFrame)object;

        if (this.u2offsetDelta  != other.u2offsetDelta  ||
            this.variablesCount != other.variablesCount ||
            this.stackCount     != other.stackCount)
        {
            return false;
        }

        for (int index = 0; index < variablesCount; index++)
        {
            VerificationType thisType  = this.variables[index];
            VerificationType otherType = other.variables[index];

            if (!thisType.equals(otherType))
            {
                return false;
            }
        }

        for (int index = 0; index < stackCount; index++)
        {
            VerificationType thisType  = this.stack[index];
            VerificationType otherType = other.stack[index];

            if (!thisType.equals(otherType))
            {
                return false;
            }
        }

        return true;
    }

    public int hashCode()
    {
        int hashCode = super.hashCode();

        for (int index = 0; index < variablesCount; index++)
        {
            hashCode ^= variables[index].hashCode();
        }

        for (int index = 0; index < stackCount; index++)
        {
            hashCode ^= stack[index].hashCode();
        }

        return hashCode;
    }

    public String toString()
    {
        StringBuffer buffer = new StringBuffer(super.toString()).append("Var: ");

        for (int index = 0; index < variablesCount; index++)
        {
            buffer = buffer.append('[')
                           .append(variables[index].toString())
                           .append(']');
        }

        buffer.append(", Stack: ");

        for (int index = 0; index < stackCount; index++)
        {
            buffer = buffer.append('[')
                           .append(stack[index].toString())
                           .append(']');
        }

        return buffer.toString();
    }
}


text:
module.exports = {}
module.exports.indent = indent
module.exports.indentBy = indentBy
module.exports.destructuring = destructuring
module.exports.getFunctionParameters = getFunctionParameters
module.exports.getLastParamName = getLastParamName
module.exports.replaceLastParam = replaceLastParam
module.exports.isArrowFunction = isArrowFunction

function indent (level, text, spaces) {
  level = level || 0
  if (typeof text === 'number') {
    spaces = text
    text = null
  }
  spaces = spaces || 2
  text = text || null

  if (text && typeof text === 'string') {
    return text.split('\n').map(function (row) {
      return indent(level, spaces) + row
    }).join('\n')
  } else if (text && text instanceof Array) {
    return text.map(indentBy(level, spaces))
  }

  return Array(level * spaces + 1).join(' ')
}

function indentBy (level, spaces) {
  return function (str) {
    return indent(level, spaces) + str
  }
}

function destructuring (constraint, to) {
  var parts = []
  constraint.parameters.forEach(function (parameter, i) {
    if (parameter.type === 'Literal') {
      parts.push(indent(0) + 'if (' + to + '[' + i + '] !== ' + escape(parameter.value) + ') {')
      parts.push(indent(1) + 'return')
      parts.push(indent(0) + '}')
      return
    }

    var name = parameter.name
    if (parameter.type === 'ArrayExpression') {
      console.log('This feature needs native Destructuring (Array value).')

      name = parameter.original
    } else if (parameter.type === 'ObjectExpression') {
      console.info('This feature needs native Destructuring (Object value).')

      name = parameter.original
    }

    parts.push('var ' + name + ' = ' + to + '[' + i + ']')
  })
  return parts
}

function getFunctionParameters (func) {
  if (isArrowFunction(func)) {
    return func.toString().match(/^\(\s*([^\)]*)\)\s*=>/m)[1]
  } else {
    return func.toString().match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1]
  }
}

function getLastParamName (params) {
  return params.replace(/(^.*,|^)\s*([^,]+)$/g, '$2')
}

function replaceLastParam (params, replacement) {
  return params.replace(/((^.*,|^)\s*)([^,]+)$/g, '$1' + replacement)
}

function isArrowFunction (func) {
  return !func.hasOwnProperty('prototype')
}