text:
package main

import (
	"errors"
	"fmt"
	"os"
	"path/filepath"
	"syscall"

	"github.com/appc/spec/schema"
	"github.com/appc/spec/schema/types"
	"github.com/coreos/rkt/common"
	"github.com/coreos/rkt/networking"
	stage1commontypes "github.com/coreos/rkt/stage1/common/types"
	stage1initcommon "github.com/coreos/rkt/stage1/init/common"
	"github.com/coreos/rkt/stage1/init/kvm"
	"github.com/hashicorp/errwrap"
)

// KvmNetworkingToSystemd generates systemd unit files for a pod according to network configuration
func KvmNetworkingToSystemd(p *stage1commontypes.Pod, n *networking.Networking) error {
	podRoot := common.Stage1RootfsPath(p.Root)

	// networking
	netDescriptions := kvm.GetNetworkDescriptions(n)
	if err := kvm.GenerateNetworkInterfaceUnits(filepath.Join(podRoot, stage1initcommon.UnitsDir), netDescriptions); err != nil {
		return errwrap.Wrap(errors.New("failed to transform networking to units"), err)
	}

	return nil
}

func mountSharedVolumes(root string, p *stage1commontypes.Pod, ra *schema.RuntimeApp) error {
	app := ra.App
	appName := ra.Name
	volumes := p.Manifest.Volumes
	vols := make(map[types.ACName]types.Volume)
	for _, v := range volumes {
		vols[v.Name] = v
	}

	sharedVolPath := common.SharedVolumesPath(root)
	if err := os.MkdirAll(sharedVolPath, stage1initcommon.SharedVolPerm); err != nil {
		return errwrap.Wrap(errors.New("could not create shared volumes directory"), err)
	}
	if err := os.Chmod(sharedVolPath, stage1initcommon.SharedVolPerm); err != nil {
		return errwrap.Wrap(fmt.Errorf("could not change permissions of %q", sharedVolPath), err)
	}

	imageManifest := p.Images[appName.String()]
	mounts := stage1initcommon.GenerateMounts(ra, vols, imageManifest)
	for _, m := range mounts {
		vol := vols[m.Volume]

		absRoot, err := filepath.Abs(p.Root) // Absolute path to the pod's rootfs.
		if err != nil {
			return errwrap.Wrap(errors.New("could not get pod's root absolute path"), err)
		}

		absAppRootfs := common.AppRootfsPath(absRoot, appName)
		if err != nil {
			return fmt.Errorf(`could not evaluate absolute path for application rootfs in app: %v`, appName)
		}

		mntPath, err := stage1initcommon.EvaluateSymlinksInsideApp(absAppRootfs, m.Path)
		if err != nil {
			return errwrap.Wrap(fmt.Errorf("could not evaluate path %v", m.Path), err)
		}
		absDestination := filepath.Join(absAppRootfs, mntPath)
		shPath := filepath.Join(sharedVolPath, vol.Name.String())
		if err := stage1initcommon.PrepareMountpoints(shPath, absDestination, &vol, m.DockerImplicit); err != nil {
			return err
		}

		readOnly := stage1initcommon.IsMountReadOnly(vol, app.MountPoints)
		var source string
		switch vol.Kind {
		case "host":
			source = vol.Source
		case "empty":
			source = filepath.Join(common.SharedVolumesPath(root), vol.Name.String())
		default:
			return fmt.Errorf(`invalid volume kind %q. Must be one of "host" or "empty"`, vol.Kind)
		}
		if cleanedSource, err := filepath.EvalSymlinks(source); err != nil {
			return errwrap.Wrap(fmt.Errorf("could not resolve symlink for source: %v", source), err)
		} else if err := ensureDestinationExists(cleanedSource, absDestination); err != nil {
			return errwrap.Wrap(fmt.Errorf("could not create destination mount point: %v", absDestination), err)
		} else if err := doBindMount(cleanedSource, absDestination, readOnly); err != nil {
			return errwrap.Wrap(fmt.Errorf("could not bind mount path %v (s: %v, d: %v)", m.Path, source, absDestination), err)
		}
	}
	return nil
}

