text:
.class public Lcom/android/internal/view/IInputConnectionWrapper;
.super Lcom/android/internal/view/IInputContext$Stub;
.source "IInputConnectionWrapper.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/internal/view/IInputConnectionWrapper$MyHandler;,
        Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    }
.end annotation

# static fields
.field private static final DO_BEGIN_BATCH_EDIT:I = 0x5a

.field private static final DO_CLEAR_META_KEY_STATES:I = 0x82

.field private static final DO_COMMIT_COMPLETION:I = 0x37

.field private static final DO_COMMIT_CORRECTION:I = 0x38

.field private static final DO_COMMIT_TEXT:I = 0x32

.field private static final DO_DELETE_SURROUNDING_TEXT:I = 0x50

.field private static final DO_END_BATCH_EDIT:I = 0x5f

.field private static final DO_FINISH_COMPOSING_TEXT:I = 0x41

.field private static final DO_GET_CURSOR_CAPS_MODE:I = 0x1e

.field private static final DO_GET_EXTRACTED_TEXT:I = 0x28

.field private static final DO_GET_SELECTED_TEXT:I = 0x19

.field private static final DO_GET_TEXT_AFTER_CURSOR:I = 0xa

.field private static final DO_GET_TEXT_BEFORE_CURSOR:I = 0x14

.field private static final DO_PERFORM_CONTEXT_MENU_ACTION:I = 0x3b

.field private static final DO_PERFORM_EDITOR_ACTION:I = 0x3a

.field private static final DO_PERFORM_PRIVATE_COMMAND:I = 0x78

.field private static final DO_REPORT_FULLSCREEN_MODE:I = 0x64

.field private static final DO_SEND_KEY_EVENT:I = 0x46

.field private static final DO_SET_COMPOSING_REGION:I = 0x3f

.field private static final DO_SET_COMPOSING_TEXT:I = 0x3c

.field private static final DO_SET_SELECTION:I = 0x39

.field static final TAG:Ljava/lang/String; = "IInputConnectionWrapper"

# instance fields
.field private mH:Landroid/os/Handler;

.field private mInputConnection:Ljava/lang/ref/SoftReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/SoftReference",
            "<",
            "Landroid/view/inputmethod/InputConnection;",
            ">;"
        }
    .end annotation
.end field

.field private mMainLooper:Landroid/os/Looper;

# direct methods
.method public constructor <init>(Landroid/os/Looper;Landroid/view/inputmethod/InputConnection;)V
    .locals 2
    .parameter "mainLooper"
    .parameter "conn"

    .prologue
    .line 81
    invoke-direct {p0}, Lcom/android/internal/view/IInputContext$Stub;-><init>()V

    .line 82
    new-instance v0, Ljava/lang/ref/SoftReference;

    invoke-direct {v0, p2}, Ljava/lang/ref/SoftReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    .line 83
    iput-object p1, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mMainLooper:Landroid/os/Looper;

    .line 84
    new-instance v0, Lcom/android/internal/view/IInputConnectionWrapper$MyHandler;

    iget-object v1, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mMainLooper:Landroid/os/Looper;

    invoke-direct {v0, p0, v1}, Lcom/android/internal/view/IInputConnectionWrapper$MyHandler;-><init>(Lcom/android/internal/view/IInputConnectionWrapper;Landroid/os/Looper;)V

    iput-object v0, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mH:Landroid/os/Handler;

    .line 85
    return-void
.end method

# virtual methods
.method public beginBatchEdit()V
    .locals 1

    .prologue
    .line 163
    const/16 v0, 0x5a

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 164
    return-void
.end method

