text:
package com.github.cjnosal.secret_storage.keymanager;

import android.annotation.TargetApi;
import android.app.KeyguardManager;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.hardware.fingerprint.FingerprintManagerCompat;
import android.support.v4.os.CancellationSignal;

import com.github.cjnosal.secret_storage.keymanager.strategy.cipher.CipherSpec;
import com.github.cjnosal.secret_storage.keymanager.strategy.keygen.KeyGenSpec;
import com.github.cjnosal.secret_storage.storage.DataStorage;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.Key;

import javax.crypto.Cipher;

@TargetApi(Build.VERSION_CODES.M)
public class FingerprintWrapper extends KeyStoreWrapper {

    public FingerprintWrapper(KeyStoreWrapper.CryptoConfig cryptoConfig, DataStorage configStorage, DataStorage keyStorage) {
        this(cryptoConfig.getKeyProtectionSpec(), cryptoConfig.getKeyGenSpec(), configStorage, keyStorage);
    }

    public FingerprintWrapper(CipherSpec keyProtectionSpec, KeyGenSpec keyGenSpec, DataStorage configStorage, DataStorage keyStorage) {
        super(keyProtectionSpec, keyGenSpec, configStorage, keyStorage);
    }

    @Override
    public Editor getEditor() {
        return new FingerprintEditor();
    }

    @Override
    void unlock(UnlockParams params) throws IOException, GeneralSecurityException {
        FingerprintParams fingerprintParams = (FingerprintParams) params;
        FingerprintManagerCompat fingerprintManagerCompat = FingerprintManagerCompat.from(fingerprintParams.getContext());
        checkFingerprintStatus(fingerprintParams, fingerprintManagerCompat);

        FingerprintCallback fingerprintCallback;
        Cipher kekCipher;
        String storageField = configStorage.getScopedId(ROOT_ENCRYPTION_KEY);
        if (!intermediateKekExists()) {
            Key rootKek = androidCrypto.generateSecretKey(keyGenSpec.getKeygenAlgorithm(), getKeyGenParameterSpec(storageField));
            kekCipher = keyWrap.initWrapCipher(rootKek, intermediateKekProtectionSpec);
            fingerprintCallback = new FingerprintCallback(fingerprintParams.getAuthenticationCallback(), fingerprintParams.getListener(), true);
        } else {
            Key rootKek = androidCrypto.loadSecretKey(storageField);
            kekCipher = keyWrap.initUnwrapCipher(rootKek, intermediateKekProtectionSpec, getWrappedIntermediateKek());
            fingerprintCallback = new FingerprintCallback(fingerprintParams.getAuthenticationCallback(), fingerprintParams.getListener(), false);
        }

        fingerprintManagerCompat.authenticate(new FingerprintManagerCompat.CryptoObject(kekCipher), 0, fingerprintParams.getCancellationSignal(), fingerprintCallback, fingerprintParams.getHandler());
    }

    void verify(UnlockParams params) throws GeneralSecurityException {
        FingerprintParams fingerprintParams = (FingerprintParams) params;
        FingerprintManagerCompat fingerprintManagerCompat = FingerprintManagerCompat.from(fingerprintParams.getContext());
        checkFingerprintStatus(fingerprintParams, fingerprintManagerCompat);

        FingerprintCallback fingerprintCallback = new FingerprintCallback(fingerprintParams.getAuthenticationCallback(), fingerprintParams.getListener(), false);

        fingerprintManagerCompat.authenticate(null, 0, fingerprintParams.getCancellationSignal(), fingerprintCallback, fingerprintParams.getHandler());
    }

    private void checkFingerprintStatus(FingerprintParams fingerprintParams, FingerprintManagerCompat fingerprintManagerCompat) throws FingerprintException {
        KeyguardManager keyguardManager = (KeyguardManager) fingerprintParams.getContext().getSystemService(Context.KEYGUARD_SERVICE);

        if (!fingerprintManagerCompat.isHardwareDetected()) {
            throw new FingerprintException(Type.NoHardware, -1, "No fingerprint sensor on device");
        }
        if (!keyguardManager.isDeviceSecure()) {
            throw new FingerprintException(Type.NoLockscreen, -1, "User has not set up a lockscreen");
        }
        if (!fingerprintManagerCompat.hasEnrolledFingerprints()) {
            throw new FingerprintException(Type.NoFingerprint, -1, "User has not enrolled a fingerprint");
        }
    }

    public class FingerprintEditor extends BaseEditor {

        public FingerprintEditor() {
            super();
        }

        public void unlock(@NonNull Context context, @NonNull CancellationSignal cancellationSignal, @NonNull FingerprintManagerCompat.AuthenticationCallback authenticationCallback, @Nullable Handler handler) throws IOException, GeneralSecurityException {
            FingerprintWrapper.this.unlock(new FingerprintParams(context, null, cancellationSignal, authenticationCallback, handler));
        }

        public void unlock(@NonNull Context context, @NonNull CancellationSignal cancellationSignal, @NonNull Listener listener, @Nullable Handler handler) {
            try {
                FingerprintWrapper.this.unlock(new FingerprintParams(context, listener, cancellationSignal, null, handler));
            } catch (GeneralSecurityException | IOException e) {
                listener.onError(e);
            }
        }

        public void verify(@NonNull Context context, @NonNull CancellationSignal cancellationSignal, @NonNull FingerprintManagerCompat.AuthenticationCallback authenticationCallback, @Nullable Handler handler) throws GeneralSecurityException {
            FingerprintWrapper.this.verify(new FingerprintParams(context, null, cancellationSignal, authenticationCallback, handler));
        }

        public void verify(@NonNull Context context, @NonNull CancellationSignal cancellationSignal, @NonNull Listener listener, @Nullable Handler handler) {
            try {
                FingerprintWrapper.this.verify(new FingerprintParams(context, listener, cancellationSignal, null, handler));
            } catch (GeneralSecurityException e) {
                listener.onError(e);
            }
        }

        public boolean isInitialized() {
            return intermediateKekExists();
        }
    }

    class FingerprintCallback extends FingerprintManagerCompat.AuthenticationCallback {

        private final FingerprintManagerCompat.AuthenticationCallback wrappedCallback;
        private final Listener listener;
        private final boolean firstUnlock;

        public FingerprintCallback(@Nullable FingerprintManagerCompat.AuthenticationCallback wrappedCallback, @Nullable Listener listener, boolean firstUnlock) {
            this.wrappedCallback = wrappedCallback;
            this.listener = listener;
            this.firstUnlock = firstUnlock;
        }

        @Override
        public void onAuthenticationError(int errMsgId, CharSequence errString) {
            if (wrappedCallback != null) {
                wrappedCallback.onAuthenticationError(errMsgId, errString);
            }
            if (listener != null) {
                listener.onError(new FingerprintException(Type.Error, errMsgId, errString));
            }
        }

        @Override
        public void onAuthenticationHelp(int helpMsgId, CharSequence helpString) {
            if (wrappedCallback != null) {
                wrappedCallback.onAuthenticationHelp(helpMsgId, helpString);
            }
            if (listener != null) {
                listener.onError(new FingerprintException(Type.Help, helpMsgId, helpString));
            }
        }

        @Override
        public void onAuthenticationSucceeded(FingerprintManagerCompat.AuthenticationResult result) {
            try {
                FingerprintManagerCompat.CryptoObject cryptoObject = result.getCryptoObject();
                if (cryptoObject != null) {
                    if (firstUnlock) {
                        finishUnlock(null, cryptoObject.getCipher());
                    } else {
                        finishUnlock(cryptoObject.getCipher(), null);
                    }
                }
                if (wrappedCallback != null) {
                    wrappedCallback.onAuthenticationSucceeded(result);
                }
                if (listener != null) {
                    listener.onSuccess();
                }
            } catch (GeneralSecurityException | IOException e) {
                if (wrappedCallback != null) {
                    e.printStackTrace();
                    wrappedCallback.onAuthenticationError(-1, e.getMessage());
                }
                if (listener != null) {
                    listener.onError(e);
                }
            }
        }

        @Override
        public void onAuthenticationFailed() {
            if (wrappedCallback != null) {
                wrappedCallback.onAuthenticationFailed();
            }
            if (listener != null) {
                listener.onError(new FingerprintException(Type.Failure));
            }
        }
    }

    class FingerprintParams extends UnlockParams {
        private final Context context;
        private final Listener listener;
        private final CancellationSignal cancellationSignal;
        private final FingerprintManagerCompat.AuthenticationCallback authenticationCallback;
        private final Handler handler;

        public FingerprintParams(Context context, Listener listener, CancellationSignal cancellationSignal, FingerprintManagerCompat.AuthenticationCallback authenticationCallback, Handler handler) {
            this.context = context;
            this.listener = listener;
            this.cancellationSignal = cancellationSignal;
            this.authenticationCallback = authenticationCallback;
            this.handler = handler;
        }

        public Context getContext() {
            return context;
        }

        @Nullable
        public CancellationSignal getCancellationSignal() {
            return cancellationSignal;
        }

        @NonNull
        public FingerprintManagerCompat.AuthenticationCallback getAuthenticationCallback() {
            return authenticationCallback;
        }

        @Nullable
        public Handler getHandler() {
            return handler;
        }

        public Listener getListener() {
            return listener;
        }
    }

    public enum Type {
        Error,
        Help,
        Failure,
        NoHardware,
        NoFingerprint,
        NoLockscreen
    }

    public class FingerprintException extends GeneralSecurityException {
        private final int messageId;
        private final Type type;

        public FingerprintException(Type type) {
            super("Can't use fingerprint");
            this.type = type;
            this.messageId = -1;
        }

        public FingerprintException(Type type, int messageId, CharSequence message) {
            super(message.toString());
            this.type = type;
            this.messageId = messageId;
        }

        public int getMessageId() {
            return messageId;
        }

        public Type getType() {
            return type;
        }
    }
}


text:
package org.openintents.openpgp.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.concurrent.atomic.AtomicInteger;

import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
import android.os.ParcelFileDescriptor;

import org.openintents.openpgp.IOpenPgpService2;
import org.openintents.openpgp.OpenPgpError;
import org.openintents.openpgp.util.ParcelFileDescriptorUtil.DataSinkTransferThread;
import org.openintents.openpgp.util.ParcelFileDescriptorUtil.DataSourceTransferThread;
import timber.log.Timber;

public class OpenPgpApi {

    public static final String SERVICE_INTENT_2 = "org.openintents.openpgp.IOpenPgpService2";

    /**
     * see CHANGELOG.md
     */
    public static final int API_VERSION = 12;

    /**
     * General extras
     * --------------
     *
     * required extras:
     * int           EXTRA_API_VERSION           (always required)
     *
     * returned extras:
     * int           RESULT_CODE                 (RESULT_CODE_ERROR, RESULT_CODE_SUCCESS or RESULT_CODE_USER_INTERACTION_REQUIRED)
     * OpenPgpError  RESULT_ERROR                (if RESULT_CODE == RESULT_CODE_ERROR)
     * PendingIntent RESULT_INTENT               (if RESULT_CODE == RESULT_CODE_USER_INTERACTION_REQUIRED)
     */

    /**
     * This action performs no operation, but can be used to check if the App has permission
     * to access the API in general, returning a user interaction PendingIntent otherwise.
     * This can be used to trigger the permission dialog explicitly.
     *
     * This action uses no extras.
     */
    public static final String ACTION_CHECK_PERMISSION = "org.openintents.openpgp.action.CHECK_PERMISSION";

    @Deprecated
    public static final String ACTION_SIGN = "org.openintents.openpgp.action.SIGN";

    /**
     * Sign text resulting in a cleartext signature
     * Some magic pre-processing of the text is done to convert it to a format usable for
     * cleartext signatures per RFC 4880 before the text is actually signed:
     * - end cleartext with newline
     * - remove whitespaces on line endings
     *
     * required extras:
     * long          EXTRA_SIGN_KEY_ID           (key id of signing key)
     *
     * optional extras:
     * char[]        EXTRA_PASSPHRASE            (key passphrase)
     */
    public static final String ACTION_CLEARTEXT_SIGN = "org.openintents.openpgp.action.CLEARTEXT_SIGN";