func doBindMount(source, destination string, readOnly bool) error {
	if err := syscall.Mount(source, destination, "bind", syscall.MS_BIND, ""); err != nil {
		return err
	}
	if readOnly {
		return syscall.Mount(source, destination, "bind", syscall.MS_REMOUNT|syscall.MS_RDONLY|syscall.MS_BIND, "")
	}
	return nil
}

func ensureDestinationExists(source, destination string) error {
	fileInfo, err := os.Stat(source)
	if err != nil {
		return errwrap.Wrap(fmt.Errorf("could not stat source location: %v", source), err)
	}

	targetPathParent, _ := filepath.Split(destination)
	if err := os.MkdirAll(targetPathParent, stage1initcommon.SharedVolPerm); err != nil {
		return errwrap.Wrap(fmt.Errorf("could not create parent directory: %v", targetPathParent), err)
	}

	if fileInfo.IsDir() {
		if err := os.Mkdir(destination, stage1initcommon.SharedVolPerm); !os.IsExist(err) {
			return err
		}
	} else {
		if file, err := os.OpenFile(destination, os.O_CREATE, stage1initcommon.SharedVolPerm); err != nil {
			return err
		} else {
			file.Close()
		}
	}
	return nil
}

func prepareMountsForApp(s1Root string, p *stage1commontypes.Pod, ra *schema.RuntimeApp) error {
	// bind mount all shared volumes (we don't use mechanism for bind-mounting given by nspawn)
	if err := mountSharedVolumes(s1Root, p, ra); err != nil {
		return errwrap.Wrap(errors.New("failed to prepare mount point"), err)
	}

	return nil
}

func KvmPrepareMounts(s1Root string, p *stage1commontypes.Pod) error {
	for i := range p.Manifest.Apps {
		ra := &p.Manifest.Apps[i]
		if err := prepareMountsForApp(s1Root, p, ra); err != nil {
			return errwrap.Wrap(fmt.Errorf("failed prepare mounts for app %q", ra.Name), err)
		}
	}

	return nil
}


text:
#ifndef OPENTISSUE_DYNAMICS_MBD_UTIL_MATH_MBD_DEFAULT_UBLAS_MATH_POLICY_H
#define OPENTISSUE_DYNAMICS_MBD_UTIL_MATH_MBD_DEFAULT_UBLAS_MATH_POLICY_H
//
// OpenTissue Template Library
// - A generic toolbox for physics-based modeling and simulation.
// Copyright (C) 2008 Department of Computer Science, University of Copenhagen.
//
// OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php
//
#include <OpenTissue/configuration.h>

#include <OpenTissue/core/math/big/big_types.h>
#include <OpenTissue/core/math/big/big_prod.h>
#include <OpenTissue/core/math/big/big_prod_row.h>
#include <OpenTissue/core/math/big/big_prod_add_rhs.h>
#include <OpenTissue/core/math/big/big_prod_sub_rhs.h>
#include <OpenTissue/core/math/big/big_prod_sub.h>
#include <OpenTissue/core/math/big/big_prod_add.h>
#include <OpenTissue/core/math/big/big_prod_trans.h>

#include <OpenTissue/core/math/big/io/big_matlab_write.h>

#include <OpenTissue/core/math/math_basic_types.h>

namespace OpenTissue
{
  namespace mbd
  {

