<commit_before>package akechi.projectl;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Application;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;

import com.google.api.client.extensions.android.http.AndroidHttp;
import com.google.api.client.http.apache.ApacheHttpTransport;
import com.google.api.client.repackaged.com.google.common.base.Strings;

import jp.michikusa.chitose.lingr.LingrClient;
import jp.michikusa.chitose.lingr.LingrClientFactory;

public class AppContext
    extends Application
{
    public Account getAccount()
    {
        final String name= this.accountName;
        if(Strings.isNullOrEmpty(name))
        {
            Log.i("AppContext", "account not yet selected");
            return null;
        }

        final AccountManager manager= AccountManager.get(this);
        final Account[] accounts= manager.getAccountsByType("com.lingr");
        if(accounts.length <= 0)
        {
            Log.i("AppContext", "no accounts");
            return null;
        }

        for(final Account account : accounts)
        {
            if(name.equals(account.name))
            {
                Log.i("AppContext", "Found account " + name);
                return account;
            }
        }
        Log.i("AppContext", "Couldn't find account name " + name);
        return null;
    }

    public void setAccount(Account account)
    {
        Log.i("AppContext", "setAccount() with " + account.name);
        this.accountName= account.name;
    }

    public String getRoomId(Account account)
    {
        final AccountManager manager= AccountManager.get(this);
        return manager.getUserData(account, "roomId");
    }

    public void setRoomId(Account account, CharSequence roomId)
    {
        final AccountManager manager= AccountManager.get(this);
        manager.setUserData(account, "roomId", roomId.toString());
    }

    public LingrClient getLingrClient()
    {
        return lingrFactory.newLingrClient();
    }
<commit_msg>Fix launching failure<commit_after>package akechi.projectl;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Application;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;

import com.google.api.client.extensions.android.http.AndroidHttp;
import com.google.api.client.http.apache.ApacheHttpTransport;
import com.google.api.client.repackaged.com.google.common.base.Strings;

import jp.michikusa.chitose.lingr.LingrClient;
import jp.michikusa.chitose.lingr.LingrClientFactory;

import static com.google.common.base.Preconditions.checkNotNull;

public class AppContext
    extends Application
{
    public Account getAccount()
    {
        final String name= this.accountName;
        if(Strings.isNullOrEmpty(name))
        {
            Log.i("AppContext", "account not yet selected");
            return null;
        }

        final AccountManager manager= AccountManager.get(this);
        final Account[] accounts= manager.getAccountsByType("com.lingr");
        if(accounts.length <= 0)
        {
            Log.i("AppContext", "no accounts");
            return null;
        }

        for(final Account account : accounts)
        {
            if(name.equals(account.name))
            {
                Log.i("AppContext", "Found account " + name);
                return account;
            }
        }
        Log.i("AppContext", "Couldn't find account name " + name);
        return null;
    }

    public void setAccount(Account account)
    {
        checkNotNull(account, "account is null");

        this.accountName= account.name;
    }

    public String getRoomId(Account account)
    {
        if(account == null)
        {
            return null;
        }
        final AccountManager manager= AccountManager.get(this);
        return manager.getUserData(account, "roomId");
    }

    public void setRoomId(Account account, CharSequence roomId)
    {
        checkNotNull(account, "account is null");

        final AccountManager manager= AccountManager.get(this);
        manager.setUserData(account, "roomId", roomId.toString());
    }

    public LingrClient getLingrClient()
    {
        return lingrFactory.newLingrClient();
    }

{'fraction_non_alphanumeric': 0.10369681469425715, 'fraction_numerical': 0.00046500813764240875, 'mean_word_length': 2.5879899916597164, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6809042', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1213, 'n_words': 247}