    /**
     * Sign text or binary data resulting in a detached signature.
     * No OutputStream necessary for ACTION_DETACHED_SIGN (No magic pre-processing like in ACTION_CLEARTEXT_SIGN)!
     * The detached signature is returned separately in RESULT_DETACHED_SIGNATURE.
     *
     * required extras:
     * long          EXTRA_SIGN_KEY_ID           (key id of signing key)
     *
     * optional extras:
     * boolean       EXTRA_REQUEST_ASCII_ARMOR   (request ascii armor for detached signature)
     * char[]        EXTRA_PASSPHRASE            (key passphrase)
     *
     * returned extras:
     * byte[]        RESULT_DETACHED_SIGNATURE
     * String        RESULT_SIGNATURE_MICALG     (contains the name of the used signature algorithm as a string)
     */
    public static final String ACTION_DETACHED_SIGN = "org.openintents.openpgp.action.DETACHED_SIGN";

    /**
     * Encrypt
     *
     * required extras:
     * String[]      EXTRA_USER_IDS              (=emails of recipients, if more than one key has a user_id, a PendingIntent is returned via RESULT_INTENT)
     * or
     * long[]        EXTRA_KEY_IDS
     *
     * optional extras:
     * boolean       EXTRA_REQUEST_ASCII_ARMOR   (request ascii armor for output)
     * char[]        EXTRA_PASSPHRASE            (key passphrase)
     * String        EXTRA_ORIGINAL_FILENAME     (original filename to be encrypted as metadata)
     * boolean       EXTRA_ENABLE_COMPRESSION    (enable ZLIB compression, default ist true)
     */
    public static final String ACTION_ENCRYPT = "org.openintents.openpgp.action.ENCRYPT";

    /**
     * Sign and encrypt
     *
     * required extras:
     * String[]      EXTRA_USER_IDS              (=emails of recipients, if more than one key has a user_id, a PendingIntent is returned via RESULT_INTENT)
     * or
     * long[]        EXTRA_KEY_IDS
     *
     * optional extras:
     * long          EXTRA_SIGN_KEY_ID           (key id of signing key)
     * boolean       EXTRA_REQUEST_ASCII_ARMOR   (request ascii armor for output)
     * char[]        EXTRA_PASSPHRASE            (key passphrase)
     * String        EXTRA_ORIGINAL_FILENAME     (original filename to be encrypted as metadata)
     * boolean       EXTRA_ENABLE_COMPRESSION    (enable ZLIB compression, default ist true)
     */
    public static final String ACTION_SIGN_AND_ENCRYPT = "org.openintents.openpgp.action.SIGN_AND_ENCRYPT";

    public static final String ACTION_QUERY_AUTOCRYPT_STATUS = "org.openintents.openpgp.action.QUERY_AUTOCRYPT_STATUS";

    /**
     * Decrypts and verifies given input stream. This methods handles encrypted-only, signed-and-encrypted,
     * and also signed-only input.
     * OutputStream is optional, e.g., for verifying detached signatures!
     *
     * If OpenPgpSignatureResult.getResult() == OpenPgpSignatureResult.RESULT_KEY_MISSING
     * in addition a PendingIntent is returned via RESULT_INTENT to download missing keys.
     * On all other status, in addition a PendingIntent is returned via RESULT_INTENT to open
     * the key view in OpenKeychain.
     *
     * optional extras:
     * byte[]        EXTRA_DETACHED_SIGNATURE    (detached signature)
     *
     * returned extras:
     * OpenPgpSignatureResult   RESULT_SIGNATURE
     * OpenPgpDecryptionResult  RESULT_DECRYPTION
     * OpenPgpDecryptMetadata   RESULT_METADATA
     * String                   RESULT_CHARSET   (charset which was specified in the headers of ascii armored input, if any)
     */
    public static final String ACTION_DECRYPT_VERIFY = "org.openintents.openpgp.action.DECRYPT_VERIFY";

    /**
     * Decrypts the header of an encrypted file to retrieve metadata such as original filename.
     *
     * This does not decrypt the actual content of the file.
     *
     * returned extras:
     * OpenPgpDecryptMetadata   RESULT_METADATA
     * String                   RESULT_CHARSET   (charset which was specified in the headers of ascii armored input, if any)
     */
    public static final String ACTION_DECRYPT_METADATA = "org.openintents.openpgp.action.DECRYPT_METADATA";

    /**
     * Select key id for signing
     *
     * optional extras:
     * String      EXTRA_USER_ID
     *
     * returned extras:
     * long        EXTRA_SIGN_KEY_ID
     */
    public static final String ACTION_GET_SIGN_KEY_ID = "org.openintents.openpgp.action.GET_SIGN_KEY_ID";

    /**
     * Get key ids based on given user ids (=emails)
     *
     * required extras:
     * String[]      EXTRA_USER_IDS
     *
     * returned extras:
     * long[]        RESULT_KEY_IDS
     */
    public static final String ACTION_GET_KEY_IDS = "org.openintents.openpgp.action.GET_KEY_IDS";

    /**
     * This action returns RESULT_CODE_SUCCESS if the OpenPGP Provider already has the key
     * corresponding to the given key id in its database.
     *
     * It returns RESULT_CODE_USER_INTERACTION_REQUIRED if the Provider does not have the key.
     * The PendingIntent from RESULT_INTENT can be used to retrieve those from a keyserver.
     *
     * If an Output stream has been defined the whole public key is returned.
     * required extras:
     * long        EXTRA_KEY_ID
     *
     * optional extras:
     * String      EXTRA_REQUEST_ASCII_ARMOR (request that the returned key is encoded in ASCII Armor)
     */
    public static final String ACTION_GET_KEY = "org.openintents.openpgp.action.GET_KEY";

    /**
     * Backup all keys given by EXTRA_KEY_IDS and if requested their secret parts.
     * The encrypted backup will be written to the OutputStream.
     * The client app has no access to the backup code used to encrypt the backup!
     * This operation always requires user interaction with RESULT_CODE_USER_INTERACTION_REQUIRED!
     *
     * required extras:
     * long[]      EXTRA_KEY_IDS       (keys that should be included in the backup)
     * boolean     EXTRA_BACKUP_SECRET (also backup secret keys)
     */
    public static final String ACTION_BACKUP = "org.openintents.openpgp.action.BACKUP";

    /**
     * Update the status of some Autocrypt peer, identified by their peer id.
     *
     * required extras:
     * String                  EXTRA_AUTOCRYPT_PEER_ID       (autocrypt peer id to update)
     * AutocryptPeerUpdate     EXTRA_AUTOCRYPT_PEER_UPDATE   (actual peer update)
     */
    public static final String ACTION_UPDATE_AUTOCRYPT_PEER = "org.openintents.openpgp.action.UPDATE_AUTOCRYPT_PEER";

    /* Intent extras */
    public static final String EXTRA_API_VERSION = "api_version";

    // ACTION_DETACHED_SIGN, ENCRYPT, SIGN_AND_ENCRYPT, DECRYPT_VERIFY
    // request ASCII Armor for output
    // OpenPGP Radix-64, 33 percent overhead compared to binary, see http://tools.ietf.org/html/rfc4880#page-53)
    public static final String EXTRA_REQUEST_ASCII_ARMOR = "ascii_armor";

    // ACTION_DETACHED_SIGN
    public static final String RESULT_DETACHED_SIGNATURE = "detached_signature";
    public static final String RESULT_SIGNATURE_MICALG = "signature_micalg";

    // ENCRYPT, SIGN_AND_ENCRYPT, QUERY_AUTOCRYPT_STATUS
    public static final String EXTRA_USER_IDS = "user_ids";
    public static final String EXTRA_KEY_IDS = "key_ids";
    public static final String EXTRA_KEY_IDS_SELECTED = "key_ids_selected";
    public static final String EXTRA_SIGN_KEY_ID = "sign_key_id";

    public static final String RESULT_KEYS_CONFIRMED = "keys_confirmed";
    public static final String RESULT_AUTOCRYPT_STATUS = "autocrypt_status";
    public static final int AUTOCRYPT_STATUS_UNAVAILABLE = 0;
    public static final int AUTOCRYPT_STATUS_DISCOURAGE = 1;
    public static final int AUTOCRYPT_STATUS_AVAILABLE = 2;
    public static final int AUTOCRYPT_STATUS_MUTUAL = 3;

    // optional extras:
    public static final String EXTRA_PASSPHRASE = "passphrase";
    public static final String EXTRA_ORIGINAL_FILENAME = "original_filename";
    public static final String EXTRA_ENABLE_COMPRESSION = "enable_compression";
    public static final String EXTRA_OPPORTUNISTIC_ENCRYPTION = "opportunistic";

    // GET_SIGN_KEY_ID
    public static final String EXTRA_USER_ID = "user_id";
    public static final String EXTRA_PRESELECT_KEY_ID = "preselect_key_id";
    public static final String EXTRA_SHOW_AUTOCRYPT_HINT = "show_autocrypt_hint";

    // GET_KEY
    public static final String EXTRA_KEY_ID = "key_id";
    public static final String EXTRA_MINIMIZE = "minimize";
    public static final String EXTRA_MINIMIZE_USER_ID = "minimize_user_id";
    public static final String RESULT_KEY_IDS = "key_ids";

    // AUTOCRYPT_KEY_TRANSFER
    public static final String ACTION_AUTOCRYPT_KEY_TRANSFER = "autocrypt_key_transfer";

    // BACKUP
    public static final String EXTRA_BACKUP_SECRET = "backup_secret";

    /* Service Intent returns */
    public static final String RESULT_CODE = "result_code";

    // get actual error object from RESULT_ERROR
    public static final int RESULT_CODE_ERROR = 0;
    // success!
    public static final int RESULT_CODE_SUCCESS = 1;
    // get PendingIntent from RESULT_INTENT, start PendingIntent with startIntentSenderForResult,
    // and execute service method again in onActivityResult
    public static final int RESULT_CODE_USER_INTERACTION_REQUIRED = 2;

    public static final String RESULT_ERROR = "error";
    public static final String RESULT_INTENT = "intent";

    // DECRYPT_VERIFY
    public static final String EXTRA_DETACHED_SIGNATURE = "detached_signature";
    public static final String EXTRA_PROGRESS_MESSENGER = "progress_messenger";
    public static final String EXTRA_DATA_LENGTH = "data_length";
    public static final String EXTRA_DECRYPTION_RESULT = "decryption_result";
    public static final String EXTRA_SENDER_ADDRESS = "sender_address";
    public static final String EXTRA_SUPPORT_OVERRIDE_CRYPTO_WARNING = "support_override_crpto_warning";
    public static final String RESULT_SIGNATURE = "signature";
    public static final String RESULT_DECRYPTION = "decryption";
    public static final String RESULT_METADATA = "metadata";
    public static final String RESULT_INSECURE_DETAIL_INTENT = "insecure_detail_intent";
    public static final String RESULT_OVERRIDE_CRYPTO_WARNING = "override_crypto_warning";
    // This will be the charset which was specified in the headers of ascii armored input, if any
    public static final String RESULT_CHARSET = "charset";

    // UPDATE_AUTOCRYPT_PEER
    public static final String EXTRA_AUTOCRYPT_PEER_ID = "autocrypt_peer_id";
    public static final String EXTRA_AUTOCRYPT_PEER_UPDATE = "autocrypt_peer_update";
    public static final String EXTRA_AUTOCRYPT_PEER_GOSSIP_UPDATES = "autocrypt_peer_gossip_updates";

    // INTERNAL, must not be used
    public static final String EXTRA_CALL_UUID1 = "call_uuid1";
    public static final String EXTRA_CALL_UUID2 = "call_uuid2";

    IOpenPgpService2 mService;
    Context mContext;
    final AtomicInteger mPipeIdGen = new AtomicInteger();

    public OpenPgpApi(Context context, IOpenPgpService2 service) {
        this.mContext = context;
        this.mService = service;
    }