    /**
    * The  Typebinder takes a template parameter: math_policy_. This
    * template parameter passes along all math types to the mbd engine.
    *
    * For convenience we have created the class default_ublas_math_policy. The
    * intention is that it can be used as the math_policy argument by users
    * that do not care about what kind of matrix libraries the  Engine
    * should rely on.
    */
    template< typename real_type_>
    class default_ublas_math_policy
      : public OpenTissue::math::BasicMathTypes<real_type_,size_t>
    {
    public:
      typedef typename OpenTissue::math::BasicMathTypes<real_type_, size_t>   basic_math_types;
      typedef typename basic_math_types::real_type                            real_type;
      typedef typename basic_math_types::index_type                           index_type;

    public:

      typedef ublas::compressed_matrix<real_type_>    matrix_type;
      typedef ublas::vector<real_type_>               vector_type;
      typedef typename vector_type::size_type         size_type;
      typedef ublas::vector<index_type>               idx_vector_type;
      typedef matrix_type                             system_matrix_type;
      typedef ublas::vector_range< vector_type >      vector_range;
      typedef ublas::matrix_range< matrix_type >      matrix_range;
      typedef ublas::vector_range< idx_vector_type >  idx_vector_range;

    public:

      static matrix_range subrange(
        matrix_type & M
        , size_type start1
        , size_type stop1
        , size_type start2
        , size_type stop2
        )
      {
        return ublas::subrange(M,start1,stop1,start2,stop2);
      }

      static vector_range subrange(vector_type & v, size_type start, size_type stop )
      {
        return ublas::subrange(v,start,stop);
      }

      static idx_vector_range subrange(idx_vector_type & v, size_type start, size_type stop )
      {
        return ublas::subrange(v,start,stop);
      }

      static void get_dimension(vector_type const & v, size_type & n)
      {
        n = v.size();
      }

      static void get_dimensions(matrix_type const & A,size_type & m, size_type & n)
      {
        m = A.size1();
        n = A.size2();
      }

      static void resize(vector_type & x,size_type n)
      {
        x.resize(n);
        x.clear();
      }

      static void resize(idx_vector_type & x,size_type n)
      {
        x.resize(n);
        x.clear();
      }

      static void resize(matrix_type & A,size_type m,size_type n)
      {
        A.resize(m,n,false);
        A.clear();
      }

      /**
      *computes: y = prod(A,x) + b
      */
      static void prod(matrix_type const & A,vector_type const & x, vector_type const & b, vector_type & y)
      {
        y.resize(A.size1(),false);
        OpenTissue::math::big::prod_add_rhs(A,x,b,y);
      }

      /**
      *computes: y = prod(A,x) - b
      */
      static void prod_minus(matrix_type const & A,vector_type const & x, vector_type const & b, vector_type & y)
      {
        y.resize(A.size1(),false);
        OpenTissue::math::big::prod_sub_rhs(A,x,b,y);
      }

      /**
      *computes: y = prod(A,x)
      */
      static void prod(matrix_type const & A,vector_type const & x, vector_type & y)
      {
        y.resize(A.size1(),false);
        OpenTissue::math::big::prod(A,x,y);
      }

      /**
      *computes: y += prod(A,x)
      */
      static void prod_add(matrix_type const & A,vector_type const & x, vector_type & y)
      {
        y.resize(A.size1(),false);
        OpenTissue::math::big::prod_add(A,x,y);
      }

      /**
      *computes: y = prod(A,x)*s
      */
      static void prod(matrix_type const & A,vector_type const & x, vector_type & y, real_type const & s)
      {
        y.resize(A.size1(),false);
        OpenTissue::math::big::prod(A,x,s,y);
      }

      /**
      *computes: y += prod(A,x)*s
      */
      static void prod_add(matrix_type const & A,vector_type const & x, vector_type & y, real_type const & s)
      {
        y.resize(A.size1(),false);
        OpenTissue::math::big::prod_add(A,x,s,y);
      }

      /**
      *computes: y = prod(trans(A),x)
      */
      static void prod_trans(matrix_type const & A,vector_type const & x, vector_type & y)
      {
        y.resize(A.size2(),false);
        OpenTissue::math::big::prod_trans(A,x,y);
      }

      /**
      *computes: y = prod(trans(A),x) + b
      */
      static void prod_trans(matrix_type const & A,vector_type const & x, vector_type const & b, vector_type & y)
      {
        y.resize(A.size2(),false);
        OpenTissue::math::big::prod_trans(A,x,b,y);
      }

      /**
      *computes: x *= s
      */
      static void prod(vector_type & x, real_type const & s )
      {
        x *= s;
      }

      /**
      *computes: x = -y
      */
      static void assign_minus(vector_type const & y,  vector_type & x)
      {
        x = -y;
      }

      static void compute_system_matrix(matrix_type const & invM, matrix_type const & J, system_matrix_type & A)
      {
        A.resize(J.size1(), J.size1(),false);
        // Sparse matrix product is the fastest method in uBLAS for this.
        // However, it does not work in version 1.33.1
        //
        // It seems that sparse_prod have problems with really huge
        // matrices, above 60Kx60K we often experience an unhandled
        // exception. Which seems to come from an allocation failure (perhaps
        // a compiler operating system thing?)
        matrix_type JT;
        JT.resize(J.size2(), J.size1(), false);
        ublas::noalias(JT) = ublas::trans(J);
        matrix_type WJT;
        WJT.resize(invM.size1(), JT.size2(), false);
        ublas::noalias(WJT) = ublas::sparse_prod<matrix_type>( invM, JT);
        ublas::noalias(A) = ublas::sparse_prod<matrix_type>(J, WJT );
      }

    public:

      ///< Interface to support the GaussSeidel NCP solver.

      static real_type row_prod(system_matrix_type const & A,size_type i,vector_type const & x)
      {
        return OpenTissue::math::big::prod_row(A,x,i);
      }

      /**
      * This method is specifically introduced to support the GaussSeidel NCP solver.
      */
      static void init_system_matrix(system_matrix_type & A, vector_type const & x)
      {
        // do nothing
      }

      /**
      * This method is specifically introduced to support the GaussSeidel NCP solver.
      */
      static void update_system_matrix(system_matrix_type & A, size_type i, real_type const & dx)
      {
        // do nothing...
      }

    };

  } // namespace mbd
} // namespace OpenTissue
// OPENTISSUE_DYNAMICS_MBD_UTIL_MATH_MBD_DEFAULT_UBLAS_MATH_POLICY_H
#endif