.method public clearMetaKeyStates(I)V
    .locals 2
    .parameter "states"

    .prologue
    .line 154
    const/16 v0, 0x82

    const/4 v1, 0x0

    invoke-virtual {p0, v0, p1, v1}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageII(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 155
    return-void
.end method

.method public commitCompletion(Landroid/view/inputmethod/CompletionInfo;)V
    .locals 1
    .parameter "text"

    .prologue
    .line 118
    const/16 v0, 0x37

    invoke-virtual {p0, v0, p1}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageO(ILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 119
    return-void
.end method

.method public commitCorrection(Landroid/view/inputmethod/CorrectionInfo;)V
    .locals 1
    .parameter "info"

    .prologue
    .line 122
    const/16 v0, 0x38

    invoke-virtual {p0, v0, p1}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageO(ILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 123
    return-void
.end method

.method public commitText(Ljava/lang/CharSequence;I)V
    .locals 1
    .parameter "text"
    .parameter "newCursorPosition"

    .prologue
    .line 114
    const/16 v0, 0x32

    invoke-virtual {p0, v0, p2, p1}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageIO(IILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 115
    return-void
.end method

.method public deleteSurroundingText(II)V
    .locals 1
    .parameter "leftLength"
    .parameter "rightLength"

    .prologue
    .line 158
    const/16 v0, 0x50

    invoke-virtual {p0, v0, p1, p2}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageII(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 160
    return-void
.end method

.method dispatchMessage(Landroid/os/Message;)V
    .locals 2
    .parameter "msg"

    .prologue
    .line 182
    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v0

    iget-object v1, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mMainLooper:Landroid/os/Looper;

    if-ne v0, v1, :cond_0

    .line 183
    invoke-virtual {p0, p1}, Lcom/android/internal/view/IInputConnectionWrapper;->executeMessage(Landroid/os/Message;)V

    .line 184
    invoke-virtual {p1}, Landroid/os/Message;->recycle()V

    .line 189
    :goto_0
    return-void

    .line 188
    :cond_0
    iget-object v0, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mH:Landroid/os/Handler;

    invoke-virtual {v0, p1}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto :goto_0
.end method

.method public endBatchEdit()V
    .locals 1

    .prologue
    .line 167
    const/16 v0, 0x5f

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 168
    return-void
.end method

.method executeMessage(Landroid/os/Message;)V
    .locals 6
    .parameter "msg"

    .prologue
    const/4 v3, 0x1

    const/4 v4, 0x0

    .line 192
    iget v5, p1, Landroid/os/Message;->what:I

    sparse-switch v5, :sswitch_data_0

    .line 424
    const-string v3, "IInputConnectionWrapper"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Unhandled message code: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget v5, p1, Landroid/os/Message;->what:I

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 425
    :goto_0
    return-void

    .line 194
    :sswitch_0
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;

    .line 196
    .local v0, args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    :try_start_0
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 197
    .local v2, ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_0

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_1

    .line 198
    :cond_0
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "getTextAfterCursor on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 199
    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    const/4 v4, 0x0

    iget v5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    invoke-interface {v3, v4, v5}, Lcom/android/internal/view/IInputContextCallback;->setTextAfterCursor(Ljava/lang/CharSequence;I)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 204
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :catch_0
    move-exception v1

    .line 205
    .local v1, e:Landroid/os/RemoteException;
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "Got RemoteException calling setTextAfterCursor"

    invoke-static {v3, v4, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0

    .line 202
    .end local v1           #e:Landroid/os/RemoteException;
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    :cond_1
    :try_start_1
    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    iget v4, p1, Landroid/os/Message;->arg1:I

    iget v5, p1, Landroid/os/Message;->arg2:I

    invoke-interface {v2, v4, v5}, Landroid/view/inputmethod/InputConnection;->getTextAfterCursor(II)Ljava/lang/CharSequence;

    move-result-object v4

    iget v5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    invoke-interface {v3, v4, v5}, Lcom/android/internal/view/IInputContextCallback;->setTextAfterCursor(Ljava/lang/CharSequence;I)V
    :try_end_1
    .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    .line 210
    .end local v0           #args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_1
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;

    .line 212
    .restart local v0       #args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    :try_start_2
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 213
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_2

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_3

    .line 214
    :cond_2
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "getTextBeforeCursor on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 215
    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    const/4 v4, 0x0

    iget v5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    invoke-interface {v3, v4, v5}, Lcom/android/internal/view/IInputContextCallback;->setTextBeforeCursor(Ljava/lang/CharSequence;I)V
    :try_end_2
    .catch Landroid/os/RemoteException; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_0

    .line 220
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :catch_1
    move-exception v1

    .line 221
    .restart local v1       #e:Landroid/os/RemoteException;
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "Got RemoteException calling setTextBeforeCursor"

    invoke-static {v3, v4, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0

    .line 218
    .end local v1           #e:Landroid/os/RemoteException;
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    :cond_3
    :try_start_3
    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    iget v4, p1, Landroid/os/Message;->arg1:I

    iget v5, p1, Landroid/os/Message;->arg2:I

    invoke-interface {v2, v4, v5}, Landroid/view/inputmethod/InputConnection;->getTextBeforeCursor(II)Ljava/lang/CharSequence;

    move-result-object v4

    iget v5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    invoke-interface {v3, v4, v5}, Lcom/android/internal/view/IInputContextCallback;->setTextBeforeCursor(Ljava/lang/CharSequence;I)V
    :try_end_3
    .catch Landroid/os/RemoteException; {:try_start_3 .. :try_end_3} :catch_1

    goto :goto_0

    .line 226
    .end local v0           #args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_2
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;

    .line 228
    .restart local v0       #args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    :try_start_4
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 229
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_4

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_5

    .line 230
    :cond_4
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "getSelectedText on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 231
    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    const/4 v4, 0x0

    iget v5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    invoke-interface {v3, v4, v5}, Lcom/android/internal/view/IInputContextCallback;->setSelectedText(Ljava/lang/CharSequence;I)V
    :try_end_4
    .catch Landroid/os/RemoteException; {:try_start_4 .. :try_end_4} :catch_2

    goto/16 :goto_0

    .line 236
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :catch_2
    move-exception v1

    .line 237
    .restart local v1       #e:Landroid/os/RemoteException;
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "Got RemoteException calling setSelectedText"

    invoke-static {v3, v4, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto/16 :goto_0

    .line 234
    .end local v1           #e:Landroid/os/RemoteException;
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    :cond_5
    :try_start_5
    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    iget v4, p1, Landroid/os/Message;->arg1:I

    invoke-interface {v2, v4}, Landroid/view/inputmethod/InputConnection;->getSelectedText(I)Ljava/lang/CharSequence;

    move-result-object v4

    iget v5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    invoke-interface {v3, v4, v5}, Lcom/android/internal/view/IInputContextCallback;->setSelectedText(Ljava/lang/CharSequence;I)V
    :try_end_5
    .catch Landroid/os/RemoteException; {:try_start_5 .. :try_end_5} :catch_2

    goto/16 :goto_0

    .line 242
    .end local v0           #args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_3
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;

    .line 244
    .restart local v0       #args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    :try_start_6
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 245
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_6

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_7

    .line 246
    :cond_6
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "getCursorCapsMode on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 247
    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    const/4 v4, 0x0

    iget v5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    invoke-interface {v3, v4, v5}, Lcom/android/internal/view/IInputContextCallback;->setCursorCapsMode(II)V
    :try_end_6
    .catch Landroid/os/RemoteException; {:try_start_6 .. :try_end_6} :catch_3

    goto/16 :goto_0

    .line 252
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :catch_3
    move-exception v1

    .line 253
    .restart local v1       #e:Landroid/os/RemoteException;
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "Got RemoteException calling setCursorCapsMode"

    invoke-static {v3, v4, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto/16 :goto_0

    .line 250
    .end local v1           #e:Landroid/os/RemoteException;
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    :cond_7
    :try_start_7
    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    iget v4, p1, Landroid/os/Message;->arg1:I

    invoke-interface {v2, v4}, Landroid/view/inputmethod/InputConnection;->getCursorCapsMode(I)I

    move-result v4

    iget v5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    invoke-interface {v3, v4, v5}, Lcom/android/internal/view/IInputContextCallback;->setCursorCapsMode(II)V
    :try_end_7
    .catch Landroid/os/RemoteException; {:try_start_7 .. :try_end_7} :catch_3

    goto/16 :goto_0

    .line 258
    .end local v0           #args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_4
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;

    .line 260
    .restart local v0       #args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    :try_start_8
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 261
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_8

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_9

    .line 262
    :cond_8
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "getExtractedText on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 263
    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    const/4 v4, 0x0

    iget v5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    invoke-interface {v3, v4, v5}, Lcom/android/internal/view/IInputContextCallback;->setExtractedText(Landroid/view/inputmethod/ExtractedText;I)V
    :try_end_8
    .catch Landroid/os/RemoteException; {:try_start_8 .. :try_end_8} :catch_4

    goto/16 :goto_0

    .line 268
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :catch_4
    move-exception v1

    .line 269
    .restart local v1       #e:Landroid/os/RemoteException;
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "Got RemoteException calling setExtractedText"

    invoke-static {v3, v4, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto/16 :goto_0

    .line 266
    .end local v1           #e:Landroid/os/RemoteException;
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    :cond_9
    :try_start_9
    iget-object v4, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->arg1:Ljava/lang/Object;

    check-cast v3, Landroid/view/inputmethod/ExtractedTextRequest;

    iget v5, p1, Landroid/os/Message;->arg1:I

    invoke-interface {v2, v3, v5}, Landroid/view/inputmethod/InputConnection;->getExtractedText(Landroid/view/inputmethod/ExtractedTextRequest;I)Landroid/view/inputmethod/ExtractedText;

    move-result-object v3

    iget v5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    invoke-interface {v4, v3, v5}, Lcom/android/internal/view/IInputContextCallback;->setExtractedText(Landroid/view/inputmethod/ExtractedText;I)V
    :try_end_9
    .catch Landroid/os/RemoteException; {:try_start_9 .. :try_end_9} :catch_4

    goto/16 :goto_0

    .line 274
    .end local v0           #args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_5
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 275
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_a

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_b

    .line 276
    :cond_a
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "commitText on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 279
    :cond_b
    iget-object v3, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v3, Ljava/lang/CharSequence;

    iget v4, p1, Landroid/os/Message;->arg1:I

    invoke-interface {v2, v3, v4}, Landroid/view/inputmethod/InputConnection;->commitText(Ljava/lang/CharSequence;I)Z

    goto/16 :goto_0

    .line 283
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_6
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 284
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_c

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_d

    .line 285
    :cond_c
    const-string v3, "IInputConnectionWrapper"

    const-string/jumbo v4, "setSelection on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 288
    :cond_d
    iget v3, p1, Landroid/os/Message;->arg1:I

    iget v4, p1, Landroid/os/Message;->arg2:I

    invoke-interface {v2, v3, v4}, Landroid/view/inputmethod/InputConnection;->setSelection(II)Z

    goto/16 :goto_0

    .line 292
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_7
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 293
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_e

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_f

    .line 294
    :cond_e
    const-string v3, "IInputConnectionWrapper"

    const-string/jumbo v4, "performEditorAction on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 297
    :cond_f
    iget v3, p1, Landroid/os/Message;->arg1:I

    invoke-interface {v2, v3}, Landroid/view/inputmethod/InputConnection;->performEditorAction(I)Z

    goto/16 :goto_0

    .line 301
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_8
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 302
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_10

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_11

    .line 303
    :cond_10
    const-string v3, "IInputConnectionWrapper"

    const-string/jumbo v4, "performContextMenuAction on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 306
    :cond_11
    iget v3, p1, Landroid/os/Message;->arg1:I

    invoke-interface {v2, v3}, Landroid/view/inputmethod/InputConnection;->performContextMenuAction(I)Z

    goto/16 :goto_0

    .line 310
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_9
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 311
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_12

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_13

    .line 312
    :cond_12
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "commitCompletion on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 315
    :cond_13
    iget-object v3, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v3, Landroid/view/inputmethod/CompletionInfo;

    invoke-interface {v2, v3}, Landroid/view/inputmethod/InputConnection;->commitCompletion(Landroid/view/inputmethod/CompletionInfo;)Z

    goto/16 :goto_0

    .line 319
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_a
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 320
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_14

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_15

    .line 321
    :cond_14
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "commitCorrection on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 324
    :cond_15
    iget-object v3, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v3, Landroid/view/inputmethod/CorrectionInfo;

    invoke-interface {v2, v3}, Landroid/view/inputmethod/InputConnection;->commitCorrection(Landroid/view/inputmethod/CorrectionInfo;)Z

    goto/16 :goto_0

    .line 328
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_b
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 329
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_16

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_17

    .line 330
    :cond_16
    const-string v3, "IInputConnectionWrapper"

    const-string/jumbo v4, "setComposingText on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 333
    :cond_17
    iget-object v3, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v3, Ljava/lang/CharSequence;

    iget v4, p1, Landroid/os/Message;->arg1:I

    invoke-interface {v2, v3, v4}, Landroid/view/inputmethod/InputConnection;->setComposingText(Ljava/lang/CharSequence;I)Z

    goto/16 :goto_0

    .line 337
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_c
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 338
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_18

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_19

    .line 339
    :cond_18
    const-string v3, "IInputConnectionWrapper"

    const-string/jumbo v4, "setComposingRegion on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 342
    :cond_19
    iget v3, p1, Landroid/os/Message;->arg1:I

    iget v4, p1, Landroid/os/Message;->arg2:I

    invoke-interface {v2, v3, v4}, Landroid/view/inputmethod/InputConnection;->setComposingRegion(II)Z

    goto/16 :goto_0

    .line 346
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_d
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 351
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-nez v2, :cond_1a

    .line 352
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "finishComposingText on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 355
    :cond_1a
    invoke-interface {v2}, Landroid/view/inputmethod/InputConnection;->finishComposingText()Z

    goto/16 :goto_0

    .line 359
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_e
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 360
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_1b

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_1c

    .line 361
    :cond_1b
    const-string v3, "IInputConnectionWrapper"

    const-string/jumbo v4, "sendKeyEvent on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 364
    :cond_1c
    iget-object v3, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v3, Landroid/view/KeyEvent;

    invoke-interface {v2, v3}, Landroid/view/inputmethod/InputConnection;->sendKeyEvent(Landroid/view/KeyEvent;)Z

    goto/16 :goto_0

    .line 368
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_f
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 369
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_1d

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_1e

    .line 370
    :cond_1d
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "clearMetaKeyStates on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 373
    :cond_1e
    iget v3, p1, Landroid/os/Message;->arg1:I

    invoke-interface {v2, v3}, Landroid/view/inputmethod/InputConnection;->clearMetaKeyStates(I)Z

    goto/16 :goto_0

    .line 377
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_10
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 378
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_1f

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_20

    .line 379
    :cond_1f
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "deleteSurroundingText on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 382
    :cond_20
    iget v3, p1, Landroid/os/Message;->arg1:I

    iget v4, p1, Landroid/os/Message;->arg2:I

    invoke-interface {v2, v3, v4}, Landroid/view/inputmethod/InputConnection;->deleteSurroundingText(II)Z

    goto/16 :goto_0

    .line 386
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_11
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 387
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_21

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_22

    .line 388
    :cond_21
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "beginBatchEdit on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 391
    :cond_22
    invoke-interface {v2}, Landroid/view/inputmethod/InputConnection;->beginBatchEdit()Z

    goto/16 :goto_0

    .line 395
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_12
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 396
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_23

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_24

    .line 397
    :cond_23
    const-string v3, "IInputConnectionWrapper"

    const-string v4, "endBatchEdit on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 400
    :cond_24
    invoke-interface {v2}, Landroid/view/inputmethod/InputConnection;->endBatchEdit()Z

    goto/16 :goto_0

    .line 404
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_13
    iget-object v5, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v5}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 405
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_25

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v5

    if-nez v5, :cond_26

    .line 406
    :cond_25
    const-string v3, "IInputConnectionWrapper"

    const-string/jumbo v4, "showStatusIcon on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 409
    :cond_26
    iget v5, p1, Landroid/os/Message;->arg1:I

    if-ne v5, v3, :cond_27

    :goto_1
    invoke-interface {v2, v3}, Landroid/view/inputmethod/InputConnection;->reportFullscreenMode(Z)Z

    goto/16 :goto_0

    :cond_27
    move v3, v4

    goto :goto_1

    .line 413
    .end local v2           #ic:Landroid/view/inputmethod/InputConnection;
    :sswitch_14
    iget-object v3, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Ljava/lang/ref/SoftReference;

    invoke-virtual {v3}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputConnection;

    .line 414
    .restart local v2       #ic:Landroid/view/inputmethod/InputConnection;
    if-eqz v2, :cond_28

    invoke-virtual {p0}, Lcom/android/internal/view/IInputConnectionWrapper;->isActive()Z

    move-result v3

    if-nez v3, :cond_29

    .line 415
    :cond_28
    const-string v3, "IInputConnectionWrapper"

    const-string/jumbo v4, "performPrivateCommand on inactive InputConnection"

    invoke-static {v3, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 418
    :cond_29
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;

    .line 419
    .restart local v0       #args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    iget-object v3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->arg1:Ljava/lang/Object;

    check-cast v3, Ljava/lang/String;

    iget-object v4, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->arg2:Ljava/lang/Object;

    check-cast v4, Landroid/os/Bundle;

    invoke-interface {v2, v3, v4}, Landroid/view/inputmethod/InputConnection;->performPrivateCommand(Ljava/lang/String;Landroid/os/Bundle;)Z

    goto/16 :goto_0

    .line 192
    :sswitch_data_0
    .sparse-switch
        0xa -> :sswitch_0
        0x14 -> :sswitch_1
        0x19 -> :sswitch_2
        0x1e -> :sswitch_3
        0x28 -> :sswitch_4
        0x32 -> :sswitch_5
        0x37 -> :sswitch_9
        0x38 -> :sswitch_a
        0x39 -> :sswitch_6
        0x3a -> :sswitch_7
        0x3b -> :sswitch_8
        0x3c -> :sswitch_b
        0x3f -> :sswitch_c
        0x41 -> :sswitch_d
        0x46 -> :sswitch_e
        0x50 -> :sswitch_10
        0x5a -> :sswitch_11
        0x5f -> :sswitch_12
        0x64 -> :sswitch_13
        0x78 -> :sswitch_14
        0x82 -> :sswitch_f
    .end sparse-switch
.end method

.method public finishComposingText()V
    .locals 1

    .prologue
    .line 146
    const/16 v0, 0x41

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 147
    return-void
.end method

.method public getCursorCapsMode(IILcom/android/internal/view/IInputContextCallback;)V
    .locals 1
    .parameter "reqModes"
    .parameter "seq"
    .parameter "callback"

    .prologue
    .line 104
    const/16 v0, 0x1e

    invoke-virtual {p0, v0, p1, p2, p3}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageISC(IIILcom/android/internal/view/IInputContextCallback;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 105
    return-void
.end method

.method public getExtractedText(Landroid/view/inputmethod/ExtractedTextRequest;IILcom/android/internal/view/IInputContextCallback;)V
    .locals 6
    .parameter "request"
    .parameter "flags"
    .parameter "seq"
    .parameter "callback"

    .prologue
    .line 109
    const/16 v1, 0x28

    move-object v0, p0

    move v2, p2

    move-object v3, p1

    move v4, p3

    move-object v5, p4

    invoke-virtual/range {v0 .. v5}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageIOSC(IILjava/lang/Object;ILcom/android/internal/view/IInputContextCallback;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 111
    return-void
.end method

.method public getSelectedText(IILcom/android/internal/view/IInputContextCallback;)V
    .locals 1
    .parameter "flags"
    .parameter "seq"
    .parameter "callback"

    .prologue
    .line 100
    const/16 v0, 0x19

    invoke-virtual {p0, v0, p1, p2, p3}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageISC(IIILcom/android/internal/view/IInputContextCallback;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 101
    return-void
.end method

.method public getTextAfterCursor(IIILcom/android/internal/view/IInputContextCallback;)V
    .locals 6
    .parameter "length"
    .parameter "flags"
    .parameter "seq"
    .parameter "callback"

    .prologue
    .line 92
    const/16 v1, 0xa

    move-object v0, p0

    move v2, p1

    move v3, p2

    move v4, p3

    move-object v5, p4

    invoke-virtual/range {v0 .. v5}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageIISC(IIIILcom/android/internal/view/IInputContextCallback;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 93
    return-void
.end method

.method public getTextBeforeCursor(IIILcom/android/internal/view/IInputContextCallback;)V
    .locals 6
    .parameter "length"
    .parameter "flags"
    .parameter "seq"
    .parameter "callback"

    .prologue
    .line 96
    const/16 v1, 0x14

    move-object v0, p0

    move v2, p1

    move v3, p2

    move v4, p3

    move-object v5, p4

    invoke-virtual/range {v0 .. v5}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageIISC(IIIILcom/android/internal/view/IInputContextCallback;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 97
    return-void
.end method

.method public isActive()Z
    .locals 1

    .prologue
    .line 88
    const/4 v0, 0x1

    return v0
.end method

.method obtainMessage(I)Landroid/os/Message;
    .locals 1
    .parameter "what"

    .prologue
    .line 428
    iget-object v0, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mH:Landroid/os/Handler;

    invoke-virtual {v0, p1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    return-object v0
.end method

.method obtainMessageII(III)Landroid/os/Message;
    .locals 1
    .parameter "what"
    .parameter "arg1"
    .parameter "arg2"

    .prologue
    .line 432
    iget-object v0, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mH:Landroid/os/Handler;

    invoke-virtual {v0, p1, p2, p3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;

    move-result-object v0

    return-object v0
.end method

.method obtainMessageIISC(IIIILcom/android/internal/view/IInputContextCallback;)Landroid/os/Message;
    .locals 2
    .parameter "what"
    .parameter "arg1"
    .parameter "arg2"
    .parameter "seq"
    .parameter "callback"

    .prologue
    .line 447
    new-instance v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;

    invoke-direct {v0}, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;-><init>()V

    .line 448
    .local v0, args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    iput-object p5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    .line 449
    iput p4, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    .line 450
    iget-object v1, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mH:Landroid/os/Handler;

    invoke-virtual {v1, p1, p2, p3, v0}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v1

    return-object v1
.end method

.method obtainMessageIO(IILjava/lang/Object;)Landroid/os/Message;
    .locals 2
    .parameter "what"
    .parameter "arg1"
    .parameter "arg2"

    .prologue
    .line 463
    iget-object v0, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mH:Landroid/os/Handler;

    const/4 v1, 0x0

    invoke-virtual {v0, p1, p2, v1, p3}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    return-object v0
.end method

.method obtainMessageIOSC(IILjava/lang/Object;ILcom/android/internal/view/IInputContextCallback;)Landroid/os/Message;
    .locals 3
    .parameter "what"
    .parameter "arg1"
    .parameter "arg2"
    .parameter "seq"
    .parameter "callback"

    .prologue
    .line 455
    new-instance v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;

    invoke-direct {v0}, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;-><init>()V

    .line 456
    .local v0, args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    iput-object p3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->arg1:Ljava/lang/Object;

    .line 457
    iput-object p5, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    .line 458
    iput p4, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    .line 459
    iget-object v1, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mH:Landroid/os/Handler;

    const/4 v2, 0x0

    invoke-virtual {v1, p1, p2, v2, v0}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v1

    return-object v1
.end method

.method obtainMessageISC(IIILcom/android/internal/view/IInputContextCallback;)Landroid/os/Message;
    .locals 3
    .parameter "what"
    .parameter "arg1"
    .parameter "seq"
    .parameter "callback"

    .prologue
    .line 440
    new-instance v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;

    invoke-direct {v0}, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;-><init>()V

    .line 441
    .local v0, args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    iput-object p4, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->callback:Lcom/android/internal/view/IInputContextCallback;

    .line 442
    iput p3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->seq:I

    .line 443
    iget-object v1, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mH:Landroid/os/Handler;

    const/4 v2, 0x0

    invoke-virtual {v1, p1, p2, v2, v0}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v1

    return-object v1
.end method

.method obtainMessageO(ILjava/lang/Object;)Landroid/os/Message;
    .locals 2
    .parameter "what"
    .parameter "arg1"

    .prologue
    const/4 v1, 0x0

    .line 436
    iget-object v0, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mH:Landroid/os/Handler;

    invoke-virtual {v0, p1, v1, v1, p2}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    return-object v0
.end method

.method obtainMessageOO(ILjava/lang/Object;Ljava/lang/Object;)Landroid/os/Message;
    .locals 3
    .parameter "what"
    .parameter "arg1"
    .parameter "arg2"

    .prologue
    const/4 v2, 0x0

    .line 467
    new-instance v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;

    invoke-direct {v0}, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;-><init>()V

    .line 468
    .local v0, args:Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;
    iput-object p2, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->arg1:Ljava/lang/Object;

    .line 469
    iput-object p3, v0, Lcom/android/internal/view/IInputConnectionWrapper$SomeArgs;->arg2:Ljava/lang/Object;

    .line 470
    iget-object v1, p0, Lcom/android/internal/view/IInputConnectionWrapper;->mH:Landroid/os/Handler;

    invoke-virtual {v1, p1, v2, v2, v0}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v1

    return-object v1
.end method

.method public performContextMenuAction(I)V
    .locals 2
    .parameter "id"

    .prologue
    .line 134
    const/16 v0, 0x3b

    const/4 v1, 0x0

    invoke-virtual {p0, v0, p1, v1}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageII(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 135
    return-void
.end method

.method public performEditorAction(I)V
    .locals 2
    .parameter "id"

    .prologue
    .line 130
    const/16 v0, 0x3a

    const/4 v1, 0x0

    invoke-virtual {p0, v0, p1, v1}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageII(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 131
    return-void
.end method

.method public performPrivateCommand(Ljava/lang/String;Landroid/os/Bundle;)V
    .locals 1
    .parameter "action"
    .parameter "data"

    .prologue
    .line 175
    const/16 v0, 0x78

    invoke-virtual {p0, v0, p1, p2}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageOO(ILjava/lang/Object;Ljava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 176
    return-void
.end method

.method public reportFullscreenMode(Z)V
    .locals 3
    .parameter "enabled"

    .prologue
    const/4 v1, 0x0

    .line 171
    const/16 v2, 0x64

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    :goto_0
    invoke-virtual {p0, v2, v0, v1}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageII(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 172
    return-void

    :cond_0
    move v0, v1

    .line 171
    goto :goto_0
.end method

.method public sendKeyEvent(Landroid/view/KeyEvent;)V
    .locals 1
    .parameter "event"

    .prologue
    .line 150
    const/16 v0, 0x46

    invoke-virtual {p0, v0, p1}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageO(ILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 151
    return-void
.end method

.method public setComposingRegion(II)V
    .locals 1
    .parameter "start"
    .parameter "end"

    .prologue
    .line 138
    const/16 v0, 0x3f

    invoke-virtual {p0, v0, p1, p2}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageII(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 139
    return-void
.end method

.method public setComposingText(Ljava/lang/CharSequence;I)V
    .locals 1
    .parameter "text"
    .parameter "newCursorPosition"

    .prologue
    .line 142
    const/16 v0, 0x3c

    invoke-virtual {p0, v0, p2, p1}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageIO(IILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 143
    return-void
.end method

.method public setSelection(II)V
    .locals 1
    .parameter "start"
    .parameter "end"

    .prologue
    .line 126
    const/16 v0, 0x39

    invoke-virtual {p0, v0, p1, p2}, Lcom/android/internal/view/IInputConnectionWrapper;->obtainMessageII(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/android/internal/view/IInputConnectionWrapper;->dispatchMessage(Landroid/os/Message;)V

    .line 127
    return-void
.end method


text:
namespace opentitan {
namespace spiflash {

// Implements the bootstrap SPI frame message.
struct Frame {
  // Frame header definition.
  struct {
    // SHA2 of the entire frame_t message starting at the |frame_num| offset.
    uint8_t hash[32];

    // Frame number. Starting at 0.
    uint32_t frame_num;

    // Flash target offset.
    uint32_t offset;
  } hdr;

  uint8_t data[1024 - sizeof(hdr)];

  // Returns available the frame available payload size in bytes.
  size_t PayloadSize() const { return 1024 - sizeof(hdr); }
};

// Implements SPI flash update protocol.
//
// The firmare image is split into frames, and then sent to the SPI device.
// More details will be added on the ack protocol once implemented.
// This class is not thread safe due to the spi driver dependency.
class Updater {
 public:
  // Updater configuration settings.
  struct Options {
    // Firmware image in binary format.
    std::string code;
  };

  // Constructs updater instance with given configuration |options| and |spi|
  // interface.
  Updater(Options options, std::unique_ptr<SpiInterface> spi)
      : options_(options), spi_(std::move(spi)) {}
  virtual ~Updater() = default;

  // Not copy or movable
  Updater(const Updater &) = delete;
  Updater &operator=(const Updater &) = delete;

  // Runs update flow returning true on success.
  bool Run();

 private:
  // Generates |frames| for |code| image.
  bool GenerateFrames(const std::string &code, std::vector<Frame> *frames);

  Options options_;
  std::unique_ptr<SpiInterface> spi_;
};

}  // namespace spiflash
}  // namespace opentitan

#endif  // OPENTITAN_SW_HOST_SPIFLASH_UPDATER_H_

redpajama_set_name: RedPajamaGithub


text:
'''
For processing MARC/XML
Uses SAX for streaming process
Notice however, possible security vulnerabilities:
https://docs.python.org/3/library/xml.html#xml-vulnerabilities
'''

import json
import logging

from xml import sax
#from xml.sax.handler import ContentHandler
#from xml.sax.saxutils import XMLGenerator

#from bibframe.contrib.xmlutil import normalize_text_filter
from bibframe.reader.marc import LEADER, CONTROLFIELD, DATAFIELD

import rdflib

from versa import I, VERSA_BASEIRI
from versa import util
from versa.driver import memory

from bibframe import BFZ, BFLC, register_service
from bibframe.reader import marc
from bibframe.writer import rdf

BFNS = rdflib.Namespace(BFZ)
BFCNS = rdflib.Namespace(BFZ + 'cftag/')
BFDNS = rdflib.Namespace(BFZ + 'dftag/')
VNS = rdflib.Namespace(VERSA_BASEIRI)

MARCXML_NS = "http://www.loc.gov/MARC21/slim"

#Subclass from ContentHandler in order to gain default behaviors
class marcxmlhandler(sax.ContentHandler):
    def __init__(self, sink, *args, **kwargs):
        self._sink = sink
        self._getcontent = False
        sax.ContentHandler.__init__(self, *args, **kwargs)

    def startElementNS(self, name, qname, attributes):
        (ns, local) = name
        if ns == MARCXML_NS:
            #if local == u'collection':
            #    return
            if local == u'record':
                self._record = []
            elif local == u'leader':
                self._chardata_dest = [LEADER, u'']
                self._record.append(self._chardata_dest)
                self._getcontent = True
            elif local == u'controlfield':
                self._chardata_dest = [CONTROLFIELD, attributes[None, u'tag'], u'']
                self._record.append(self._chardata_dest)
                self._getcontent = True
            elif local == u'datafield':
                self._record.append([DATAFIELD, attributes[None, u'tag'], attributes.copy(), []])
            elif local == u'subfield':
                self._chardata_dest = [attributes[None, u'code'], u'']
                self._record[-1][3].append(self._chardata_dest)
                self._getcontent = True
        return

    def characters(self, data):
        if self._getcontent:
            self._chardata_dest[-1] += data

    def endElementNS(self, name, qname):
        (ns, local) = name
        if ns == MARCXML_NS:
            if local == u'record':
                try:
                    self._sink.send(self._record)
                except StopIteration:
                    #Handler coroutine has declined to process more records. Perhaps it's hit a limit
                    #FIXME would be nice to throw some sort of signal to setp parse. Or...we should maybe rearchitect the event architecture (easier when we've evolved beyond SAX) :)
                    pass
            elif local in (u'leader', u'controlfield', u'subfield'):
                self._getcontent = False
        return

def parse_marcxml(inp, sink):
    '''
    Parse a MARC/XML document and yield each record's data
    '''
    parser = sax.make_parser()
    #parser.setContentHandler(marcxmlhandler(receive_recs()))
    parser.setFeature(sax.handler.feature_namespaces, 1)

    #downstream_handler = marcxmlhandler(receive_recs())
    #upstream, the parser, downstream, the next handler in the chain
    #parser.setContentHandler(downstream_handler)
    #normparser = normalize_text_filter(parser)
    #normparser.parse(inp)

    handler = marcxmlhandler(sink)
    #upstream, the parser, downstream, the next handler in the chain
    parser.setContentHandler(handler)
    parser.parse(inp)

def bfconvert(inputs=None, base=None, out=None, limit=None, rdfttl=None, config=None, verbose=False, mods=None):
    '''
    inputs - One or more MARC/XML files to be parsed and converted to BIBFRAME RDF
    out - file where raw Versa JSON dump output should be written (default: write to stdout)
    rdfttl - file where RDF Turtle output should be written
    config - file containing config in JSON format
    stats - file where statistics output should be written in JSON format
    limit - Limit the number of records processed to this number. If omitted, all records will be processed.
    base - Base IRI to be used for creating resources.
    mod - Python module to be imported in order to register plugins.
    verbose - If true show additional messages and information (default: False)
    '''
    if config is None:
        config = {}
    else:
        config = json.load(config)
    logger = logging.getLogger('marc2bfrdf')
    if verbose:
        logger.setLevel(logging.DEBUG)

    for mod in mods or []:
        __import__(mod, globals(), locals(), [])
    from bibframe import g_services

    #if stats:
    #    register_service(statsgen.statshandler)

    if limit is not None:
        try:
            limit = int(limit)
        except ValueError:
            logger.debug('Limit must be a number, not "{0}". Ignoring.'.format(limit))

    ids = marc.idgen(base)
    m = memory.connection()
    g = rdflib.Graph()
    g.bind('bf', BFNS)
    g.bind('bfc', BFCNS)
    g.bind('bfd', BFDNS)
    g.bind('v', VNS)

    def postprocess(rec):
        #No need to bother with Versa -> RDF translation if we were not asked to generate Turtle
        if rdfttl is not None: rdf.process(m, g, logger=logger)
        m.create_space()

    #Initialize auxiliary services (i.e. plugins)
    plugins = []
    for pc in config.get(u'plugins', []):
        try:
            plugins.append(g_services[pc[u'id']](
                config=pc,
                logger=logger,
            )
            )
        except KeyError:
            raise Exception(u'Unknown plugin {0}'.format(pc[u'id']))

    limiting = [0, limit]
    for inf in inputs:
        sink = marc.record_handler(m, idbase=base, limiting=limiting, plugins=plugins, ids=ids, postprocess=postprocess, out=out, logger=logger)
        parse_marcxml(inf, sink)

    if rdfttl is not None: rdfttl.write(g.serialize(format="turtle"))
    for plugin in plugins:
        plugin.close()
    return


text:
//  This file is part of gen-mdl - A Source code generator for model definitions.
//  Copyright (c) angrifel

//  Permission is hereby granted, free of charge, to any person obtaining a copy of
//  this software and associated documentation files (the "Software"), to deal in
//  the Software without restriction, including without limitation the rights to
//  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
//  of the Software, and to permit persons to whom the Software is furnished to do
//  so, subject to the following conditions:

//  The above copyright notice and this permission notice shall be included in all
//  copies or substantial portions of the Software.

//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//  SOFTWARE.

namespace ModelGenerator
{
  using System.Collections.Generic;
  using System.Collections.Specialized;
  using System.Linq;

  public class OrderedDictionary<TKey, TValue> : OrderedDictionary, IDictionary<TKey, TValue>
  {
    public TValue this[TKey key]
    {
      get { return (TValue)base[key]; }
      set { base[key] = value; }
    }

    ICollection<TKey> IDictionary<TKey, TValue>.Keys
    {
      get
      {
        var result = new List<TKey>(base.Keys.Count);
        foreach (var key in base.Keys)
        {
          result.Add((TKey)key);
        }

        return result;
      }
    }

    ICollection<TValue> IDictionary<TKey, TValue>.Values
    {
      get
      {
        var result = new List<TValue>(base.Values.Count);
        foreach (var value in base.Values)
        {
          result.Add((TValue)value);
        }

        return result;
      }
    }

    public void Add(KeyValuePair<TKey, TValue> item) => base.Add(item.Key, item.Value);

    public void Add(TKey key, TValue value) => base.Add(key, value);

    public bool Contains(KeyValuePair<TKey, TValue> item) => base.Contains(item.Key) && base.Values.Cast<TValue>().Contains(item.Value);

    public bool ContainsKey(TKey key) => base.Contains(key);

    public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
    {
      // NOTE: do not use base.CopyTo(Array array, int index). Items are not copied in order.

      var i = arrayIndex;
      foreach (var item in (IEnumerable<KeyValuePair<TKey, TValue>>)this)
      {
        if (i >= array.Length + arrayIndex) break;
        array[i++] = item;
      }
    }

    public bool Remove(KeyValuePair<TKey, TValue> item)
    {
      if (Contains(item))
      {
        base.Remove(item.Key);
        return true;
      }

      return false;
    }

    public bool Remove(TKey key)
    {
      if (base.Contains(key))
      {
        base.Remove(key);
        return true;
      }

      return false;
    }

    public bool TryGetValue(TKey key, out TValue value)
    {
      if (base.Contains(key))
      {
        value = (TValue)base[key];
        return true;
      }

      value = default(TValue);
      return false;
    }

    IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
    {
      foreach (var key in base.Keys)
      {
        yield return new KeyValuePair<TKey, TValue>((TKey)key, (TValue)base[key]);
      }
    }
  }
}


text:
require 'active_admin/seo/view_helpers'

module ActiveAdmin
  module Seo
    class Engine < ::Rails::Engine
      engine_name 'activeadmin_seo'

      initializer "Helpers" do
        ActionView::Base.send :include, ActiveAdmin::Seo::ViewHelpers
      end

      initializer "precompile hook", group: :all do |app|
        app.config.assets.precompile += ["active_admin/seo.css"]
      end

      initializer "add assets" do
        ActiveAdmin.application.register_stylesheet "active_admin/seo.css"
      end
    end
  end
end


text:
package com.google.sampling.experiential.server;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.oauth.OAuthRequestException;
import com.google.appengine.api.oauth.OAuthServiceFactory;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.google.appengine.api.utils.SystemProperty;

public class AuthUtil {
  private static final String EMAIL_SCOPE = "https://www.googleapis.com/auth/userinfo.email";

  private AuthUtil() {

  }

  public static User getWhoFromLogin() {
      UserService userService = UserServiceFactory.getUserService();
      User currentUser = userService.getCurrentUser();
      if (currentUser == null) {
        try {
          currentUser = OAuthServiceFactory.getOAuthService().getCurrentUser(EMAIL_SCOPE);
        } catch (OAuthRequestException e) {
          e.printStackTrace();
        }
      }
      return currentUser;
  }

  public static void redirectUserToLogin(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    resp.sendRedirect(UserServiceFactory.getUserService().createLoginURL(req.getRequestURI()));
  }

  public static boolean isUserAdmin() {
    try {
      return UserServiceFactory.getUserService().isUserAdmin() || OAuthServiceFactory.getOAuthService().isUserAdmin();
    } catch (OAuthRequestException e) {
      e.printStackTrace();
      return false;
    }
  }

  public static String getEmailOfUser(HttpServletRequest req, User user) {
    String email = user != null ? user.getEmail() : null;
    if (email == null) {
      throw new IllegalArgumentException("User not logged in");
    }
    if (isDevInstance(req)) {
      if ("example@example.com".equalsIgnoreCase(email)) {
        //throw new IllegalArgumentException("You need to specify a test acct to return when testing mobile clients.");
        // uncomment the line below and put in the test acct. This is necessary because the dev appengine server
        // only returns example@example.com as the user!!
        return "bobevans999@gmail.com";
      } else {
        User currentUser = UserServiceFactory.getUserService().getCurrentUser();
        if (currentUser != null) {
          return currentUser.getEmail().toLowerCase();
        } else {
          return null;
        }
      }
    }
    return email.toLowerCase();
  }

  public static boolean isDevInstance(HttpServletRequest req) {
    return SystemProperty.environment.value() == SystemProperty.Environment.Value.Development;
  }

}


text:
package com.github.maven_nar.cpptasks;
/**
 * A description of a file built or to be built
 */
public final class TargetHistory {
    private/* final */String config;
    private/* final */String output;
    private/* final */long outputLastModified;
    private/* final */SourceHistory[] sources;
    /**
     * Constructor from build step
     */
    public TargetHistory(String config, String output, long outputLastModified,
            SourceHistory[] sources) {
        if (config == null) {
            throw new NullPointerException("config");
        }
        if (sources == null) {
            throw new NullPointerException("source");
        }
        if (output == null) {
            throw new NullPointerException("output");
        }
        this.config = config;
        this.output = output;
        this.outputLastModified = outputLastModified;
        this.sources = (SourceHistory[]) sources.clone();
    }
    public String getOutput() {
        return output;
    }
    public long getOutputLastModified() {
        return outputLastModified;
    }
    public String getProcessorConfiguration() {
        return config;
    }
    public SourceHistory[] getSources() {
        SourceHistory[] clone = (SourceHistory[]) sources.clone();
        return clone;
    }
}


text:
import unittest

from soap.parser import parse
from soap.program.graph import DependenceGraph
from soap.semantics import flow_to_meta_state
from soap.semantics.functions.label import label
from soap.semantics.label import Label
from soap.semantics.state import BoxState


text:
package com.sonar.maven.it.suite;

import com.sonar.maven.it.ItUtils;
import com.sonar.orchestrator.build.BuildResult;
import com.sonar.orchestrator.build.MavenBuild;
import org.junit.Before;
import org.junit.Test;
import org.sonar.wsclient.services.Resource;
import org.sonar.wsclient.services.ResourceQuery;

import static org.fest.assertions.Assertions.assertThat;

/**
 * One language per module
 *
 */
public class OldMultiLanguageTest extends AbstractMavenTest {

  @Before
  public void cleanDatabase() {
    orchestrator.resetData();
  }

  @Test
  public void test_maven_inspection() {
    MavenBuild build = MavenBuild
      .create(ItUtils.locateProjectPom("batch/multi-languages"))
      .setProperty("sonar.profile.java", "empty")
      .setProperty("sonar.profile.js", "empty")
      .setProperty("sonar.profile.py", "empty")
      .setGoals(cleanSonarGoal())
      .setDebugLogs(true);
    BuildResult result = orchestrator.executeBuild(build);

    // SONAR-4515
    assertThat(result.getLogs()).contains("Available languages:");
    assertThat(result.getLogs()).contains("JavaScript => \"js\"");
    assertThat(result.getLogs()).contains("Python => \"py\"");
    assertThat(result.getLogs()).contains("Java => \"java\"");

    // modules
    Resource javaModule = getResource("com.sonarsource.it.projects.batch.multi-languages:java-module", "files");
    Resource jsModule = getResource("com.sonarsource.it.projects.batch.multi-languages:javascript-module", "files");
    Resource pyModule = getResource("com.sonarsource.it.projects.batch.multi-languages:python-module", "files");
    verifyModule(javaModule, 1, "java");
    verifyModule(jsModule, 1, "js");
    verifyModule(pyModule, 2, "py");

    // project
    Resource project = getResource("com.sonarsource.it.projects.batch.multi-languages:multi-languages", "files");
    verifyProject(project);
  }

  private void verifyModule(Resource module, int files, String lang) {
    assertThat(module.getMeasureIntValue("files")).isEqualTo(files);
    if (orchestrator.getServer().version().isGreaterThanOrEquals("4.2")) {
      assertThat(module.getLanguage()).isNull();
    } else {
      assertThat(module.getLanguage()).isEqualTo(lang);
    }
  }

  private void verifyProject(Resource project) {
    verifyModule(project, 4, "java");
  }

  private Resource getResource(String resourceKey, String metricKey) {
    return orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics(resourceKey, metricKey));
  }
}


text:
'use strict';

console.log('logentries extension loaded');

function hide_toaster_on_display(){

  window.toaster = setInterval(function() {
    var $toaster = $('#le-in-app-toaster-bottom');
    console.log($toaster.size())
    if ($toaster.size() > 0) {
      $toaster.hide();
      window.clearInterval(window.toaster);
    }
  }, 200);
}

function hide_sidebar(){

  document.getElementById('sidebarbutton-transparent').click();

  $('#page').css('padding-left', '0px');
  $('.principal').fadeOut();
  $('#sidebarbutton').css('margin-left', '0px');
  $('#sidebarbutton-transparent').css('margin-left', '0px');
  $('#page-heading').css('borderLeft', '2px');
}

function hide_leftnav(){
  console.log('hide leftnav');
  $('.principal').fadeOut();
  $('#sidebar-log-selector').css('margin-left', '0');
  $('.ls-heading').css('margin-left', '0');

  $('#page-heading').css('borderLeft', '2px');

}
function show_leftnav(){
  console.log('show leftnav');
  $('.principal').fadeIn();
  $('#sidebar-log-selector').css('margin-left', '60px');
  $('.ls-heading').css('margin-left', '60px');
}

function hide_timeline(){
  $('#new-timeline-content').hide();
  $("#main-heading-menu").parents('div.ui-tabs').hide();
  $("#page-entries-navigation").css('margin-top', '2px' );
}

function hide_searchbar(){
  $(".validation_text").hide().siblings('span').hide();
  $(".search-toogle-mode").hide();//.css({ position: 'absolute', top: '44px', right: '290px' }).hide();
  $(".timesearch-baseline").css('marginTop', '-5px');
}

function pretty_topnav(){
  $('.v5-breadcrumb').after($(".ui-tabs"));
 // $("#page-entries-navigation").css('margin-top', '2px' );
}

function pretty_content(){
	$(".events-panel").css({  paddingLeft: 0, marginTop: 0, paddingTop: 0});
	$("#main-content-separator").css('height', '110px');
  $("#new-log-events-panel").css('paddingTop', '150px');

	$(".tree-selector-searcher").hide();
}

function width_live_tail(){
	$('.events-panel').css({ marginRight: 0 });
}

function check_loaded(fn){
  window.check_loaded = setInterval(function(){
    if(document.readyState == 'complete'){
      window.clearInterval(window.check_loaded);
      fn();
    }
  }, 500);
}

check_loaded(function(){

  hide_toaster_on_display();
  hide_timeline();
  pretty_topnav();
  hide_sidebar();
  pretty_content();
  width_live_tail();
  hide_searchbar();

  $('#sidebarbutton-transparent').click(function(){
    if(!$(this).is($('.log-selector-open'))){
      hide_leftnav();
    }else {
      show_leftnav();
    }
  });

  $(window).on('hashchange', function() {
    hide_timeline();
  });

  $('.heading-menu-list-item-param-tl').click(function(){
      //if($(this).is( $('.v5-active'))){
		  pretty_content();
		  width_live_tail();
		  //}
  });

});


text:
package hu.akarnokd.rxjava2.debug.multihook;

import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicReference;

import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.*;
import io.reactivex.internal.functions.ObjectHelper;

/**
 * Manages an array of handlers.
 *
 * @param <H> the handler type
 * @since 0.18.0
 */
public class MultiHandlerManager<H> {

    /**
     * The copy-on-write registry of handlers wrapped into a HandlerRegistration container
     * to support disposing/unregistering a particular registration.
     */
    protected final CopyOnWriteArrayList<HandlerRegistration<H>> handlers;

    /**
     * Constructs an empty handler manager.
     */
    public MultiHandlerManager() {
        handlers = new CopyOnWriteArrayList<HandlerRegistration<H>>();
    }

    /**
     * Registers the specified handler instance with this MultiHandlerManager.
     *

     * Handlers don't have to be unique instances, if the same handler is
     * registered multiple times, it will be invoked multiple times as well.
     *

     * This method is threadsafe.
     * @param handler the handler to register
     * @return the Disposable instance to unregister the handler.
     */
    @NonNull
    public final Disposable register(@NonNull H handler) {
        ObjectHelper.requireNonNull(handler, "handler is null");
        HandlerRegistration<H> hr = new HandlerRegistration<H>(this, handler);
        handlers.add(hr);
        return hr;
    }

    final void unregister(HandlerRegistration<H> handler) {
        handlers.remove(handler);
    }

    /**
     * The given consumer is invoked with each registered handler instance.
     *

     * Exceptions raised by the invocation of the consumer for a particular
     * handler are printed to the console and the current thread's
     * uncaught exception handler is notified.
     *

     * This method is threadsafe.
     * @param consumer the consumer to invoke
     */
    public final void forEach(@NonNull Consumer<H> consumer) {
        ObjectHelper.requireNonNull(consumer, "consumer is null");
        Iterator<HandlerRegistration<H>> it = handlers.iterator();
        while (it.hasNext()) {
            try {
                HandlerRegistration<H> hr = it.next();
                H h = hr.get();
                if (h != null) {
                    consumer.accept(h);
                }
            } catch (Throwable ex) {
                ex.printStackTrace();
                Thread t = Thread.currentThread();
                t.getUncaughtExceptionHandler().uncaughtException(t, ex);
            }
        }
    }

    /**
     * The given consumer is invoked with each registered handler instance.
     *

     * Exceptions raised by the invocation of the consumer for a particular
     * handler are printed to the console and the current thread's
     * uncaught exception handler is notified.
     *

     * This method is threadsafe.
     * @param <S> the type of the extra state provided to the consumer
     * @param state the extra state provided to the consumer
     * @param consumer the consumer to invoke
     */
    public final <S> void forEach(S state, @NonNull BiConsumer<S, H> consumer) {
        ObjectHelper.requireNonNull(consumer, "consumer is null");
        Iterator<HandlerRegistration<H>> it = handlers.iterator();
        while (it.hasNext()) {
            try {
                HandlerRegistration<H> hr = it.next();
                H h = hr.get();
                if (h != null) {
                    consumer.accept(state, h);
                }
            } catch (Throwable ex) {
                ex.printStackTrace();
                Thread t = Thread.currentThread();
                t.getUncaughtExceptionHandler().uncaughtException(t, ex);
            }
        }
    }

    /**
     * Removes all handlers from this MultiHandlerManager.
     *

     * This method is threadsafe.
     */
    public final void clear() {
        handlers.clear();
    }

    /**
     * Returns true if this manager has any handlers registered.
     *

     * This method is threadsafe.
     * @return true if this manager has any handlers registered.
     */
    public final boolean hasHandlers() {
        return !handlers.isEmpty();
    }

    static final class HandlerRegistration<H> extends AtomicReference<H> implements Disposable {

        private static final long serialVersionUID = -3761960052630027297L;

        final MultiHandlerManager<H> parent;

        HandlerRegistration(MultiHandlerManager<H> parent, H handler) {
            this.parent = parent;
            lazySet(handler);
        }

        @Override
        public void dispose() {
            H h = getAndSet(null);
            if (h != null) {
                parent.unregister(this);
            }
        }

        @Override
        public boolean isDisposed() {
            return get() == null;
        }
    }
}


text:
```perl
use WWW::SwaggerClient::Object::CallReport;
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**phone_number** | **string** |  | [optional]
**reported_caller_name** | **string** |  | [optional]
**reported_caller_id** | **string** |  | [optional]
**caller_type** | **string** |  | [optional]
**comment** | **string** |  | [optional]
**unwanted_call** | **boolean** |  | [optional]
**call_time** | **DateTime** |  | [optional]
**reporter** | **string** |  | [optional]
**ip_address** | **string** |  | [optional]
**latitude** | **double** |  | [optional]
**longitude** | **double** |  | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var ItemSchema = new Schema({
    reason:  String,
    createDate: { type: Date, default: Date.now },
    hours:{type:Number,default:2},
    applyTime:String,
    dealTime:String,
    status:{type:String,default:'create'},
    userid:String,
    owner:{type:String,default:''}
});

mongoose.model('Item', ItemSchema);


text:
"""
author : wanghe
company: LogInsight
email_ : wangh@loginsight.cn
file: test_hello2.py
time   : 16/4/19 下午9:03
"""
from rest_framework.test import APITestCase

class TestHello2(APITestCase):
    def test_simple(self):
        print ('hello world2')
        assert 1 == 1


text:
/*
* Author: BtheDestroyer
* SpriteTools is an open source 3DS Homebrew Library which can be found here:
* https://github.com/BtheDestroyer/SpriteTools
*/

#include <stdlib.h>
#include <stdarg.h>
#include "spritetools/spritetools_animation.h"

/***************************\
|*     Frame Functions     *|
\***************************/
/* Returns a pointer to a frame */
/* Takes a pointer to a spritesheet */
/*   Takes the position of the frame in the spritesheet */
/*   Takes the dimensions of the frame */
st_frame *ST_AnimationCreateFrame(st_spritesheet *spritesheet,
  u32 xleft, u32 ytop,
  u32 width, u32 height)
{
  st_frame *tempframe = calloc(sizeof(st_frame), 1);
  if (!tempframe)
    return 0;

  tempframe->spritesheet = spritesheet;
  tempframe->xleft = xleft;
  tempframe->ytop = ytop;
  tempframe->width = width;
  tempframe->height = height;
  tempframe->xoff = 0;
  tempframe->yoff = 0;

  return tempframe;
}

/* Returns a pointer to a frame */
/*   Returns NULL if failed */
/* Takes a pointer to a spritesheet */
/*   Takes the position of the frame in the spritesheet */
/*   Takes the dimensions of the frame */
/*   Takes offset for rendering (hotspot) */
st_frame *ST_AnimationCreateFrameOffset(st_spritesheet *spritesheet,
  u32 xleft, u32 ytop,
  u32 width, u32 height,
  s32 xoff, s32 yoff)
{
  st_frame *tempframe = calloc(sizeof(st_frame), 1);
  if (!tempframe)
    return 0;

  tempframe->spritesheet = spritesheet;
  tempframe->xleft = xleft;
  tempframe->ytop = ytop;
  tempframe->width = width;
  tempframe->height = height;
  tempframe->xoff = xoff;
  tempframe->yoff = yoff;

  return tempframe;
}

/* Frees frame from memory */
/* Takes a pointer to a frame */
void ST_AnimationFreeFrame(st_frame *frame)
{
  free(frame);
}

/*******************************\
|*     Animation Functions     *|
\*******************************/
/* Returns a pointer to an animation */
/*   Returns NULL if failed */
/* Takes speed of animation (in frames between each frame of animation) */
/*   Takes frame to loop to when the animation has reached its end */
/*   Takes length of animation in frames */
/*   Takes a list of pointers to frames */
st_animation *ST_AnimationCreateAnimation(s16 fpf, u16 loopFrame,
  u16 length, ...)
{
  u16 i;
  va_list ap;

  st_animation *tempanim = calloc(sizeof(st_animation), 1);
  if (!tempanim)
    return 0;

  tempanim->fpf = fpf;
  tempanim->ftn = 0;

  if (loopFrame < length)
    tempanim->loopFrame = loopFrame;
  else
    tempanim->loopFrame = length - 1;
  tempanim->length = length;
  tempanim->frames = calloc(sizeof(st_frame*), length);
  tempanim->currentFrame = 0;

  va_start(ap, length);

  for (i = 0; i < length; i++)
    tempanim->frames[i] = va_arg(ap, st_frame*);

  va_end (ap);

  return tempanim;
}

/* Frees an animation and all of its frames from memory */
/* Takes a pointer to an animation */
void ST_AnimationFreeAnimation(st_animation *animation)
{
  u16 i;
  for (i = 0; i < animation->length; i++)
    ST_AnimationFreeFrame(animation->frames[i]);
  free(animation);
}

/* Sets the current frame of an animation */
/* Takes a pointer to an animation and frame to go to */
void ST_AnimationSetFrame(st_animation *animation, u16 frame)
{
  animation->currentFrame = frame;
}

/* Adds 1 to the current frame of an animation. Wraps to 0 if needed */
/* Takes a pointer to an animation */
void ST_AnimationNextFrame(st_animation *animation)
{
  animation->currentFrame++;
  if (animation->currentFrame >= animation->length)
    animation->currentFrame = 0;
}

/* Subs 1 from the current frame of an animation */
/*   Wraps to the last frame if needed */
/* Takes a pointer to an animation */
void ST_AnimationPreviousFrame(st_animation *animation)
{
  animation->currentFrame--;
  if (animation->currentFrame >= animation->length)
    animation->currentFrame = animation->length;
}

/* Sets the speed (fpf) of an animation */
/* Takes a pointer to an animation and frame to go to */
void ST_AnimationSetSpeed(st_animation *animation, s16 speed)
{
  animation->fpf = speed;
}


text:
/**
 * Created by zheng_liming on 2017/4/11.
 * 网上自助通用付款银行账号组件-适用单币种和多币种
 * Dependence:
 *  jquery.js       基于jquery组件封装开发
 *  bootstrap.js    使用bootstrap的样式
 *  select2.js     下拉框选择组件
 * 2017-10-25 v1.1.0
 * 1. 删除开户行和银行地址信息
 * 2. 默认选中第一个账户
 */

;(function ($) {
  // Definition TG paymentAccount plugin, for piece of form
  $.fn.paymentAccount = function (method) {
    if (methods[method]) {
      return methods[method].apply(this, Array.prototype.slice.call(arguments, 1))
    } else if (typeof method === 'object' || !method) {
      return methods.init.apply(this, arguments)
    } else {
      $.error('Method ' + method + ' does not exist on tg.paymentAccount')
    }
  }

  // Default options
  $.fn.paymentAccount.defaults = {
    // 组件版本号
    version: '1.1.0',
    // 组件名称
    name: 'paymentAccount',
    // 视图状态,查看-view,编辑-edit
    viewState: 'view',
    // 付款银行账号数据对象
    data: {
      "account": "",
      "name": ""
    },
    // 服务根目录
    rootURL: 'http://localhost:3000/expense',
    // 付款银行账户选项地址
    paymentAccountURL: '/payingBankAccount/lov',
    // 付款银行账户选项
    paymentAccountOpts: []
  };

  // Private function, prepending an underscore to the function name.
  var _initView = function ($el, opts) {
    var row = opts.data
    var body = []
    body.push('
')
    body.push('
')
    body.push('
公司银行账号信息
')
    body.push('
')
    body.push('
')

    body.push('
')
    body.push('
')
    body.push('账号')
    body.push('
' + $.myFormatter.bankAccount($.myFormatter.plainText(row.account)) + '
')
    body.push('
')
    body.push('
')
    body.push('账户名')
    body.push('
' + $.myFormatter.plainText(row.name) + '
')
    body.push('
')
    body.push('
')

    body.push('
')
    body.push('
')
    $el.html(body.join(''))
  }

  var _initEdit = function ($el, opts) {
    var row = opts.data
    var body = []
    body.push('
')
    body.push('
')
    body.push('
公司银行账号信息
')
    body.push('
')
    body.push('
')

    body.push('
')
    body.push('
')
    body.push('公司银行账号 *')
    body.push('<select class="form-control paymentAccount"></select>')
    body.push('
')
    body.push('
')
    body.push('
')
    body.push('
')
    body.push('账号')
    body.push('
' + $.myFormatter.bankAccount($.myFormatter.plainText(row.account)) + '
')
    body.push('
')
    body.push('
')
    body.push('账户名')
    body.push('
' + $.myFormatter.plainText(row.name) + '
')
    body.push('
')
    body.push('
')

    body.push('
')
    body.push('
')
    $el.html(body.join(''))

    _initPaymentAccount($el, opts)
  }

  // 加载付款银行账户值列表
  var _initPaymentAccount = function ($el, opts) {
    $.myAPI({
      url: opts.rootURL + opts.paymentAccountURL,
      type: 'get'
    })
      .done(function (data, textStatus, jqXHR) {
        opts.paymentAccountOpts = data
        var $paymentAccount = $el.find('.paymentAccount')
        $paymentAccount
          .select2({
            data: data,
            placeholder: '请选择付款银行账户',
            minimumResultsForSearch: Infinity
          })
          .val('')
          .trigger('change')
          .on('select2:selecting', function (evt) {
            var data = evt.params.args.data
            opts.data = {
              "account": data.account,
              "name": data.name,
            }
            $el.find('.account').text($.myFormatter.bankAccount(opts.data.account))
            $el.find('.name').text(opts.data.name)
          })
          .on('select2:select', function () {
            $(this).val('').trigger('change')
          })
        // 如果没有选择公司付款账户,默认选中第一个账户
        if (opts.data.account === '' && data.length) {
          opts.data = {
            "account": data[0].account,
            "name": data[0].name
          }
          $el.find('.account').text($.myFormatter.bankAccount(data[0].account))
          $el.find('.name').text(data[0].name)
        }
      })
      .fail(function (jqXHR, textStatus, errorThrown) {
        toastr.error('费用类型值列表加载失败。')
        if (window.console && console.log)
          console.log('The request failed, url is ' + this.url + ' . errorThrown: ' + errorThrown)
      })
  }

  // hide
  var _hide = function ($el) {
    $el.removeData('tg.reimbInfo');
    $el.remove()
  }

  // Public function
  var methods = {
    /**
     * Init 初始化组件
     * @param {Object} options 组件初始化时设定的参数
     * @returns {Object} Returns the paymentAccount plugin dom
     */
    init: function (options) {
      return this.each(function () {
        var $this = $(this);
        var opts = $this.data('tg.paymentAccount');
        if (typeof(opts) == 'undefined') {
          opts = $.extend({}, $.fn.paymentAccount.defaults, options);
          $this.data('tg.paymentAccount', opts);
        } else {
          opts = $.extend({}, opts, options);
        }

        // 代码在这里运行
        var viewState = opts.viewState;
        if (viewState == 'view') {
          _initView($this, opts);
        } else if (viewState == 'edit') {
          _initEdit($this, opts);
        } else if (viewState == 'hide') {
          _hide($this)
        } else {
          _hide($this)
        }
      });
    },
    /**
     * getValue 获取付款银行账号信息
     * @returns {Object} 返回选中的付款银行账号对象
     */
    getValue: function () {
      var opts = $(this).data('tg.paymentAccount');
      return opts.data
    },

    /**
     * Destroy 销毁组件
     * @returns {Object} Returns the paymentAccount plugin dom
     * todo: 需要处理DOM的销毁
     */
    destroy: function () {
      return $(this).each(function () {
        var $this = $(this);

        $this.removeData('tg.paymentAccount');
        // $this.empty('')
        $this.children().remove()
      });
    },
    /**
     * getData 获取业务数据
     * @returns {Object} Returns the current plugin business data
     */
    getData: function () {
      var $el = $(this)
      var opts = $(this).data('tg.paymentAccount')
      return opts.data
    },
    validate: function () {
      var $el = $(this)
      var opts = $(this).data('tg.paymentAccount')
      if (!(opts.data && opts.data.account)) {
        toastr.error('公司银行账户不能为空')
        $('html, body').animate({
          scrollTop: $el.offset().top - 80
        }, 200)
        return false
      }
      return true
    }
  };

})(jQuery);


text:
package epitech.epioid.API.Items;

/**
 * Created by michelantoine on 17/01/15.
 */

public class Marks extends EpitechContainer {
    public static class Mark extends EpitechItem {
        public String scolaryear;
        public String codemodule;
        public String titlemodule;
        public String codeinstance;
        public String codeacti;
        public String title;
        public String date;
        public String correcteur;
        public String final_note;
        public String comment;
    }
}


text:
<?php

namespace Speelpenning\Authentication\Http\Middleware;

use Closure;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request;
use Illuminate\Translation\Translator;

class Authenticate
{
    /**
     * @var Guard
     */
    protected $auth;

    /**
     * @var Translator
     */
    protected $translator;

    /**
     * Authenticate constructor.
     *
     * @param Guard $auth
     * @param Translator $translator
     */
    public function __construct(Guard $auth, Translator $translator)
    {
        $this->auth = $auth;
        $this->translator = $translator;
    }

    /**
     * Handle the incoming request.
     *
     * @param Request $request
     * @param Closure $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if ($this->auth->guest()) {
            if ($request->ajax()) {
                return response('Unauthorized.', 401);
            } else {
                return redirect()->guest(route('authentication::session.create'));
            }
        }

        $user = $this->auth->user();

        if ($user->isBanned()) {
            $this->auth->logout();
            return redirect()->route('authentication::session.create')->withErrors([
                'authentication::login_error' => $this->translator->get('authentication::user.banned', ['email' => $user->email])
            ]);
        }

        return $next($request);
    }
}


text:
'use strict';

/* eslint-env jest */

const HTTPRedirectGather = require('../../../gather/gatherers/http-redirect.js');
const assert = require('assert').strict;
let httpRedirectGather;

describe('HTTP Redirect gatherer', () => {
  // Reset the Gatherer before each test.
  beforeEach(() => {
    httpRedirectGather = new HTTPRedirectGather();
  });

  it('sets the URL to HTTP', () => {
    const opts = {
      url: 'https://example.com',
    };
    httpRedirectGather.beforePass(opts);
    return assert.equal(opts.url, 'http://example.com');
  });

  it('resets the URL', () => {
    const opts = {
      url: 'https://example.com',
      driver: {
        evaluateAsync: function() {
          return Promise.resolve(true);
        },
      },
    };

    httpRedirectGather.beforePass(opts);
    return httpRedirectGather
        .afterPass(opts)
        .then(_ => {
          assert.equal(opts.url, 'https://example.com');
        });
  });

  it('returns an artifact', () => {
    return httpRedirectGather.afterPass({
      driver: {
        evaluateAsync: function() {
          return Promise.resolve(true);
        },
      },
    }).then(artifact => {
      assert.ok(artifact.value);
    });
  });

  it('fails a non-redirecting page', () => {
    return httpRedirectGather.afterPass({
      driver: {
        evaluateAsync: function() {
          return Promise.resolve(false);
        },
      },
    }).then(artifact => {
      assert.ok(artifact.value === false);
    });
  });

  it('throws an error on driver failure', () => {
    return httpRedirectGather.afterPass({
      driver: {
        evaluateAsync: function() {
          return Promise.reject(new Error('an unexpected driver error occurred'));
        },
      },
    }).then(
      _ => assert.ok(false),
      _ => assert.ok(true));
  });
});