    public interface IOpenPgpCallback {
        void onReturn(final Intent result);
    }

    public interface IOpenPgpSinkResultCallback<T> {
        void onProgress(int current, int max);
        void onReturn(final Intent result, T sinkResult);
    }

    public interface CancelableBackgroundOperation {
        void cancelOperation();
    }

    private class OpenPgpSourceSinkAsyncTask<T> extends AsyncTask<Void, Integer, OpenPgpDataResult<T>>
            implements CancelableBackgroundOperation {
        Intent data;
        OpenPgpDataSource dataSource;
        OpenPgpDataSink<T> dataSink;
        IOpenPgpSinkResultCallback<T> callback;

        private OpenPgpSourceSinkAsyncTask(Intent data, OpenPgpDataSource dataSource,
                OpenPgpDataSink<T> dataSink, IOpenPgpSinkResultCallback<T> callback) {
            this.data = data;
            this.dataSource = dataSource;
            this.dataSink = dataSink;
            this.callback = callback;
        }

        @Override
        protected OpenPgpDataResult<T> doInBackground(Void... unused) {
            return executeApi(data, dataSource, dataSink);
        }

        protected void onPostExecute(OpenPgpDataResult<T> result) {
            callback.onReturn(result.apiResult, result.sinkResult);
        }

        @Override
        public void cancelOperation() {
            cancel(true);
            if (dataSource != null) {
                dataSource.cancel();
            }
        }
    }

    class OpenPgpAsyncTask extends AsyncTask<Void, Integer, Intent> {
        Intent data;
        InputStream is;
        OutputStream os;
        IOpenPgpCallback callback;

        private OpenPgpAsyncTask(Intent data, InputStream is, OutputStream os, IOpenPgpCallback callback) {
            this.data = data;
            this.is = is;
            this.os = os;
            this.callback = callback;
        }

        @Override
        protected Intent doInBackground(Void... unused) {
            return executeApi(data, is, os);
        }

        protected void onPostExecute(Intent result) {
            callback.onReturn(result);
        }
    }

    public <T> CancelableBackgroundOperation executeApiAsync(Intent data, OpenPgpDataSource dataSource,
            OpenPgpDataSink<T> dataSink, final IOpenPgpSinkResultCallback<T> callback) {
        Messenger messenger = new Messenger(new Handler(new Handler.Callback() {
            @Override
            public boolean handleMessage(Message message) {
                callback.onProgress(message.arg1, message.arg2);
                return true;
            }
        }));
        data.putExtra(EXTRA_PROGRESS_MESSENGER, messenger);

        OpenPgpSourceSinkAsyncTask<T> task = new OpenPgpSourceSinkAsyncTask<>(data, dataSource, dataSink, callback);

        // don't serialize async tasks!
        // http://commonsware.com/blog/2012/04/20/asynctask-threading-regression-confirmed.html
        task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void[]) null);

        return task;
    }

    public AsyncTask executeApiAsync(Intent data, OpenPgpDataSource dataSource, IOpenPgpSinkResultCallback<Void> callback) {
        OpenPgpSourceSinkAsyncTask<Void> task = new OpenPgpSourceSinkAsyncTask<>(data, dataSource, null, callback);

        // don't serialize async tasks!
        // http://commonsware.com/blog/2012/04/20/asynctask-threading-regression-confirmed.html
        task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void[]) null);

        return task;
    }

    public void executeApiAsync(Intent data, InputStream is, OutputStream os, IOpenPgpCallback callback) {
        OpenPgpAsyncTask task = new OpenPgpAsyncTask(data, is, os, callback);

        // don't serialize async tasks!
        // http://commonsware.com/blog/2012/04/20/asynctask-threading-regression-confirmed.html
        task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void[]) null);
    }

    public static class OpenPgpDataResult<T> {
        Intent apiResult;
        T sinkResult;

        public OpenPgpDataResult(Intent apiResult, T sinkResult) {
            this.apiResult = apiResult;
            this.sinkResult = sinkResult;
        }
    }

    public <T> OpenPgpDataResult<T> executeApi(Intent data, OpenPgpDataSource dataSource, OpenPgpDataSink<T> dataSink) {
        ParcelFileDescriptor input = null;
        ParcelFileDescriptor output = null;
        try {
            if (dataSource != null) {
                Long expectedSize = dataSource.getSizeForProgress();
                if (expectedSize != null) {
                    data.putExtra(EXTRA_DATA_LENGTH, (long) expectedSize);
                } else {
                    data.removeExtra(EXTRA_PROGRESS_MESSENGER);
                }
                input = dataSource.startPumpThread();
            }

            DataSinkTransferThread<T> pumpThread = null;
            int outputPipeId = 0;

            if (dataSink != null) {
                outputPipeId = mPipeIdGen.incrementAndGet();
                output = mService.createOutputPipe(outputPipeId);
                pumpThread = ParcelFileDescriptorUtil.asyncPipeToDataSink(dataSink, output);
            }

            Intent result = executeApi(data, input, outputPipeId);

            if (pumpThread == null) {
                return new OpenPgpDataResult<>(result, null);
            }

            // wait for ALL data being pumped from remote side
            pumpThread.join();
            return new OpenPgpDataResult<>(result, pumpThread.getResult());
        } catch (Exception e) {
            Timber.e(e, "Exception in executeApi call");
            Intent result = new Intent();
            result.putExtra(RESULT_CODE, RESULT_CODE_ERROR);
            result.putExtra(RESULT_ERROR,
                    new OpenPgpError(OpenPgpError.CLIENT_SIDE_ERROR, e.getMessage()));
            return new OpenPgpDataResult<>(result, null);
        } finally {
            closeLoudly(output);
        }
    }

    public Intent executeApi(Intent data, InputStream is, OutputStream os) {
        ParcelFileDescriptor input = null;
        ParcelFileDescriptor output = null;
        try {
            if (is != null) {
                input = ParcelFileDescriptorUtil.pipeFrom(is);
            }

            Thread pumpThread = null;
            int outputPipeId = 0;

            if (os != null) {
                outputPipeId = mPipeIdGen.incrementAndGet();
                output = mService.createOutputPipe(outputPipeId);
                pumpThread = ParcelFileDescriptorUtil.pipeTo(os, output);
            }

            Intent result = executeApi(data, input, outputPipeId);

            // wait for ALL data being pumped from remote side
            if (pumpThread != null) {
                pumpThread.join();
            }

            return result;
        } catch (Exception e) {
            Timber.e(e, "Exception in executeApi call");
            Intent result = new Intent();
            result.putExtra(RESULT_CODE, RESULT_CODE_ERROR);
            result.putExtra(RESULT_ERROR,
                    new OpenPgpError(OpenPgpError.CLIENT_SIDE_ERROR, e.getMessage()));
            return result;
        } finally {
            closeLoudly(output);
        }
    }

    public static abstract class OpenPgpDataSource {
        private boolean isCancelled;
        private ParcelFileDescriptor writeSidePfd;

        public abstract void writeTo(OutputStream os) throws IOException;

        public Long getSizeForProgress() {
            return null;
        }

        public boolean isCancelled() {
            return isCancelled;
        }

        public ParcelFileDescriptor startPumpThread() throws IOException {
            if (writeSidePfd != null) {
                throw new IllegalStateException("startPumpThread() must only be called once!");
            }
            ParcelFileDescriptor[] pipe = ParcelFileDescriptor.createPipe();
            ParcelFileDescriptor readSidePfd = pipe[0];
            writeSidePfd = pipe[1];

            new DataSourceTransferThread(this, new ParcelFileDescriptor.AutoCloseOutputStream(writeSidePfd)).start();

            return readSidePfd;
        }

        private void cancel() {
            isCancelled = true;
            try {
                writeSidePfd.close();
            } catch (IOException e) {
                // this is fine
            }
        }
    }

    public interface OpenPgpDataSink<T> {
        T processData(InputStream is) throws IOException;
    }

    public Intent executeApi(Intent data, OpenPgpDataSource dataSource, OutputStream os) {
        ParcelFileDescriptor input = null;
        ParcelFileDescriptor output;
        try {
            if (dataSource != null) {
                Long expectedSize = dataSource.getSizeForProgress();
                if (expectedSize != null) {
                    data.putExtra(EXTRA_DATA_LENGTH, (long) expectedSize);
                } else {
                    data.removeExtra(EXTRA_PROGRESS_MESSENGER);
                }
                input = dataSource.startPumpThread();
            }

            Thread pumpThread = null;
            int outputPipeId = 0;

            if (os != null) {
                outputPipeId = mPipeIdGen.incrementAndGet();
                output = mService.createOutputPipe(outputPipeId);
                pumpThread = ParcelFileDescriptorUtil.pipeTo(os, output);
            }

            Intent result = executeApi(data, input, outputPipeId);

            // wait for ALL data being pumped from remote side
            if (pumpThread != null) {
                pumpThread.join();
            }

            return result;
        } catch (Exception e) {
            Timber.e(e, "Exception in executeApi call");
            Intent result = new Intent();
            result.putExtra(RESULT_CODE, RESULT_CODE_ERROR);
            result.putExtra(RESULT_ERROR,
                    new OpenPgpError(OpenPgpError.CLIENT_SIDE_ERROR, e.getMessage()));
            return result;
        }
    }

    /**
     * InputStream and OutputStreams are always closed after operating on them!
     */
    private Intent executeApi(Intent data, ParcelFileDescriptor input, int outputPipeId) {
        try {
            // always send version from client
            data.putExtra(EXTRA_API_VERSION, OpenPgpApi.API_VERSION);

            Intent result;

            // blocks until result is ready
            result = mService.execute(data, input, outputPipeId);

            // set class loader to current context to allow unparcelling
            // of OpenPgpError and OpenPgpSignatureResult
            // http://stackoverflow.com/a/3806769
            result.setExtrasClassLoader(mContext.getClassLoader());

            return result;
        } catch (Exception e) {
            Timber.e(e, "Exception in executeApi call");
            Intent result = new Intent();
            result.putExtra(RESULT_CODE, RESULT_CODE_ERROR);
            result.putExtra(RESULT_ERROR,
                    new OpenPgpError(OpenPgpError.CLIENT_SIDE_ERROR, e.getMessage()));
            return result;
        } finally {
            // close() is required to halt the TransferThread
            closeLoudly(input);
        }
    }

    private static void closeLoudly(ParcelFileDescriptor input) {
        if (input != null) {
            try {
                input.close();
            } catch (IOException e) {
                Timber.e(e, "IOException when closing ParcelFileDescriptor!");
            }
        }
    }

    public interface PermissionPingCallback {
        void onPgpPermissionCheckResult(Intent result);
    }

    public void checkPermissionPing(final PermissionPingCallback permissionPingCallback) {
        Intent intent = new Intent(OpenPgpApi.ACTION_CHECK_PERMISSION);
        executeApiAsync(intent, null, null, new IOpenPgpCallback() {
            @Override
            public void onReturn(Intent result) {
                permissionPingCallback.onPgpPermissionCheckResult(result);
            }
        });
    }
}

redpajama_set_name: RedPajamaGithub


text:
.class final Landroid/app/SystemServiceRegistry$70;
.super Landroid/app/SystemServiceRegistry$CachedServiceFetcher;
.source "SystemServiceRegistry.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/app/SystemServiceRegistry;
.end annotation

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

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/app/SystemServiceRegistry$CachedServiceFetcher",
        "<",
        "Landroid/hardware/ConsumerIrManager;",
        ">;"
    }
.end annotation

# direct methods
.method constructor <init>()V
    .locals 0

    invoke-direct {p0}, Landroid/app/SystemServiceRegistry$CachedServiceFetcher;-><init>()V

    return-void
.end method

# virtual methods
.method public createService(Landroid/app/ContextImpl;)Landroid/hardware/ConsumerIrManager;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/ServiceManager$ServiceNotFoundException;
        }
    .end annotation

    new-instance v0, Landroid/hardware/ConsumerIrManager;

    invoke-direct {v0, p1}, Landroid/hardware/ConsumerIrManager;-><init>(Landroid/content/Context;)V

    return-object v0