redpajama_set_name: RedPajamaGithub


text:
using MasterDevs.ChromeDevTools;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace MasterDevs.ChromeDevTools.Protocol.iOS.CSS
{
	/// <summary>
	/// CSS stylesheet metainformation.
	/// </summary>
	[SupportedBy("iOS")]
	public class CSSStyleSheetHeader
	{
		/// <summary>
		/// Gets or sets The stylesheet identifier.
		/// </summary>
		public string StyleSheetId { get; set; }
		/// <summary>
		/// Gets or sets Owner frame identifier.
		/// </summary>
		public string FrameId { get; set; }
		/// <summary>
		/// Gets or sets Stylesheet resource URL.
		/// </summary>
		public string SourceURL { get; set; }
		/// <summary>
		/// Gets or sets Stylesheet origin.
		/// </summary>
		public StyleSheetOrigin Origin { get; set; }
		/// <summary>
		/// Gets or sets Stylesheet title.
		/// </summary>
		public string Title { get; set; }
		/// <summary>
		/// Gets or sets Denotes whether the stylesheet is disabled.
		/// </summary>
		public bool Disabled { get; set; }
		/// <summary>
		/// Gets or sets Whether this stylesheet is a <style> tag created by the parser. This is not set for document.written <style> tags.
		/// </summary>
		public bool IsInline { get; set; }
		/// <summary>
		/// Gets or sets Line offset of the stylesheet within the resource (zero based).
		/// </summary>
		public double StartLine { get; set; }
		/// <summary>
		/// Gets or sets Column offset of the stylesheet within the resource (zero based).
		/// </summary>
		public double StartColumn { get; set; }
	}
}


text:
/**
 * This file was automatically generated.
 * DO NOT MODIFY BY HAND.
 * Run `yarn special-lint-fix` to update
 */

