<commit_before>package io.taig.android.concurrent

import android.os.{AsyncTask, Handler, Looper}
import io.taig.android._

import scala.concurrent.{ExecutionContextExecutor, ExecutionContext}

object Executor
{
	/**
	 * Android's default asynchronous ExecutionContext
	 */
	implicit val Pool: ExecutionContextExecutor = ExecutionContext.fromExecutor( AsyncTask.THREAD_POOL_EXECUTOR )

	/**
	 * Ui-thread ExecutionContext
	 */
	val Ui = new ExecutionContext
	{
		private val handler = new Handler( Looper.getMainLooper )

		override def reportFailure( cause: Throwable ) = cause.printStackTrace()

		override def execute( command: Runnable ) = handler.post( command )
	}

	/**
	 * Run on the Ui-Thread
	 */
	def Ui( body: => Unit ): Unit = Ui.execute( body )
}<commit_msg>Report failures to android log<commit_after>package io.taig.android.concurrent

import android.os.{AsyncTask, Handler, Looper}
import io.taig.android._
import io.taig.android.util.Log

import scala.concurrent.{ExecutionContextExecutor, ExecutionContext}

object Executor
{
	/**
	 * Android's default asynchronous ExecutionContext
	 */
	implicit val Pool: ExecutionContextExecutor = ExecutionContext.fromExecutor( AsyncTask.THREAD_POOL_EXECUTOR )

	/**
	 * Ui-thread ExecutionContext
	 */
	val Ui = new ExecutionContext
	{
		private val handler = new Handler( Looper.getMainLooper )

		override def reportFailure( cause: Throwable ) = Log.e( cause.getMessage, cause )

		override def execute( command: Runnable ) = handler.post( command )
	}

	/**
	 * Run on the Ui-Thread
	 */
	def Ui( body: => Unit ): Unit = Ui.execute( body )
}
{'fraction_non_alphanumeric': 0.10362047440699126, 'fraction_numerical': 0.0, 'mean_word_length': 4.361204013377926, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4936723', 'n_tokens_mistral': 517, 'n_tokens_neox': 480, 'n_words': 126}