.end method

.method public bridge synthetic createService(Landroid/app/ContextImpl;)Ljava/lang/Object;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/ServiceManager$ServiceNotFoundException;
        }
    .end annotation

    invoke-virtual {p0, p1}, Landroid/app/SystemServiceRegistry$70;->createService(Landroid/app/ContextImpl;)Landroid/hardware/ConsumerIrManager;

    move-result-object v0

    return-object v0
.end method


text:
CREATE OR REPLACE FUNCTION create_schema_if_not_exist(schemaname varchar) RETURNS void AS $$
BEGIN
    -- We can't use IF NOT EXISTS until PostgreSQL 9.3.
    BEGIN
        EXECUTE 'CREATE SCHEMA '|| quote_ident(schemaname) ||';';
    EXCEPTION
      WHEN OTHERS THEN
        RAISE NOTICE 'Schema exists.';
    END;
END;
$$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION set_schema(tablename varchar, schemaname varchar) RETURNS void AS $$
BEGIN
    -- Move only if the right schema is not already set.
    IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name=tablename AND table_schema!=schemaname) THEN
        EXECUTE 'ALTER TABLE '|| quote_ident(tablename) ||' SET SCHEMA '|| quote_ident(schemaname) ||';';
    END IF;
END;
$$ LANGUAGE plpgsql;

-------------------------------------------------------------------------------
-- Date trigger functions
-------------------------------------------------------------------------------

SELECT create_schema_if_not_exist('geotrek');

CREATE OR REPLACE FUNCTION geotrek.ft_date_insert() RETURNS trigger AS $$
BEGIN
    NEW.date_insert := statement_timestamp();
    RETURN NEW;
END;
$$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION geotrek.ft_date_update() RETURNS trigger AS $$
BEGIN
    NEW.date_update := statement_timestamp();
    RETURN NEW;
END;
$$ LANGUAGE plpgsql;


text:
using System.Diagnostics.CodeAnalysis;

namespace OpenCvSharp;
#pragma warning disable CA1051

/// <summary>
/// Struct for matching: query descriptor index, train descriptor index, train image index and distance between descriptors.
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1815: Override equals and operator equals on value types")]
public struct DMatch
{
    /// <summary>
    /// query descriptor index
    /// </summary>
    public int QueryIdx;

    /// <summary>
    /// train descriptor index
    /// </summary>
    public int TrainIdx;

    /// <summary>
    /// train image index
    /// </summary>
    public int ImgIdx;

    /// <summary>
    ///
    /// </summary>
    public float Distance;

    /// <summary>
    ///
    /// </summary>
    /// <returns></returns>
    public static DMatch Empty()
    {
        return new (-1, -1, -1, float.MaxValue);
    }

    /// <summary>
    /// Constructor
    /// </summary>
    /// <param name="queryIdx"></param>
    /// <param name="trainIdx"></param>
    /// <param name="distance"></param>
    public DMatch(int queryIdx, int trainIdx, float distance) :
        this(queryIdx, trainIdx, -1, distance)
    {
    }

    /// <summary>
    /// Constructor
    /// </summary>
    /// <param name="queryIdx"></param>
    /// <param name="trainIdx"></param>
    /// <param name="imgIdx"></param>
    /// <param name="distance"></param>
    public DMatch(int queryIdx, int trainIdx, int imgIdx, float distance)
    {
        QueryIdx = queryIdx;
        TrainIdx = trainIdx;
        ImgIdx = imgIdx;
        Distance = distance;
    }

    /// <summary>
    /// Compares by distance (less is better)
    /// </summary>
    /// <param name="d1"></param>
    /// <param name="d2"></param>
    /// <returns></returns>
    public static bool operator <(DMatch d1, DMatch d2)
    {
        return d1.Distance < d2.Distance;
    }

    /// <summary>
    /// Compares by distance (less is better)
    /// </summary>
    /// <param name="d1"></param>
    /// <param name="d2"></param>
    /// <returns></returns>
    public static bool operator >(DMatch d1, DMatch d2)
    {
        return d1.Distance > d2.Distance;
    }

    /// <summary>
    /// Compares by distance (less is better)
    /// </summary>
    /// <param name="other"></param>
    /// <returns></returns>
    public int CompareTo(DMatch other) => Distance.CompareTo(other.Distance);

#pragma warning disable 1591

    public static explicit operator Vec4f(DMatch self) => self.ToVec4f();

    // ReSharper disable once InconsistentNaming
    public Vec4f ToVec4f() => new(QueryIdx, TrainIdx, ImgIdx, Distance);

    public static explicit operator DMatch(Vec4f v) => FromVec4f(v);

    // ReSharper disable once InconsistentNaming
    public static DMatch FromVec4f(Vec4f v) => new ((int)v.Item0, (int)v.Item1, (int)v.Item2, v.Item3);

#pragma warning restore 1591

    /// <inheritdoc />
    public override readonly string ToString()
    {
        // ReSharper disable once UseStringInterpolation
        return $"DMatch (QueryIdx:{QueryIdx}, TrainIdx:{TrainIdx}, ImgIdx:{ImgIdx}, Distance:{Distance})";
    }
}


text:
<?php
	require_once('config.php');
	//Start session
	session_start();

	//Unset the variables stored in session
	unset($_SESSION['SESS_MEMBER_ID']);
	unset($_SESSION['SESS_FIRST_NAME']);
	unset($_SESSION['SESS_LAST_NAME']);
	session_write_close();
	header("location: http://www.cstprogram.ca/sliver/index");
	exit();
?>


text:
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.idea.maven.indices;

import com.intellij.openapi.Disposable;
import com.intellij.openapi.project.Project;
import com.intellij.util.Consumer;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.maven.utils.MavenSimpleProjectComponent;
import org.jetbrains.idea.reposearch.DependencySearchService;

import java.util.List;
import java.util.Set;

/**
 * @deprecated use {@link #org.jetbrains.idea.maven.indices.MavenIndicesManager}
 */
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2022.1")
public final class MavenProjectIndicesManager extends MavenSimpleProjectComponent implements Disposable {

  public static MavenProjectIndicesManager getInstance(Project p) {
    return p.getService(MavenProjectIndicesManager.class);
  }

  @Override
  public void dispose() {
  }

  public MavenProjectIndicesManager(Project project) {
    super(project);
  }

  /**
   * @deprecated use {@link MavenIndicesManager#scheduleUpdateIndicesList(com.intellij.util.Consumer)}
   */
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2022.1")
  public void scheduleUpdateIndicesList(@Nullable Consumer<? super List<MavenIndex>> consumer) {
    MavenIndicesManager.getInstance(myProject).scheduleUpdateIndicesList(consumer);
  }

  /**
   * @deprecated use {@link #org.jetbrains.idea.maven.indices.MavenIndicesManager#getIndex()}
   */
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2022.1")
  public List<MavenIndex> getIndices() {
    return MavenIndicesManager.getInstance(myProject).getIndex().getIndices();
  }

  /**
   * @deprecated use {@link #org.jetbrains.idea.maven.indices.MavenIndicesManager#scheduleUpdate(List)}
   */
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2022.1")
  public void scheduleUpdate(List<MavenIndex> indices) {
    MavenIndicesManager.getInstance(myProject).scheduleUpdateContent(indices);
  }

  /**
   * @deprecated use {@link DependencySearchService}
   * or use {@link MavenGroupIdCompletionContributor} for example to fill async completion variants.
   **/
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2022.1")
  public Set<String> getGroupIds() {
    return getGroupIds("");
  }

  /**
   * @deprecated use {@link DependencySearchService}
   * or use {@link MavenGroupIdCompletionContributor} for example to fill async completion variants.
   **/
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2022.1")
  public Set<String> getGroupIds(String pattern) {
    return DependencySearchService.getInstance(myProject).getGroupIds(pattern);
  }

  /**
   * @deprecated use {@link DependencySearchService}
   * or use {@link MavenArtifactIdCompletionContributor} for example to fill async completion variants.
   **/
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2022.1")
  public Set<String> getArtifactIds(String groupId) {
    return DependencySearchService.getInstance(myProject).getArtifactIds(groupId);
  }
}


text:
<title>dlib C++ Library - dir_nav.h</title>

// Copyright (C) 2003  Davis E. King (davis@dlib.net)
// License: Boost Software License   See LICENSE.txt for the full license.
#ifndef DLIB_DIR_NAv_
#define DLIB_DIR_NAv_

#include "platform.h"

#ifdef WIN32
#include "dir_nav/windows.h"
#endif

#ifndef WIN32
#include "dir_nav/posix.h"
#endif

#include "dir_nav/dir_nav_extensions.h"

#endif // DLIB_DIR_NAv_


text:
This page documents the Fronstage ui endpoints that can be hit.

## Info Endpoints

`/info`
* GET request to this endpoint displays the info of the frontstage ui.

## Privacy Endpoints

`/privacy-and-data-protection`
* GET request to this endpoint displays the privacy-and-data-protection of the frontstage ui.

## Security Endpoints

`/.well-known`
* GET Request to this endpoint displays security page of the frontstage ui.

## Contact us Endpoints

`/help`
* GET and POST Request to this endpoint allows you to access the hep page.
* GET `/vulnerability-reporting`
* GET and POST `/info-ons`
* GET and POST `/help-with-my-password`
* GET `/something-else`

`/contact-us`
* GET Request to this endpoint allows you to access the contact page.

## Surveys help Endpoints

`/surveys-help`
* GET Survey Help page provided survey_ref and ru_ref and creates flash session for selection

`/help`
* GET Survey Help page provided survey_ref and ru_ref are in session
* POST Help to complete this survey option for respective survey

`/help/<option>`
* GET For help completing this survey's additional options (sub options)
* POST Provides additional options once sub options are selected
* `options`

`/help/<option>/<sub_option>`
* GET Provides additional options with sub option provided
* `sub_options`

`/help/<option>/<sub_option>/send-message`
* GET Send message page once the option and sub option is selected
* POST Sends secure message for the help pages
* `options`
* `sub_option`

## Sign-in Endpoints

`/`
* GET and POST
* redirects to /sign-in

`/sign-in`
* Login page

`/resend-verification/<party_id>`
* GET Deprecated: to be removed when not in use
* `party_id`

`/resend-verification-expired-token/<token>`
* GET
* `token`

`/logout`
* logs the user out

## Register Endpoints

`/create-account`
* GET and POST

`/create-account/enter-account-details`
* GET and POST

`/pending-surveys/create-account/enter-account-details`
* GET and POST Registration endpoint for account creation and verification against share surveys  and transfer surveys (Account does not exist)

`/create-account/check-email`

`/activate-account/<token>`
* GET
* `token`

`/create-account/confirm-organisation-survey`
* GET

## Passwords Endpoints

`/forgot-password`
* GET and POST

`/forgot-password/check-email`
* GET

`/reset-password/<token>`
* GET and POST
* `token`

`/reset-password/confirmation`
* GET

`/reset-password/check-email`
* GET

`/resend-password-email-expired-token/<token>`
* GET
* `token`

## Account Endpoints
* requires login

`/account`
* GET and POST
* GET and POST `/change-password`
* POST `/change-account-email-address`
* GET and POST `/change-account-details`
* GET `/something-else` Gets the something else once the option is selected
* POST `/something-else` Sends secure message for the something else pages

`/delete`
* GET and POST

`/confirm-account-email-change/<token>`
* GET
* `token`

`/resend-account-email-change-expired-token/<token>`
* GET
* `token`

`/share-surveys`
* GET

`/share-surveys/business-selection`
* GET and POST

`/share-surveys/survey-selection`
* GET and POST

`/share-surveys/recipient-email-address`
* GET and POST

`/share-surveys/send-instruction`
* GET and POST

`/share-surveys/done`
* GET

`/transfer-surveys`
* GET

`/transfer-surveys/business-selection`
* GET and POST

`/transfer-surveys/survey-selection`
* GET and POST