export interface LimitChunkCountPluginOptions {
	/**
	 * Constant overhead for a chunk
	 */
	chunkOverhead?: number;
	/**
	 * Multiplicator for initial chunks
	 */
	entryChunkMultiplicator?: number;
	/**
	 * Limit the maximum number of chunks using a value greater greater than or equal to 1
	 */
	maxChunks: number;
}


text:
package com.github.scribejava.apis.examples;

import com.github.scribejava.apis.Asana20Api;
import com.github.scribejava.core.builder.ServiceBuilder;
import com.github.scribejava.core.model.OAuth2AccessToken;
import com.github.scribejava.core.model.OAuthRequest;
import com.github.scribejava.core.model.Response;
import com.github.scribejava.core.model.Verb;
import com.github.scribejava.core.oauth.OAuth20Service;

import java.io.IOException;
import java.util.Random;
import java.util.Scanner;
import java.util.concurrent.ExecutionException;

public class AsanaExample {

    private static final String PROTECTED_RESOURCE_URL = "https://app.asana.com/api/1.0/users/me";

    private AsanaExample() {
    }

    @SuppressWarnings("PMD.SystemPrintln")
    public static void main(String... args) throws IOException, InterruptedException, ExecutionException {
        final String apiKey = "your client id";
        final String apiSecret = "your client secret";
        final String secretState = "secret" + new Random().nextInt(999_999);
        final OAuth20Service service = new ServiceBuilder(apiKey)
                .apiSecret(apiSecret)
                .callback("https://localhost/")
                .build(Asana20Api.instance());
        final Scanner in = new Scanner(System.in);

        // Obtain Auth URL
        System.out.println("Fetching the Authorication URL...");
        System.out.println("Got the Authorization URL!");
        final String authorizationUrl = service.getAuthorizationUrl(secretState);
        System.out.println("Now go and authorize ScribeJava here:");
        System.out.println(authorizationUrl);
        System.out.println("And paste the authorization code here");
        System.out.print(">>");
        final String code = in.nextLine();
        System.out.println();

        System.out.println("Trading the Authorization Code for an Access Token...");
        OAuth2AccessToken accessToken = service.getAccessToken(code);
        System.out.println("Got the Access Token!");
        System.out.println("(The raw response looks like this: " + accessToken.getRawResponse() + "')");
        System.out.println();

        System.out.println("And paste the state from server here. We have set 'secretState'='" + secretState + "'.");
        System.out.print(">>");
        final String value = in.nextLine();
        if (secretState.equals(value)) {
            System.out.println("State value does match!");
        } else {
            System.out.println("Ooops, state value does not match!");
            System.out.println("Expected = " + secretState);
            System.out.println("Got      = " + value);
            System.out.println();
        }

        System.out.println("Refreshing the Access Token...");
        accessToken = service.refreshAccessToken(accessToken.getRefreshToken());
        System.out.println("Refreshed the Access Token!");
        System.out.println("(The raw response looks like this: " + accessToken.getRawResponse() + "')");
        System.out.println();

        System.out.println("Now we're going to access a protected resource...");
        final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
        service.signRequest(accessToken, request);
        try (Response response = service.execute(request)) {
            System.out.println("Got it! Lets see what we found...");
            System.out.println();
            System.out.println(response.getCode());
            System.out.println(response.getBody());
        }

        System.out.println();
        System.out.println("Thats it man! Go and build something awesome with ScribeJava! :)");
    }
}


text:
module System.Plugins.LoadTypes
    ( Key (..)
    , Symbol
    , Type
    , Errors
    , PackageConf
    , Module (..)
    , ObjType (..)
    ) where

-- import Language.Hi.Parser

import HscTypes

data Key = Object String | Package String

type Symbol      = String
type Type        = String
type Errors      = [String]
type PackageConf = FilePath

data Module = Module { path  :: !FilePath
                     , mname :: !String
                     , kind  :: !ObjType
                     , iface :: ModIface    -- cache the iface
                     , key   :: Key
                     }

