<commit_before>package com.mobgen.halo.android.content;

import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Looper;
import android.support.annotation.CheckResult;
import android.support.annotation.Keep;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.util.Pair;

import com.mobgen.halo.android.content.annotations.HaloField;
import com.mobgen.halo.android.content.annotations.HaloQuery;
import com.mobgen.halo.android.content.annotations.HaloSearchable;
import com.mobgen.halo.android.content.generated.GeneratedHaloDatabase;
import com.mobgen.halo.android.content.models.HaloContentInstance;
import com.mobgen.halo.android.content.models.HaloSyncLog;
import com.mobgen.halo.android.content.models.Paginated;
import com.mobgen.halo.android.content.models.SearchQuery;
import com.mobgen.halo.android.content.models.SyncQuery;
import com.mobgen.halo.android.content.search.ClearSearchInstancesInteractor;
import com.mobgen.halo.android.content.search.ContentSearchLocalDatasource;
import com.mobgen.halo.android.content.search.ContentSearchRemoteDatasource;
import com.mobgen.halo.android.content.search.ContentSearchRepository;
import com.mobgen.halo.android.content.search.Cursor2ClassSearchConverterFactory;
import com.mobgen.halo.android.content.search.Cursor2ContentInstanceSearchConverter;
import com.mobgen.halo.android.content.search.SearchInteractor;
import com.mobgen.halo.android.content.selectors.HaloContentSelectorFactory;
import com.mobgen.halo.android.content.spec.HaloContentContract;
import com.mobgen.halo.android.content.spec.HaloContentMigration2$0$0;
import com.mobgen.halo.android.content.sync.ContentSyncLocalDatasource;
import com.mobgen.halo.android.content.sync.ContentSyncRemoteDatasource;
import com.mobgen.halo.android.content.sync.ContentSyncRepository;
import com.mobgen.halo.android.content.sync.Cursor2ClassSyncConverterFactory;
import com.mobgen.halo.android.content.sync.Cursor2ContentInstanceSyncConverter;
import com.mobgen.halo.android.content.sync.Cursor2SyncLogListConverter;
import com.mobgen.halo.android.content.sync.ModuleSyncHelper;
import com.mobgen.halo.android.content.sync.SyncDataProviders;
import com.mobgen.halo.android.content.sync.SyncModuleSchedule;
import com.mobgen.halo.android.framework.api.HaloStorageApi;
import com.mobgen.halo.android.framework.api.StorageConfig;
import com.mobgen.halo.android.framework.common.annotations.Api;
import com.mobgen.halo.android.framework.common.helpers.subscription.ISubscription;
import com.mobgen.halo.android.framework.common.utils.AssertionUtils;
import com.mobgen.halo.android.framework.storage.database.HaloDatabaseErrorHandler;
import com.mobgen.halo.android.framework.storage.database.HaloDatabaseMigration;
import com.mobgen.halo.android.framework.storage.database.dsl.queries.Create;
import com.mobgen.halo.android.framework.toolbox.bus.Event;
import com.mobgen.halo.android.framework.toolbox.bus.EventId;
import com.mobgen.halo.android.framework.toolbox.bus.Subscriber;
import com.mobgen.halo.android.framework.toolbox.data.Data;
import com.mobgen.halo.android.framework.toolbox.threading.Threading;
import com.mobgen.halo.android.framework.toolbox.data.HaloStatus;
import com.mobgen.halo.android.framework.toolbox.scheduler.Job;
import com.mobgen.halo.android.sdk.api.Halo;
import com.mobgen.halo.android.sdk.api.HaloPluginApi;
import com.mobgen.halo.android.sdk.core.management.segmentation.HaloLocale;
import com.mobgen.halo.android.sdk.core.selectors.HaloSelectorFactory;
import com.mobgen.halo.android.sdk.core.selectors.SelectorRaw2Unparse;
import com.mobgen.halo.android.sdk.core.threading.HaloInteractorExecutor;
import com.mobgen.halo.android.sdk.core.threading.InteractorExecutionCallback;

import java.util.List;

import static android.icu.lang.UCharacter.GraphemeClusterBreak.T;