`/transfer-surveys/recipient-email-address`
* GET and POST

`/transfer-surveys/send-instruction`
* GET and POST

`/transfer-surveys/done`
* GET

`/share-surveys/accept-share-surveys/<token>`
* GET Endpoint to verify token and retrieve the summary page
* `token`

`/confirm-share-surveys/<batch>`
* GET Accept endpoint when a share survey summary is accepted
* `batch` is the batch number

`/confirm-share-surveys/<batch>/existing-account`
* GET Accept redirect endpoint for accepting share surveys for existing account

`/transfer-surveys/accept-transfer-surveys/<token>`
* GET Endpoint to verify transfer token and retrieve the summary page
* `token`

`/confirm-transfer-surveys/<batch>`
* GET Accept endpoint when a transfer survey summary is accepted
* `batch` is the batch number

`/confirm-transfer-surveys/<batch>/existing-account`
* GET Accept redirect endpoint for accepting transfer surveys for existing account
* `batch` is the batch number

## Secure Messaging Endpoints
* requires login

`/create-message/`
* GET and POST

`/threads/<thread_id>`
* GET and POST Endpoint to view conversations by thread_id
* `thread_id`

`/threads`
* GET

## Surveys Endpoints
* requires login

`/access-survey`
* GET

`/add-survey`
* GET and POST

`/add-survey/confirm-organisation-survey`
* GET

`/add-survey/add-survey-submit`
* GET

`/download-survey`
* GET

`/<tag>`
* GET Displays the list of surveys for the respondent by tag.
* `tag` Represents the state the survey is in (e.g., todo, history, etc)

`/upload-survey`
* POST

`/upload-failed`
* GET


text:
<!DOCTYPE html>
<html ng-app="telephoneDirectoryApp">
<head lang="en">
    <meta charset="UTF-8">
    <title></title>

    <script src="js/angular.js"></script>
    <script src="js/angular-route.js"></script>
    <script src="js/app.js"></script>
    <script src="controllers/controllers.js"></script>
</head>
<body>
    <div ng-view></div>
</body>
</html>


text:
module.exports = (function () {
  var utils = require('./utils');

  function UserActionHandler(options, client, action) {
    var self = this;
    this.callbacks = {};

    this.callbackActions = {
      providePin: function (options) {
        options = utils.getOptionsWithDefaults(options, {}, 'pin');
        if (!options || !options.pin) {
          throw new TypeError('Onegini: missing "pin" argument for providePin');
        }

        utils.callbackExec(client, 'providePin', options, callSuccessCallback, callErrorCallback);
      },

      fallbackToPin: function () {
        utils.onceExec(client, 'fallbackToPin');
      },

      acceptFingerprint: function (options) {
        options = utils.getOptionsWithDefaults(options, {}, 'iosPrompt');
        options.accept = true;
        utils.callbackExec(client, 'respondToFingerprintRequest', options, callSuccessCallback, callErrorCallback);
      },

      denyFingerprint: function () {
        utils.callbackExec(client, 'respondToFingerprintRequest', {accept: false}, callSuccessCallback, callErrorCallback)
      },

      createPin: function (options) {
        options = utils.getOptionsWithDefaults(options, {}, 'pin');
        if (!options || !options.pin) {
          throw new TypeError('Onegini: missing "pin" argument for createPin');
        }

        utils.callbackExec(client, 'createPin', options, callSuccessCallback, callErrorCallback);
      },

      handleRegistrationUrl: function (options) {
        options = utils.getOptionsWithDefaults(options, {}, 'url');
        utils.callbackExec(client, 'respondToRegistrationRequest', options, callSuccessCallback, callErrorCallback);
      },

      acceptRegistrationInitRequest: function (options) {
        options = utils.getOptionsWithDefaults(options, {accept: true}, 'data');
        utils.callbackExec(client, 'respondToCustomRegistrationInitRequest', options, callSuccessCallback, callErrorCallback);
      },

      denyRegistrationInitRequest: function (options) {
        options = utils.getOptionsWithDefaults(options, {accept: false});
        utils.callbackExec(client, 'respondToCustomRegistrationInitRequest', options, callSuccessCallback, callErrorCallback);
      },

      acceptRegistrationCompleteRequest: function (options) {
        options = utils.getOptionsWithDefaults(options, {accept: true}, 'data');
        utils.callbackExec(client, 'respondToCustomRegistrationCompleteRequest', options, callSuccessCallback, callErrorCallback);
      },

      denyRegistrationCompleteRequest: function () {
        options = utils.getOptionsWithDefaults(options, {accept: false});
        utils.callbackExec(client, 'respondToCustomRegistrationCompleteRequest', options, callSuccessCallback, callErrorCallback);
      },

      cancel: function () {
        utils.callbackExec(client, 'cancelFlow', {}, callSuccessCallback, callErrorCallback);
      }
    };

    function callSuccessCallback(options) {
      var event = options.pluginEvent;
      delete options.pluginEvent;

      if (self.callbacks[event]) {
        // for onSuccess we don't need to pass callbackActions
        if (event === 'onSuccess') {
          self.callbacks.onSuccess(options);
        } else {
          self.callbacks[event](self.callbackActions, options);
        }
      }
    }

    function callErrorCallback(err) {
      if (self.callbacks.onError) {
        self.callbacks.onError(err);
      } else {
        console.warn('Onegini: An Error occurred but no error callback was registered');
        console.error('Onegini: ', err);
      }
    }

    utils.callbackExec(client, action, options, callSuccessCallback, callErrorCallback)
  }

  UserActionHandler.prototype.onPinRequest = function (cb) {
    this.callbacks.onPinRequest = cb;
    return this;
  };

  UserActionHandler.prototype.onCreatePinRequest = function (cb) {
    this.callbacks.onCreatePinRequest = cb;
    return this;
  };

  UserActionHandler.prototype.onFingerprintRequest = function (cb) {
    this.callbacks.onFingerprintRequest = cb;
    return this;
  };

  UserActionHandler.prototype.onFingerprintCaptured = function (cb) {
    this.callbacks.onFingerprintCaptured = cb;
    return this;
  };

  UserActionHandler.prototype.onFingerprintFailed = function (cb) {
    this.callbacks.onFingerprintFailed = cb;
    return this;
  };

  UserActionHandler.prototype.onRegistrationRequest = function (cb) {
    this.callbacks.onRegistrationRequest = cb;
    return this;
  };

  UserActionHandler.prototype.onCustomRegistrationInitRequest = function (cb) {
    this.callbacks.onCustomRegistrationInitRequest = cb;
    return this;
  };

  UserActionHandler.prototype.onCustomRegistrationCompleteRequest = function (cb) {
    this.callbacks.onCustomRegistrationCompleteRequest = cb;
    return this;
  };

  UserActionHandler.prototype.onError = function (cb) {
    this.callbacks.onError = cb;
    return this;
  };

  UserActionHandler.prototype.onSuccess = function (cb) {
    this.callbacks.onSuccess = cb;
    return this;
  };

  function authenticate(profileOptions, authenticatorOptions) {
    profileOptions = utils.getOptionsWithDefaults(profileOptions, {}, 'profileId');
    if (!profileOptions.profileId) {
      throw new TypeError("Onegini: missing 'profileId' argument for user.authenticate");
    }

    const options = [profileOptions];

    if (authenticatorOptions) {
      authenticatorOptions = utils.getOptionsWithDefaults(authenticatorOptions, {}, 'authenticatorType');
      if (!authenticatorOptions.authenticatorType) {
        throw new TypeError("Onegini: missing 'authenticatorType' argument for user.authenticate");
      }
      options.push(authenticatorOptions);
    }

    return new UserActionHandler(options, 'OneginiUserAuthenticationClient', 'authenticate');
  }

  function authenticateImplicitly(options, successCb, failureCb) {
    options = utils.getOptionsWithDefaults(options, {
      scopes: []
    }, 'profileId');

    if (!options || !options.profileId) {
      throw new TypeError("Onegini: missing 'profileId' argument for user.authenticateImplicitly");
    }

    return utils.promiseOrCallbackExec('OneginiUserAuthenticationClient', 'authenticateImplicitly', options, successCb, failureCb);
  }

  function register(options) {
    options = utils.getOptionsWithDefaults(options, {}, 'scopes');
    return new UserActionHandler(options, 'OneginiUserRegistrationClient', 'start');
  }

  function changePin() {
    return new UserActionHandler(null, 'OneginiChangePinClient', 'start');
  }

  var authenticators = {
    getAll: function (options, successCb, failureCb) {
      if (!options || !options.profileId) {
        throw new TypeError("Onegini: missing 'profileId' argument for authenticators.getAll");
      }
      return utils.promiseOrCallbackExec('OneginiAuthenticatorsClient', 'getAll', options, successCb, failureCb);
    },

    getRegistered: function (options, successCb, failureCb) {
      if (!options || !options.profileId) {
        throw new TypeError("Onegini: missing 'profileId' argument for authenticators.getRegistered");
      }
      return utils.promiseOrCallbackExec('OneginiAuthenticatorsClient', 'getRegistered', options, successCb, failureCb);
    },

    getNotRegistered: function (options, successCb, failureCb) {
      if (!options || !options.profileId) {
        throw new TypeError("Onegini: missing 'profileId' argument for authenticators.getNotRegistered");
      }
      return utils.promiseOrCallbackExec('OneginiAuthenticatorsClient', 'getNotRegistered', options, successCb, failureCb);
    },

    getPreferred: function (successCb, failureCb) {
      return utils.promiseOrCallbackExec("OneginiAuthenticatorsClient", "getPreferred", [], successCb, failureCb);
    },

    setPreferred: function (options, successCb, failureCb) {
      options = utils.getOptionsWithDefaults(options, {}, 'authenticatorType');
      if (!options || !options.authenticatorType) {
        throw new TypeError("Onegini: missing 'authenticatorType' argument for authenticators.setPreferred");
      }
      return utils.promiseOrCallbackExec('OneginiAuthenticatorsClient', 'setPreferred', options, successCb, failureCb);
    },

    registerNew: function (options) {
      options = utils.getOptionsWithDefaults(options, {}, 'authenticatorType');
      if (!options || !options.authenticatorType) {
        throw new TypeError("Onegini: missing 'authenticatorType' argument for authenticators.registerNew");
      }

      return new UserActionHandler(options, 'OneginiAuthenticatorRegistrationClient', 'start');
    },

    deregister: function (options, successCb, failureCb) {
      if (!options || !options.authenticatorType) {
        throw new TypeError("Onegini: missing 'authenticatorType' argument for authenticators.deregister");
      }
      return utils.promiseOrCallbackExec('OneginiAuthenticatorRegistrationClient', 'deregister', options, successCb, failureCb);
    }
  };

  function deregister(options, successCb, failureCb) {
    if (!options || !options.profileId) {
      throw new TypeError("Onegini: missing 'profileId' argument for deregister");
    }
    return utils.promiseOrCallbackExec('OneginiUserDeregistrationClient', 'deregister', options, successCb, failureCb);
  }

  function isUserRegistered(options, successCb, failureCb) {
    if (!options || !options.profileId) {
      throw new TypeError("Onegini: missing 'profileId' argument for isUserRegistered");
    }
    return utils.promiseOrCallbackExec('OneginiUserRegistrationClient', 'isUserRegistered', options, successCb, failureCb);
  }

  function getUserProfiles(successCb, failureCb) {
    return utils.promiseOrCallbackExec('OneginiUserRegistrationClient', 'getUserProfiles', [], successCb, failureCb);
  }

  function getAuthenticatedUserProfile(successCb, failureCb) {
    return utils.promiseOrCallbackExec('OneginiUserAuthenticationClient', 'getAuthenticatedUserProfile', [], successCb, failureCb);
  }

  function getImplicitlyAuthenticatedUserProfile(successCb, failureCb) {
    return utils.promiseOrCallbackExec('OneginiUserAuthenticationClient', 'getImplicitlyAuthenticatedUserProfile', [], successCb, failureCb);
  }

  function logout(successCb, failureCb) {
    return utils.promiseOrCallbackExec('OneginiUserAuthenticationClient', 'logout', [], successCb, failureCb);
  }

  function validatePinWithPolicy(options, successCb, failureCb) {
    if (!options || !options.pin) {
      throw new TypeError("Onegini: missing 'pin' argument for validatePinWithPolicy");
    }
    return utils.promiseOrCallbackExec('OneginiUserClient', 'validatePinWithPolicy', options, successCb, failureCb);
  }

  function getIdentityProviders(successCb, failureCb) {
    return utils.promiseOrCallbackExec('OneginiIdentityProvidersClient', 'getIdentityProviders', [], successCb, failureCb);
  }

  function getAppToWebSingleSignOn(options, successCb, failureCb) {
    if (!options) {
      throw new TypeError("Onegini: missing 'targetUri' argument for App To Web Single Sign-On");
    }
    return utils.promiseOrCallbackExec("OneginiAppToWebSingleSignOnClient", 'start', options, successCb, failureCb);
  }

  return {
    authenticate: authenticate,
    authenticateImplicitly: authenticateImplicitly,
    register: register,
    changePin: changePin,
    authenticators: authenticators,
    deregister: deregister,
    isUserRegistered: isUserRegistered,
    getUserProfiles: getUserProfiles,
    getAuthenticatedUserProfile: getAuthenticatedUserProfile,
    getImplicitlyAuthenticatedUserProfile: getImplicitlyAuthenticatedUserProfile,
    logout: logout,
    validatePinWithPolicy: validatePinWithPolicy,
    getIdentityProviders: getIdentityProviders,
    getAppToWebSingleSignOn: getAppToWebSingleSignOn
  };
})();