instance Ord Module where
    compare m1 m2 = mname m1 `compare` mname m2

instance Eq Module where
    m1 == m2 = mname m1 == mname m2

data ObjType = Vanilla | Shared deriving Eq


text:
var _ = require('lodash');
var assign = require('object-assign');

// NOTE: the old signature was UpdateHandler (list, item, req, res, options)
// the `res` argument has been deprecated, but we still detect and handle it
function UpdateHandler (list, item, req, options) {
	this.list = list;
	this.item = item;
	this.req = req;
	if (arguments.length === 5) {
		// old signature; set options to the last argument
		options = arguments[4];
	}
	this.options = options || {};
}

/*
Options:

(passed to List.updateItem)
options.fields: list or array of fields to process
options.files: files object for processing uploads, defaults to req.files
options.required: list or array or object of keys: true | false
options.user: the user to provide for item tracking, defaults to req.user

(UpdateHandler specific)
options.flashErrors: whether to put error messages in req.flash
options.errorMessage: string, error message to display w/ req.flash
options.invalidMessages: object of keys: message to display for invalid fields
options.requiredMessages: object of keys: message to display for required fields
*/

/*
TODO:
We could allow a custom function for formatting errors that are put in
req.flash, because most use-cases will be covered by the generic handling
but it's an "all or none" proposition at the moment
*/

UpdateHandler.prototype.process = function (data, options, callback) {

	// options is not required
	if (typeof options === 'function') {
		callback = options;
		options = {};
	}

	var item = this.item;
	var list = this.list;
	var req = this.req;
	options = assign({}, this.options, options);

	// pass the user from the request by default
	if (!options.user) {
		options.user = this.req.user;
	}

	// pass the uploaded files object from the request by default
	if (!options.files) {
		options.files = this.req.files;
	}

	function flashErrors (err) {
		var errorMessage = options.errorMessage || 'There was a problem saving your changes';
		// Detect Keystone validation errors
		if (err.error === 'validation errors') {
			if (options.flashErrors === true || options.flashErrors === 'validation') {
				req.flash('error', {
					type: 'ValidationError',
					title: errorMessage,
					// TODO: Apply custom invalidMessages / requiredMessages
					list: _.map(err.detail, 'error'),
				});
			}
		}
		// Detect Mongoose validation errors
		else if (err.name === 'ValidationError') {
			if (options.flashErrors === true || options.flashErrors === 'validation') {
				req.flash('error', {
					type: 'ValidationError',
					title: errorMessage,
					list: _.map(err.errors, 'message'),
				});
			}
		}
		// Detect Keystone field update errors
		else if (err.error === 'field errors') {
			if (options.flashErrors === true || options.flashErrors === 'update') {
				req.flash('error', {
					type: 'UpdateError',
					title: errorMessage,
					list: _.map(err.detail, 'error'),
				});
			}
		}
		// Fallback
		else {
			if (options.flashErrors === true || options.flashErrors === 'update') {
				var errors = [];
				if (typeof err.error === 'string') {
					errors.push(err.error);
				}
				if (typeof err.detail === 'string') {
					errors.push(err.detail);
				}
				req.flash('error', {
					type: 'UpdateError',
					title: errorMessage,
					list: errors.length ? errors : undefined,
				});
			}
		}
	}

	this.list.updateItem(this.item, data, options, function (err) {
		if (err) {
			if (options.logErrors) {
				console.log('Error saving changes to ' + list.singular + ' ' + item.id + ':', err);
			}
			if (options.flashErrors) {
				flashErrors(err);
			}
		}
		callback(err);
	});

};

module.exports = UpdateHandler;