/**
 * The content API is the facade for the Content HALO SDK. Importing
 * this library will need a valid HALO instance configured with
 * the credentials.
 * The HALO Content SDK allows the user to retrieve instances
 * from the HALO Backend in two main ways:
 * <ol>
 * <li>Search</li>
 * <li>Sync</li>
 * </ol>
 * Creating an instance of the Content API is really simple once you have
 * your HALO running. Just write the following line:
 * <pre><code>
 * HaloContentApi contentApi = HaloContentApi.with(halo);
 * </code></pre>
 * In addition you can provide a default locale to include it in all
 * the queries even if you didn't provide it in the search/sync.
 * <p>
 * <h2>Search</h2>
 * The <b>search</b> api takes the module instances and provides the information
 * stored in the backend based on a query. You can define many params in this
 * query such as the module name, the module ids, user segmented tags,
 * ttl and much more. You can also define a custom search query to retrieve
 * selected instances based on equality criteria. Take the following
 * query as an example:
 * <pre><code>
 * SearchQuery.builder()
 *     .moduleName("My module")<commit_msg>[Content]: unused imports<commit_after>package com.mobgen.halo.android.content;

import android.database.Cursor;
import android.support.annotation.CheckResult;
import android.support.annotation.Keep;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Pair;

import com.mobgen.halo.android.content.generated.GeneratedHaloDatabase;
import com.mobgen.halo.android.content.models.HaloContentInstance;
import com.mobgen.halo.android.content.models.HaloSyncLog;
import com.mobgen.halo.android.content.models.Paginated;
import com.mobgen.halo.android.content.models.SearchQuery;
import com.mobgen.halo.android.content.models.SyncQuery;
import com.mobgen.halo.android.content.search.ClearSearchInstancesInteractor;
import com.mobgen.halo.android.content.search.ContentSearchLocalDatasource;
import com.mobgen.halo.android.content.search.ContentSearchRemoteDatasource;
import com.mobgen.halo.android.content.search.ContentSearchRepository;
import com.mobgen.halo.android.content.search.Cursor2ClassSearchConverterFactory;
import com.mobgen.halo.android.content.search.Cursor2ContentInstanceSearchConverter;
import com.mobgen.halo.android.content.search.SearchInteractor;
import com.mobgen.halo.android.content.selectors.HaloContentSelectorFactory;
import com.mobgen.halo.android.content.spec.HaloContentContract;
import com.mobgen.halo.android.content.spec.HaloContentMigration2$0$0;
import com.mobgen.halo.android.content.sync.ContentSyncLocalDatasource;
import com.mobgen.halo.android.content.sync.ContentSyncRemoteDatasource;
import com.mobgen.halo.android.content.sync.ContentSyncRepository;
import com.mobgen.halo.android.content.sync.Cursor2ClassSyncConverterFactory;
import com.mobgen.halo.android.content.sync.Cursor2ContentInstanceSyncConverter;
import com.mobgen.halo.android.content.sync.Cursor2SyncLogListConverter;
import com.mobgen.halo.android.content.sync.ModuleSyncHelper;
import com.mobgen.halo.android.content.sync.SyncDataProviders;
import com.mobgen.halo.android.content.sync.SyncModuleSchedule;
import com.mobgen.halo.android.framework.api.HaloStorageApi;
import com.mobgen.halo.android.framework.api.StorageConfig;
import com.mobgen.halo.android.framework.common.annotations.Api;
import com.mobgen.halo.android.framework.common.helpers.subscription.ISubscription;
import com.mobgen.halo.android.framework.common.utils.AssertionUtils;
import com.mobgen.halo.android.framework.storage.database.HaloDatabaseErrorHandler;
import com.mobgen.halo.android.framework.toolbox.bus.Event;
import com.mobgen.halo.android.framework.toolbox.bus.EventId;
import com.mobgen.halo.android.framework.toolbox.bus.Subscriber;
import com.mobgen.halo.android.framework.toolbox.data.Data;
import com.mobgen.halo.android.framework.toolbox.threading.Threading;
import com.mobgen.halo.android.framework.toolbox.data.HaloStatus;
import com.mobgen.halo.android.framework.toolbox.scheduler.Job;
import com.mobgen.halo.android.sdk.api.Halo;
import com.mobgen.halo.android.sdk.api.HaloPluginApi;
import com.mobgen.halo.android.sdk.core.management.segmentation.HaloLocale;
import com.mobgen.halo.android.sdk.core.selectors.HaloSelectorFactory;
import com.mobgen.halo.android.sdk.core.selectors.SelectorRaw2Unparse;
import com.mobgen.halo.android.sdk.core.threading.HaloInteractorExecutor;
import com.mobgen.halo.android.sdk.core.threading.InteractorExecutionCallback;

import java.util.List;


/**
 * The content API is the facade for the Content HALO SDK. Importing
 * this library will need a valid HALO instance configured with
 * the credentials.
 * The HALO Content SDK allows the user to retrieve instances
 * from the HALO Backend in two main ways:
 * <ol>
 * <li>Search</li>
 * <li>Sync</li>
 * </ol>
 * Creating an instance of the Content API is really simple once you have
 * your HALO running. Just write the following line:
 * <pre><code>
 * HaloContentApi contentApi = HaloContentApi.with(halo);
 * </code></pre>
 * In addition you can provide a default locale to include it in all
 * the queries even if you didn't provide it in the search/sync.
 * <p>
 * <h2>Search</h2>
 * The <b>search</b> api takes the module instances and provides the information
 * stored in the backend based on a query. You can define many params in this
 * query such as the module name, the module ids, user segmented tags,
 * ttl and much more. You can also define a custom search query to retrieve
 * selected instances based on equality criteria. Take the following
 * query as an example:
 * <pre><code>
 * SearchQuery.builder()
 *     .moduleName("My module")
{'fraction_non_alphanumeric': 0.10230310507916923, 'fraction_numerical': 0.0022619782027555007, 'mean_word_length': 5.928062678062678, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '5221516', 'n_tokens_mistral': 2974, 'n_tokens_neox': 2970, 'n_words': 568}