text:
#ifndef CPU_JIT_AVX2_1x1_CONVOLUTION_HPP
#define CPU_JIT_AVX2_1x1_CONVOLUTION_HPP

#include "c_types_map.hpp"
#include "memory_tracking.hpp"
#include "mkldnn_thread.hpp"
#include "utils.hpp"

#include "cpu_convolution_pd.hpp"
#include "cpu_primitive.hpp"
#include "cpu_reducer.hpp"

#include "jit_avx2_1x1_conv_kernel_f32.hpp"
#include "jit_uni_1x1_conv_utils.hpp"

namespace mkldnn {
namespace impl {
namespace cpu {

struct jit_avx2_1x1_convolution_fwd_t: public cpu_primitive_t {
    // TODO: (Roma) Code duplication duplication! Remove with templates
    //              (maybe...)!
    struct pd_t: public cpu_convolution_fwd_pd_t {
        pd_t(engine_t *engine, const convolution_desc_t *adesc,
                const primitive_attr_t *attr,
                const typename pd_t::base_class *hint_fwd_pd)
            : cpu_convolution_fwd_pd_t(engine, adesc, attr, hint_fwd_pd)
            , jcp_(), rtus_() {}

        DECLARE_COMMON_PD_T(
                JIT_IMPL_NAME_HELPER("jit_1x1:", avx2, ""),
                jit_avx2_1x1_convolution_fwd_t);

        status_t init() {
            bool ok = true
                && is_fwd()
                && set_default_alg_kind(alg_kind::convolution_direct)
                && expect_data_types(data_type::f32, data_type::f32,
                        data_type::f32, data_type::f32, data_type::f32)
                && !has_zero_dim_memory()
                && set_default_formats();
            if (!ok) return status::unimplemented;

            const convolution_desc_t *conv_d = desc();
            const memory_desc_t *src_d = src_md();
            rtus_prepare(this, conv_d, src_d, dst_md());

            status_t status = jit_avx2_1x1_conv_kernel_f32::init_conf(jcp_,
                    *conv_d, *src_d, *weights_md(), *dst_md(), *attr());
            if (status != status::success) return status;

            auto scratchpad = scratchpad_registry().registrar();
            jit_avx2_1x1_conv_kernel_f32::init_scratchpad(scratchpad, jcp_);

            rtus_prepare_space_info(this, scratchpad);

            return status::success;
        }

        jit_1x1_conv_conf_t jcp_;
        reduce_to_unit_stride_t rtus_;

    protected:
        bool set_default_formats() {
            using namespace format_tag;

            auto dat_tag = utils::pick(ndims() - 3, nCw8c, nChw8c, nCdhw8c);
            auto wei_tag = with_groups()
                ? utils::pick(ndims() - 3, gOIw8i8o, gOIhw8i8o)
                : utils::pick(ndims() - 3, OIw8i8o, OIhw8i8o);

            return set_default_formats_common(dat_tag, wei_tag, dat_tag);
        }
    };

    template <cpu_isa_t isa, typename conv_t>
    friend void init_rtus_driver(conv_t *self);

    jit_avx2_1x1_convolution_fwd_t(const pd_t *apd)
        : cpu_primitive_t(apd)
        , kernel_(nullptr), rtus_driver_(nullptr)
    {
        kernel_ = new jit_avx2_1x1_conv_kernel_f32(pd()->jcp_, *pd()->attr());
        init_rtus_driver<avx2>(this);
    }

    ~jit_avx2_1x1_convolution_fwd_t() {
        delete kernel_;
        delete rtus_driver_;
    }

    typedef typename prec_traits<data_type::f32>::type data_t;

    virtual status_t execute(const exec_ctx_t &ctx) const override {
        execute_forward(ctx);
        return status::success;
    }

private:
    void execute_forward(const exec_ctx_t &ctx) const;
    const pd_t *pd() const { return (const pd_t *)primitive_t::pd(); }

    jit_avx2_1x1_conv_kernel_f32 *kernel_;
    rtus_driver_t<avx2> *rtus_driver_;
};

struct jit_avx2_1x1_convolution_bwd_data_t: public cpu_primitive_t {
    struct pd_t: public cpu_convolution_bwd_data_pd_t {
        pd_t(engine_t *engine,
                const convolution_desc_t *adesc,
                const primitive_attr_t *attr,
                const convolution_fwd_pd_t *hint_fwd_pd)
            : cpu_convolution_bwd_data_pd_t(engine, adesc, attr, hint_fwd_pd)
            , jcp_(), rtus_() {}

        DECLARE_COMMON_PD_T(
                JIT_IMPL_NAME_HELPER("jit_1x1:", avx2, ""),
                jit_avx2_1x1_convolution_bwd_data_t);

        status_t init() {
            bool ok = true
                && desc()->prop_kind == prop_kind::backward_data
                && set_default_alg_kind(alg_kind::convolution_direct)
                && expect_data_types(data_type::f32, data_type::f32,
                        data_type::undef, data_type::f32, data_type::f32)
                && !has_zero_dim_memory()
                && set_default_formats();
            if (!ok) return status::unimplemented;

            const convolution_desc_t *conv_d = desc();
            const memory_desc_t *diff_src_d = diff_src_md();
            rtus_prepare(this, conv_d, diff_src_d, diff_dst_md());

            status_t status = jit_avx2_1x1_conv_kernel_f32::init_conf(jcp_,
                    *conv_d, *diff_src_d, *weights_md(), *diff_dst_md(),
                    *attr());
            if (status != status::success) return status;

            auto scratchpad = scratchpad_registry().registrar();
            jit_avx2_1x1_conv_kernel_f32::init_scratchpad(scratchpad, jcp_);

            rtus_prepare_space_info(this, scratchpad);

            return status::success;
        }

        jit_1x1_conv_conf_t jcp_;
        reduce_to_unit_stride_t rtus_;

    protected:
        bool set_default_formats() {
            using namespace format_tag;

            auto dat_tag = utils::pick(ndims() - 3, nCw8c, nChw8c, nCdhw8c);
            auto wei_tag = with_groups()
                ? utils::pick(ndims() - 3, gOIw8o8i, gOIhw8o8i)
                : utils::pick(ndims() - 3, OIw8o8i, OIhw8o8i);

            return set_default_formats_common(dat_tag, wei_tag, dat_tag);
        }
    };

    template <cpu_isa_t isa, typename conv_t>
    friend void init_rtus_driver(conv_t *self);

    jit_avx2_1x1_convolution_bwd_data_t(const pd_t *apd)
        : cpu_primitive_t(apd)
        , kernel_(nullptr)
        , rtus_driver_(nullptr)
    {
        kernel_ = new jit_avx2_1x1_conv_kernel_f32(pd()->jcp_, *pd()->attr());
        init_rtus_driver<avx2>(this);
    }

    ~jit_avx2_1x1_convolution_bwd_data_t() {
        delete kernel_;
        delete rtus_driver_;
    }

    typedef typename prec_traits<data_type::f32>::type data_t;

    virtual status_t execute(const exec_ctx_t &ctx) const override {
        execute_backward_data(ctx);
        return status::success;
    }

private:
    void execute_backward_data(const exec_ctx_t &ctx) const;
    const pd_t *pd() const { return (const pd_t *)primitive_t::pd(); }

    jit_avx2_1x1_conv_kernel_f32 *kernel_;
    rtus_driver_t<avx2> *rtus_driver_;
};

struct jit_avx2_1x1_convolution_bwd_weights_t: public cpu_primitive_t {
    struct pd_t: public cpu_convolution_bwd_weights_pd_t {
        pd_t(engine_t *engine, const convolution_desc_t *adesc,
                const primitive_attr_t *attr,
                const convolution_fwd_pd_t *hint_fwd_pd)
            : cpu_convolution_bwd_weights_pd_t(engine, adesc, attr, hint_fwd_pd)
            , jcp_(), rtus_() {}

        DECLARE_COMMON_PD_T(
                JIT_IMPL_NAME_HELPER("jit_1x1:", avx2, ""),
                jit_avx2_1x1_convolution_bwd_weights_t);

        status_t init() {
            bool ok = true
                && desc()->prop_kind == prop_kind::backward_weights
                && set_default_alg_kind(alg_kind::convolution_direct)
                && expect_data_types(data_type::f32, data_type::f32,
                        data_type::f32, data_type::f32, data_type::f32)
                && !has_zero_dim_memory()
                && set_default_formats();
            if (!ok) return status::unimplemented;

            const convolution_desc_t *conv_d = desc();
            const memory_desc_t *src_d = src_md();
            rtus_prepare(this, conv_d, src_d, diff_dst_md());

            status_t status = jit_avx2_1x1_conv_kernel_f32::init_conf(jcp_,
                    *conv_d, *src_d, *diff_weights_md(), *diff_dst_md(),
                    *attr());
            if (status != status::success) return status;

            init_balancers();

            auto scratchpad = scratchpad_registry().registrar();
            jit_avx2_1x1_conv_kernel_f32::init_scratchpad(scratchpad, jcp_);

            rtus_prepare_space_info(this, scratchpad);

            auto reducer_bia_scratchpad = memory_tracking::registrar_t(
                    scratchpad, memory_tracking::names::prefix_reducer_bia);
            reducer_bia_conf_.init_scratchpad(reducer_bia_scratchpad);

            auto reducer_wei_scratchpad = memory_tracking::registrar_t(
                    scratchpad, memory_tracking::names::prefix_reducer_wei);
            reducer_wei_conf_.init_scratchpad(reducer_wei_scratchpad);

            return status::success;
        }

        jit_1x1_conv_conf_t jcp_;
        cpu_reducer_t<data_type::f32>::conf_t reducer_bia_conf_;
        cpu_reducer_2d_t<data_type::f32>::conf_t reducer_wei_conf_;
        reduce_to_unit_stride_t rtus_;

    protected:
        bool set_default_formats() {
            using namespace format_tag;

            auto dat_tag = utils::pick(ndims() - 3, nCw8c, nChw8c, nCdhw8c);
            auto wei_tag = with_groups()
                ? utils::pick(ndims() - 3, gOIw8i8o, gOIhw8i8o)
                : utils::pick(ndims() - 3, OIw8i8o, OIhw8i8o);

            return set_default_formats_common(dat_tag, wei_tag, dat_tag);
        }