text:
YUI.add('DepCheckParentIndex', function(Y, NAME) {

    Y.namespace('mojito.binders')[NAME] = {

        /**
         * Binder initialization method, invoked after all binders on the page
         * have been constructed.
         */
        init: function(mojitProxy) {
            this.mp = mojitProxy;
        },

        /**
         * The binder method, invoked to allow the mojit to attach DOM event
         * handlers.
         *
         * @param node {Node} The DOM node to which this mojit is attached.
         */
        bind: function(node) {
            var self = this;
            self.node = node;
            self.node.one('#DepCheckParentButton').on('click', function() {
                Y.log("******************firstcall");
                self.mp.invoke('mytest',{},
				function(error, result){
				    Y.log("Here....."+result+error);
                	Y.Node.one('#DepCheckParentResult').set('innerHTML', result);
                });
			}, this);
			self.node.one('#MetaAddonButton').on('click', function() {
                Y.log("******************secondcall");
                self.mp.invoke('metachild',{},
				function(error, result){
				    Y.log("Here....."+result+error);
                	Y.Node.one('#DepCheckParentResult').set('innerHTML', result);
                });
			}, this);
			self.node.one('#RetrieveDataButton').on('click', function() {
                Y.log("******************thirdcall");
                self.mp.invoke('retrievedata',{},
				function(error, result){
				    Y.log("Here11111111111111111"+result+error);
                	Y.Node.one('#DepCheckParentResult').set('innerHTML', result);
                });
			}, this);
        }

    };

}, '0.0.1', {requires: ['mojito-client']});


text:
package com.bol.cd.fleet;

import com.bol.cd.fleet.plugins.JsonApplicationMediaTypeInterceptor;
import feign.Client;
import feign.Feign;
import feign.RequestInterceptor;
import feign.auth.BasicAuthRequestInterceptor;
import feign.jackson.JacksonDecoder;
import feign.jackson.JacksonEncoder;
import feign.jaxrs.JAXRSModule;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

public class FleetClient {

    private String username;
    private String password;
    private boolean requiresAuthentication = false;
    private final String url;

    private Client client;

    public static FleetApi create(final String url) {
        return new FleetClient(url).createClient();
    }

    public static FleetApi create(final String url, final String username, final String password) {
        return new FleetClient(url).authenticated(username, password).createClient();
    }

    public static FleetApi create(Client client, final String url, final String username, final String password) {
        return new FleetClient(url).withClient(client).authenticated(username, password).createClient();
    }

    private FleetClient(final String url) {
        Objects.requireNonNull(url, "url must be provided");
        this.url = url.replaceAll("/\\z", "");
    }

    public FleetClient withClient(Client client) {
        Objects.requireNonNull(client, "username must be provided");
        this.client = client;
        return this;
    }

    public FleetClient authenticated(final String username, final String password) {
        Objects.requireNonNull(username, "username must be provided");
        Objects.requireNonNull(password, "password must be provided");
        this.username = username;
        this.password = password;
        this.requiresAuthentication = true;
        return this;
    }

    private FleetApi createClient() {
        Feign.Builder builder = Feign.builder();
        if (client != null) {
            builder.client(client);
        }
        //@formatter:off
        builder.contract(new JAXRSModule.JAXRSContract())
                .decoder(new JacksonDecoder())
                .encoder(new JacksonEncoder())
                .errorDecoder(new FleetErrorDecoder())
                .requestInterceptors(getRequestInterceptors())
                .target(FleetApi.class, url);
        //@formatter:on
        return builder.target(FleetApi.class, url);

    }

    private Iterable<RequestInterceptor> getRequestInterceptors() {
        final List<RequestInterceptor> base = new ArrayList<RequestInterceptor>(Arrays.asList(new JsonApplicationMediaTypeInterceptor()));
        if (requiresAuthentication) {
            base.add(new BasicAuthRequestInterceptor(username, password));
        }
        return base;
    }

}


text:
import * as Hapi from "hapi";
import * as Joi from "joi";
import TaskController from "./task-controller";
import * as TaskValidator from "./task-validator";
import { jwtValidator } from "../users/user-validator";
import { IDatabase } from "../../database";
import { IServerConfigurations } from "../../configurations";

