<commit_before>package com.eyekabob;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class FindMusicActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.findmusicactivity);
    }

    public void findByArtistHandler(View v) {
        EditText findByArtist = (EditText)findViewById(R.id.findByArtistInput);
        String artist = findByArtist.getText().toString();
        URL url = null;
		try {
			url = new URL(EyekabobHelper.LastFM.SERVICE_URL + "?method=artist.getEvents&api_key=" + EyekabobHelper.LastFM.API_KEY + "&artist=" + artist);
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}

        HttpURLConnection urlConnection = null;
		try {
			urlConnection = (HttpURLConnection) url.openConnection();
            InputStream in = new BufferedInputStream(urlConnection.getInputStream());
            String result = getStringResponse(in);
            Toast.makeText(v.getContext(), result, 8000).show();
		} catch (IOException e) {
			e.printStackTrace();
		}
        finally {
            urlConnection.disconnect();
        }
    }

    public String getStringResponse(InputStream is) throws IOException {
        StringBuffer out = new StringBuffer();
        byte[] b = new byte[4096];
        for (int n; (n = is.read(b)) != -1;) {
            out.append(new String(b, 0, n));
        }
        return out.toString();
    }
}<commit_msg>use another thread for the artist task<commit_after>package com.eyekabob;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class FindMusicActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.findmusicactivity);
    }

    public void findByArtistHandler(View v) {
        EditText findByArtist = (EditText)findViewById(R.id.findByArtistInput);
        String artist = findByArtist.getText().toString();
        URL url = null;
		try {
			url = new URL(EyekabobHelper.LastFM.SERVICE_URL + "?method=artist.getEvents&api_key=" + EyekabobHelper.LastFM.API_KEY + "&artist=" + artist);
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}

		new ArtistTask().execute(url);

    }

    private class ArtistTask extends AsyncTask<URL, Void, String> {
    	protected String doInBackground(URL... urls) {
    		return doRequest(urls[0]);
    	}

    	protected void onPostExecute(String result) {
    		Toast.makeText(getApplicationContext(), result, 50000).show();
    	}
        public String doRequest(URL url) {
        	HttpURLConnection urlConnection = null;
        	StringBuffer out = null;
    		try {
    			urlConnection = (HttpURLConnection) url.openConnection();
                InputStream is = new BufferedInputStream(urlConnection.getInputStream());
                out = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n; (n = is.read(b)) != -1;) {
                    out.append(new String(b, 0, n));
                }
    		} catch (IOException e) {
    			e.printStackTrace();
    		}
            finally {
                urlConnection.disconnect();
            }

            return out.toString();
        }
    }
}
{'fraction_non_alphanumeric': 0.10885750962772786, 'fraction_numerical': 0.005648267008985879, 'mean_word_length': 2.963377416073245, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1207703', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1119, 'n_words': 244}