    private:
        void init_balancers() {
            const int ic_block = jcp_.bcast_block;
            const int nb_ic = jcp_.nb_bcast;
            const int nb_ic_blocking = jcp_.nb_bcast_blocking;
            const int bcast_work = utils::div_up(nb_ic, nb_ic_blocking);

            const int oc_block = jcp_.load_block;
            const int nb_oc = jcp_.nb_load;
            const int nb_oc_blocking = jcp_.nb_load_blocking;
            const int load_work = utils::div_up(nb_oc, nb_oc_blocking);

            const int job_size
                = nb_oc_blocking * nb_ic_blocking * ic_block * oc_block;
            const int njobs_x = bcast_work;
            const int njobs_y = jcp_.ngroups * load_work;

            const int max_threads = mkldnn_get_max_threads();
            const size_t max_buffer_size = max_threads * job_size * 8;

            if (with_bias()) {
                reducer_bia_conf_.init(reduce_balancer_t(max_threads,
                            oc_block, jcp_.ngroups * jcp_.oc / oc_block,
                            jcp_.mb, max_buffer_size));
            }

            reducer_wei_conf_.init(
                    reduce_balancer_t(max_threads, job_size, njobs_y * njobs_x,
                        jcp_.mb * jcp_.nb_reduce, max_buffer_size),
                    job_size / nb_oc_blocking, nb_oc_blocking, ic_block,
                    nb_ic * ic_block * oc_block, nb_oc);
        }
    };

    template <cpu_isa_t isa, typename conv_t>
    friend void init_rtus_driver(conv_t *self);

    jit_avx2_1x1_convolution_bwd_weights_t(const pd_t *apd);

    ~jit_avx2_1x1_convolution_bwd_weights_t() {
        delete kernel_;
        delete rtus_driver_;
        delete reducer_weights_;
        delete reducer_bias_;
    }

    typedef typename prec_traits<data_type::f32>::type data_t;

    virtual status_t execute(const exec_ctx_t &ctx) const override {
        execute_backward_weights(ctx);
        return status::success;
    }

private:
    void execute_backward_weights(const exec_ctx_t &ctx) const;
    const pd_t *pd() const { return (const pd_t *)primitive_t::pd(); }

    jit_avx2_1x1_conv_kernel_f32 *kernel_;
    cpu_reducer_2d_t<data_type::f32> *reducer_weights_;
    cpu_reducer_t<data_type::f32> *reducer_bias_;
    rtus_driver_t<avx2> *rtus_driver_;
};

}
}
}

#endif


text:
@implementation EmptyDatasource

- (instancetype)init {

    self = [super initWithObjectsClass:[Item class]];
    if (self) {

    }
    return self;
}

@end


text:
from swgpy.object import *

def create(kernel):
	result = Tangible()

	result.template = "object/tangible/scout/camp/shared_camp_basic.iff"
	result.attribute_template_id = -1
	result.stfName("item_n","camp_basic")

	#### BEGIN MODIFICATIONS ####
	####  END MODIFICATIONS  ####

	return result


text:
package spire.laws

import scala.reflect.ClassTag

import spire.algebra._
import spire.algebra.free._
import spire.math._

import org.scalacheck.{Arbitrary, Gen}
import org.scalacheck.Arbitrary._

object SpireArbitrary {

  implicit def UByteArbitrary: Arbitrary[UByte] =
    Arbitrary(arbitrary[Byte].map(new UByte(_)))

  implicit def UShortArbitrary: Arbitrary[UShort] =
    Arbitrary(arbitrary[Short].map(n => new UShort(n.toChar)))

  implicit def UIntArbitrary: Arbitrary[UInt] =
    Arbitrary(arbitrary[Int].map(new UInt(_)))

  implicit def ULongArbitrary: Arbitrary[ULong] =
    Arbitrary(arbitrary[Long].map(new ULong(_)))

  implicit def FixedScale: Arbitrary[FixedScale] =
    Arbitrary(arbitrary[Short].map(n => new FixedScale(n & 0xffff)))

  implicit def FixedPoint: Arbitrary[FixedPoint] =
    Arbitrary(arbitrary[Long].map(n => new FixedPoint(n)))

  implicit def SafeLongArbitrary: Arbitrary[SafeLong] =
    Arbitrary(Gen.oneOf(
      arbitrary[Long].map(SafeLong(_)),
      arbitrary[BigInt].map(SafeLong(_))))

  implicit def NaturalArbitrary: Arbitrary[Natural] =
    Arbitrary(Gen.oneOf(
      arbitrary[Long].map(n => Natural(n & Long.MaxValue)),
      arbitrary[BigInt].map(n => Natural(n.abs))))

  implicit def RationalArbitrary: Arbitrary[Rational] =
    Arbitrary(Gen.oneOf(
      arbitrary[Long] map (Rational(_)),
      arbitrary[Double] map (Rational(_))))

  implicit def NumberArbitrary: Arbitrary[Number] =
    Arbitrary(Gen.oneOf(
      arbitrary[Long].map(Number(_)),
      arbitrary[Double].map(Number(_)),
      arbitrary[BigDecimal].map(Number(_)),
      arbitrary[Rational].map(Number(_))))

  implicit def AlgebraicArbitrary: Arbitrary[Algebraic] =
    Arbitrary(arbitrary[Int] map (Algebraic(_)))

  implicit def RealArbitrary: Arbitrary[Real] =
    Arbitrary(arbitrary[Rational] map (Real(_)))

  implicit def VectorArbitrary[A: Arbitrary]: Arbitrary[Vector[A]] =
    Arbitrary(arbitrary[List[A]] map (Vector(_: _*)))

  implicit def SignArbitrary: Arbitrary[Sign] =
    Arbitrary(Gen.oneOf(Sign.Positive, Sign.Zero, Sign.Negative))

  implicit def TermArbitrary[A: Arbitrary]: Arbitrary[poly.Term[A]] =
    Arbitrary(for {
      e <- arbitrary[Short].map(_.toInt)
      c <- arbitrary[A]
    } yield poly.Term(c, e))

  implicit def PolynomialArbitrary[A: Arbitrary: Semiring: Eq: ClassTag]: Arbitrary[Polynomial[A]] =
    Arbitrary(arbitrary[List[poly.Term[A]]].map(ts => Polynomial(ts.take(6))))

  implicit def ComplexArbitrary[A: Arbitrary]: Arbitrary[Complex[A]] =
    Arbitrary(for {
      r <- arbitrary[A]
      i <- arbitrary[A]
    } yield Complex(r, i))

  // hardcoded to infinitesimal dimension=2 :/
  implicit def JetArbitrary[A: Arbitrary: ClassTag]: Arbitrary[Jet[A]] =
    Arbitrary(for {
      r <- arbitrary[A]
      inf0 <- arbitrary[A]
      inf1 <- arbitrary[A]
    } yield Jet(r, Array(inf0, inf1)))

  implicit def QuaternionArbitrary[A: Arbitrary]: Arbitrary[Quaternion[A]] =
    Arbitrary(for {
      r <- arbitrary[A]
      i <- arbitrary[A]
      j <- arbitrary[A]
      k <- arbitrary[A]
    } yield Quaternion(r, i, j, k))

  implicit def BoundArbitrary[A: Arbitrary]: Arbitrary[Interval.Bound[A]] =
    Arbitrary(Gen.oneOf(
      arbitrary[A].map(Interval.Open(_)),
      arbitrary[A].map(Interval.Closed(_)),
      arbitrary[Unit].map(_ => Interval.Unbound[A])))

  implicit def IntervalArbitrary[A: Arbitrary: Order: AdditiveMonoid]: Arbitrary[Interval[A]] =
    Arbitrary(for {
      lower <- arbitrary[Interval.Bound[A]]
      upper <- arbitrary[Interval.Bound[A]]
    } yield Interval.fromBounds(lower, upper))

  implicit def FreeMonoidArbitrary[A: Arbitrary]: Arbitrary[FreeMonoid[A]] =
    Arbitrary(for {
      terms <- arbitrary[List[A]].map(_.map(FreeMonoid(_)))
    } yield terms.foldLeft(FreeMonoid.id[A])(_ |+| _))

  implicit def FreeGroupArbitrary[A: Arbitrary]: Arbitrary[FreeGroup[A]] =
    Arbitrary(for {
      terms <- arbitrary[List[Either[A, A]]]
    } yield {
      terms.foldLeft(FreeGroup.id[A]) {
        case (acc, Left(a)) => acc |-| FreeGroup(a)
        case (acc, Right(a)) => acc |+| FreeGroup(a)
      }
    })

  case class FreeAbTerm[A](a: A, n: Int)
  implicit def FreeAbTermArbitrary[A: Arbitrary]: Arbitrary[FreeAbTerm[A]] =
    Arbitrary(for {
      a <- arbitrary[A]
      n <- arbitrary[Short].map(_.toInt)
    } yield FreeAbTerm(a, n))

  implicit def FreeAbGroupArbitrary[A: Arbitrary]: Arbitrary[FreeAbGroup[A]] =
    Arbitrary(for {
      terms <- arbitrary[List[FreeAbTerm[A]]]
    } yield {
      terms.map { case FreeAbTerm(a, n) =>
        Group[FreeAbGroup[A]].sumn(FreeAbGroup(a), n)
      }.foldLeft(FreeAbGroup.id[A])(_ |+| _)
    })
}

// vim: expandtab:ts=2:sw=2


text:
//
//  Reading from multiple sockets
//  This version uses a simple recv loop
//

//  Author:     Michael Compton, Tomas Roos
//  Email:      michael.compton@littleedge.co.uk, ptomasroos@gmail.com

using System;
using System.Text;
using System.Threading;
using ZMQ;

namespace ZMQGuide
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            using (var context = new Context(1))
            {
                //  Connect to task ventilator and weather server
                using (Socket receiver = context.Socket(SocketType.PULL), subscriber = context.Socket(SocketType.SUB))
                {
                    receiver.Connect("tcp://localhost:5557");
                    subscriber.Connect("tcp://localhost:5556");
                    subscriber.Subscribe("10001 ", Encoding.Unicode);

                    //  Process messages from both sockets
                    //  We prioritize traffic from the task ventilator
                    while (true)
                    {
                        //  Process any waiting tasks
                        while (true)
                        {
                            byte[] message = receiver.Recv(SendRecvOpt.NOBLOCK);
                            if (message != null)
                            {
                                Console.WriteLine("Process Task");
                            }
                            else
                            {
                                break;
                            }
                        }

                        //  Process any waiting weather updates
                        while (true)
                        {
                            byte[] message = subscriber.Recv(SendRecvOpt.NOBLOCK);
                            if (message != null)
                            {
                                Console.WriteLine("Process Weather");
                            }
                            else
                            {
                                break;
                            }
                        }

                        Thread.Sleep(1000);
                    }
                }
            }
        }
    }
}


text:
package net.n8dgr8.gdcr.universe.domain;

import org.springframework.data.redis.core.RedisTemplate;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;

public class Universe {

    public static final int DEFAULT_WIDTH = 26;
    public static final int DEFAULT_HEIGHT = 26;

    private String universeId;
    private Integer universeWidth = DEFAULT_WIDTH;
    private Integer universeHeight = DEFAULT_HEIGHT;

    private List<Generation> generations = new ArrayList<>();

    private RedisTemplate<String, String> redisTemplate;

    public Universe(RedisTemplate<String, String> newRedisTemplate) {
        redisTemplate = newRedisTemplate;
        universeId = UUID.randomUUID().toString();
    }

    public Universe(String id, RedisTemplate<String, String> newRedisTemplate) {
        redisTemplate = newRedisTemplate;
        universeId = id;

        Map<Object, Object> universeAttributes = redisTemplate.opsForHash().entries(String.format("universe:%s", universeId));

        setUniverseHeight(Integer.valueOf(universeAttributes.get("height").toString()));
        setUniverseWidth(Integer.valueOf(universeAttributes.get("width").toString()));
    }

    public String getUniverseId() {
        return universeId;
    }

    public Integer getUniverseHeight() {
        return universeHeight;
    }