export default function (
  server: Hapi.Server,
  configs: IServerConfigurations,
  database: IDatabase
) {
  const taskController = new TaskController(configs, database);
  server.bind(taskController);

  server.route({
    method: "GET",
    path: "/tasks/{id}",
    options: {
      handler: taskController.getTaskById,
      auth: "jwt",
      tags: ["api", "tasks"],
      description: "Get task by id.",
      validate: {
        params: {
          id: Joi.string().required()
        },
        headers: jwtValidator
      },
      plugins: {
        "hapi-swagger": {
          responses: {
            "200": {
              description: "Task founded."
            },
            "404": {
              description: "Task does not exists."
            }
          }
        }
      }
    }
  });

  server.route({
    method: "GET",
    path: "/tasks",
    options: {
      handler: taskController.getTasks,
      auth: "jwt",
      tags: ["api", "tasks"],
      description: "Get all tasks.",
      validate: {
        query: {
          top: Joi.number().default(5),
          skip: Joi.number().default(0)
        },
        headers: jwtValidator
      }
    }
  });

  server.route({
    method: "DELETE",
    path: "/tasks/{id}",
    options: {
      handler: taskController.deleteTask,
      auth: "jwt",
      tags: ["api", "tasks"],
      description: "Delete task by id.",
      validate: {
        params: {
          id: Joi.string().required()
        },
        headers: jwtValidator
      },
      plugins: {
        "hapi-swagger": {
          responses: {
            "200": {
              description: "Deleted Task."
            },
            "404": {
              description: "Task does not exists."
            }
          }
        }
      }
    }
  });

  server.route({
    method: "PUT",
    path: "/tasks/{id}",
    options: {
      handler: taskController.updateTask,
      auth: "jwt",
      tags: ["api", "tasks"],
      description: "Update task by id.",
      validate: {
        params: {
          id: Joi.string().required()
        },
        payload: TaskValidator.updateTaskModel,
        headers: jwtValidator
      },
      plugins: {
        "hapi-swagger": {
          responses: {
            "200": {
              description: "Deleted Task."
            },
            "404": {
              description: "Task does not exists."
            }
          }
        }
      }
    }
  });

  server.route({
    method: "POST",
    path: "/tasks",
    options: {
      handler: taskController.createTask,
      auth: "jwt",
      tags: ["api", "tasks"],
      description: "Create a task.",
      validate: {
        payload: TaskValidator.createTaskModel,
        headers: jwtValidator
      },
      plugins: {
        "hapi-swagger": {
          responses: {
            "201": {
              description: "Created Task."
            }
          }
        }
      }
    }
  });
}


text:
package org.neo4j.legacy.consistency.report;

import org.neo4j.kernel.impl.store.record.AbstractBaseRecord;
import org.neo4j.legacy.consistency.RecordType;

public class InconsistencyReport implements InconsistencyLogger
{
    private final InconsistencyLogger logger;
    private final ConsistencySummaryStatistics summary;

    public InconsistencyReport( InconsistencyLogger logger, ConsistencySummaryStatistics summary )
    {
        this.logger = logger;
        this.summary = summary;
    }

    @Override
    public void error( RecordType recordType, AbstractBaseRecord record, String message, Object[] args )
    {
        logger.error( recordType, record, message, args );
    }

    @Override
    public void error( RecordType recordType, AbstractBaseRecord oldRecord, AbstractBaseRecord newRecord,
                       String message, Object[] args )
    {
        logger.error( recordType, oldRecord, newRecord, message, args );
    }

    @Override
    public void warning( RecordType recordType, AbstractBaseRecord record, String message, Object[] args )
    {
        logger.warning( recordType, record, message, args );
    }

    @Override
    public void warning( RecordType recordType, AbstractBaseRecord oldRecord, AbstractBaseRecord newRecord,
                         String message, Object[] args )
    {
        logger.warning( recordType, oldRecord, newRecord, message, args );
    }

    void updateSummary( RecordType type, int errors, int warnings )
    {
        summary.update( type, errors, warnings );
    }
}