    public void setUniverseHeight(Integer newUniverseHeight) {
        redisTemplate.opsForHash().put(String.format("universe:%s", universeId), "height", String.valueOf(newUniverseHeight));
        universeHeight = newUniverseHeight;
    }

    public Integer getUniverseWidth() {
        return universeWidth;
    }

    public void setUniverseWidth(Integer newUniverseWidth) {
        redisTemplate.opsForHash().put(String.format("universe:%s", universeId), "width", String.valueOf(newUniverseWidth));
        universeWidth = newUniverseWidth;
    }

    public List<Generation> getGenerations() {
        return generations;
    }

    public Integer getUniverseSize() {
        return universeHeight * universeWidth;
    }
}


text:
package ru.job4j;
/**
 * Calculate.
 * @author drozdetsky (disprozium@gmail.com)
 * @version 1
 * @since 22.05.2017
 */
public class Calculate {
    /**
	 * Main.
	 * @param args - args
	 */
	public static void main(String[] args) {
        System.out.println("Hello World");
    }
}


text:
package io.undertow.attribute;

import java.net.InetSocketAddress;

import io.undertow.server.HttpServerExchange;

/**
 * The local IP address
 *
 * @author Stuart Douglas
 */
public class LocalIPAttribute implements ExchangeAttribute {

    public static final String LOCAL_IP = "%{LOCAL_IP}";
    public static final String LOCAL_IP_SHORT = "%A";

    public static final ExchangeAttribute INSTANCE = new LocalIPAttribute();

    private LocalIPAttribute() {

    }

    @Override
    public String readAttribute(final HttpServerExchange exchange) {
        InetSocketAddress localAddress = (InetSocketAddress) exchange.getConnection().getLocalAddress();
        return localAddress.getAddress().getHostAddress();
    }

    @Override
    public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
        throw new ReadOnlyAttributeException("Local IP", newValue);
    }

    public static final class Builder implements ExchangeAttributeBuilder {

        @Override
        public String name() {
            return "Local IP";
        }

        @Override
        public ExchangeAttribute build(final String token) {
            if (token.equals(LOCAL_IP) || token.equals(LOCAL_IP_SHORT)) {
                return LocalIPAttribute.INSTANCE;
            }
            return null;
        }
    }
}


text:
package com.vaporwarecorp.mirror.feature.common;

import com.robopupu.api.component.Manager;

public interface MirrorManager extends Manager {
// -------------------------- OTHER METHODS --------------------------

    void onFeaturePause();

    void onFeatureResume();

    void onFeatureStart();

    void onFeatureStop();

    void onViewStart();

    void onViewStop();
}


text:
<!DOCTYPE html>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<title>Welcome</title>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">

		<link rel="stylesheet" href="css/logic.css">

			<form action="" class="sky-form">

				<fieldset>

							Username

									<input type="email">

							Password

									<input type="password">

				</fieldset>

					<button type="submit" class="button" onclick="window.location.href='http://imedical.mybluemix.net/';return false;">Log in</button>
					Sign up

			</form>


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

<title>com.stylepoints.habittracker.repository</title>
<meta name="date" content="2017-12-04">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

com.stylepoints.habittracker.repository

Classes

HabitEventRepository

HabitRepository

RelationshipRepository

UserRepository

Util

Exceptions

NonUniqueException


text:
<?php

class Portal_SaveAjax_Action extends Vtiger_SaveAjax_Action {

    public function process(Vtiger_Request $request) {
        $module = $request->getModule();
        $recordId = $request->get('record');
        $bookmarkName = $request->get('bookmarkName');
        $bookmarkUrl = $request->get('bookmarkUrl');

        Portal_Module_Model::savePortalRecord($recordId, $bookmarkName, $bookmarkUrl);

        $response = new Vtiger_Response();
        $result = array('message' => vtranslate('LBL_BOOKMARK_SAVED_SUCCESSFULLY', $module));
        $response->setResult($result);
        $response->emit();
    }
}


text:
package org.apache.s2graph.counter.util

object SplitBytes {
  def apply(bytes: Array[Byte], sizes: Seq[Int]): Seq[Array[Byte]] = {
    if (sizes.sum > bytes.length) {
      throw new Exception(s"sizes.sum bigger than bytes.length ${sizes.sum} > ${bytes.length}} ")
    }

    var position = 0
    val rtn = {
      for {
        size <- sizes
      } yield {
        val slice = bytes.slice(position, position + size)
        position += size
        slice
      }
    }
    rtn ++ Seq(bytes.drop(position))
  }
}


text:
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import queryString from 'query-string';
import { api } from '../utils/api';
import PlayerPreview from './PlayerPreview';
import Loading from './Loading';

const Profile = (props) => {
  const info = props.info;

  return (
    <PlayerPreview username={info.login} avatar={info.avatar_url}>

        {info.name &&
{info.name}
}
        {info.location &&
{info.location}
}
        {info.company &&
{info.company}
}

Followers: {info.followers}

Following: {info.following}

Public Repos: {info.public_repos}

        {info.blog &&
{info.blog}
}

    </PlayerPreview>
  );
};

Profile.propTypes = {
  info: PropTypes.object.isRequired
};

const Player = (props) => {
  return (

{props.label}

Score: {props.score}

       <Profile info={props.profile} />

  );
};

Player.propTypes = {
  label: PropTypes.string.isRequired,
  score: PropTypes.number.isRequired,
  profile: PropTypes.object.isRequired
};

class Results extends Component {
  constructor(props) {
    super(props);

    this.state = {
      winner: null,
      loser: null,
      error: null,
      loading: true
    };
  }

  componentDidMount() {
    const players = queryString.parse(this.props.location.search);

    api.battle([
      players.playerOneName,
      players.playerTwoName
    ]).then((results) => {
      if (results === null) {
        return this.setState(() => {
          return {
            error: 'Looks like there was error. Check that both users exist on Github',
            loading: false
          };
        });
      }

      this.setState(() => {
        return {
          error: null,
          winner: results[0],
          loser: results[1],
          loading: false
        };
      });
    });
  }

  render() {
    const error = this.state.error;
    const winner = this.state.winner;
    const loser = this.state.loser;
    const loading = this.state.loading;

    if (loading === true) {
      return <Loading />;
    }

    if (error) {
      return (

{error}

          <Link to='/battle'>Reset</Link>

      );
    }

    return (

        <Player
          label='Winner'
          score={winner.score}
          profile={winner.profile}
        />
        <Player
          label='Loser'
          score={loser.score}
          profile={loser.profile}
        />

    );
  }
}

export default Results;


text:
package kr.ac.cau.lumin.algomoa.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;

import java.util.ArrayList;

import kr.ac.cau.lumin.algomoa.R;
import kr.ac.cau.lumin.algomoa.Util.Adapter.SiteAdapter;
import kr.ac.cau.lumin.algomoa.Util.Algorithm.SiteList;
import kr.ac.cau.lumin.algomoa.Util.Language.LanguageList;
import kr.ac.cau.lumin.algomoa.Util.User;

/**
 * Created by Lumin on 2015-11-26.
 */
public class SiteSelectActivity extends AppCompatActivity {
    private Toolbar toolbar;
    private RecyclerView siteRecyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_select_view);

        this.siteRecyclerView = (RecyclerView) findViewById(R.id.fav_site_recycler);
        this.siteRecyclerView.setHasFixedSize(true);
        this.siteRecyclerView.setLayoutManager(new LinearLayoutManager(SiteSelectActivity.this));
        this.siteRecyclerView.setAdapter(new SiteAdapter(SiteSelectActivity.this, this.getOrderedLanguageList(), null, R.layout.refer_itemview));

        this.initializeToolBar();
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        switch (id) {
            case android.R.id.home:
                Intent intent = new Intent(this, MainActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
                return true;
        }

        return super.onOptionsItemSelected(item);
    }

    private void initializeToolBar() {
        this.toolbar = (Toolbar) findViewById(R.id.toolbar);

        if (this.toolbar != null) {
            this.setSupportActionBar(this.toolbar);
            this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        }
    }

    private ArrayList<SiteList> getOrderedLanguageList() {
        ArrayList<SiteList> userSiteList = User.getInstance().copyFavoriteAlgorithmSite();
        ArrayList<SiteList> favSiteList = new ArrayList<>();
        ArrayList<SiteList> unFavSiteList = new ArrayList<>();
        ArrayList<SiteList> resultList = new ArrayList<>();

        for (SiteList site : SiteList.fetchAllSiteList()) {
            if (userSiteList.indexOf(site) != -1) {
                favSiteList.add(site);
            } else {
                unFavSiteList.add(site);
            }
        }

        for (SiteList site : favSiteList) {
            resultList.add(site);
        }

        for (SiteList site : unFavSiteList) {
            resultList.add(site);
        }

        return resultList;
    }
}


text:
<?php

/*
 * This file is part of Mandango.
 *
 * (c) Pablo Díez <pablodip@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Mandango\MandangoBundle\Validator\Constraint;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
use Mandango\Mandango;
use Mandango\Document\Document;

/**
 * UniqueConstraint.
 *
 * @author Pablo Díez <pablodip@gmail.com>
 */
class UniqueDocumentValidator extends ConstraintValidator
{
    private $mandango;

    /**
     * @param Mandango $mandango A mandango.
     */
    public function __construct(Mandango $mandango)
    {
        $this->mandango = $mandango;
    }

    /**
     * Validates the document uniqueness.
     *
     * @param \Mandango\Document\Document $value      The document.
     * @param Constraint|UniqueDocument   $constraint The constraint.=
     */
    public function validate($value, Constraint $constraint)
    {
        $document = $this->parseDocument($value);
        $fields = $this->parseFields($constraint->fields);
        $caseInsensitive = $this->parseCaseInsensitive($constraint->caseInsensitive);

        $query = $this->createQuery($document, $fields, $caseInsensitive);
        $numberResults = $query->count();

        if (0 === $numberResults) {
            return;
        }

        if (1 === $numberResults) {
            $result = $query->one();
            if ($result === $document) {
                return;
            }
        }

        if ($this->context) {
            $this->context->buildViolation($constraint->message)
                ->atPath($fields[0])
                ->addViolation();
        }
    }

    private function parseDocument($document)
    {
        if (!$document instanceof Document) {
            throw new \InvalidArgumentException('The value must be a mandango document.');
        }

        return $document;
    }

    private function parseFields($fields)
    {
        if (is_string($fields)) {
            $fields = array($fields);
        } elseif (is_array($fields)) {
            if (0 === count($fields)) {
                throw new ConstraintDefinitionException('At least one field has to be specified.');
            }
        } else {
            throw new UnexpectedTypeException($fields, 'array');
        }

        return $fields;
    }

    private function parseCaseInsensitive($caseInsensitive)
    {
        if (!is_array($caseInsensitive)) {
            throw new UnexpectedTypeException($caseInsensitive, 'array');
        }

        return $caseInsensitive;
    }

    private function createQuery(Document $document, array $fields, array $caseInsensitive)
    {
        $repository = $this->mandango->getRepository(get_class($document));
        $criteria = $this->createCriteria($document, $fields, $caseInsensitive);

        return $repository->createQuery($criteria);
    }

    private function createCriteria(Document $document, array $fields, array $caseInsensitive)
    {
        $criteria = array();
        foreach ($fields as $field) {
            $value = $document->get($field);
            if (in_array($field, $caseInsensitive)) {
                $value = new \MongoDB\BSON\Regex(sprintf('^%s$', $value), 'i');
            }
            $criteria[$field] = $value;
        }

        return $criteria;
    }
}


text:
<?php

namespace ITR\TestBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class UserType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('update_time',NULL,array('attr' => array('class'=>'form-control', 'min' => '60')))
            ->add('posts_count',NULL,array('attr' => array('class'=>'form-control', 'min' => '20')))
            ->add('acceptable_words',NULL,array('attr' => array('class'=>'form-control')))
            ->add('unacceptable_words',NULL,array('attr' => array('class'=>'form-control')))
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'ITR\TestBundle\Entity\User'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'itr_testbundle_user';
    }
}