<commit_before>package com.android.youtubemysongs;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;

import org.apache.commons.io.IOUtils;
import org.json.JSONArray;
import org.json.JSONObject;

import com.google.gdata.client.youtube.YouTubeQuery;
import com.google.gdata.data.youtube.*;
import com.google.gdata.util.ServiceException;
import com.google.gdata.client.youtube.YouTubeService;
import com.android.youtubemysongs.R;

public class Sample extends Activity {

	ListView musiclist;
    Cursor musiccursor;
    int music_column_index;
    int count;
    MediaPlayer mMediaPlayer;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.sample);
          init_phone_music_grid();
    }
    
    @SuppressWarnings("deprecation")
	private void init_phone_music_grid() {
          System.gc();
          String[] proj = { MediaStore.Audio.Media._ID,MediaStore.Audio.Media.DATA,MediaStore.Audio.Media.DISPLAY_NAME,MediaStore.Video.Media.SIZE };
          musiccursor = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,proj, null, null, null);
          count = musiccursor.getCount();
          musiclist = (ListView) findViewById(R.id.PhoneMusicList);
          musiclist.setAdapter(new MusicAdapter(getApplicationContext()));
          musiclist.setOnItemClickListener(musicgridlistener);
          mMediaPlayer = new MediaPlayer();
    }

    private OnItemClickListener musicgridlistener = new OnItemClickListener() {
          public void onItemClick(AdapterView parent, View v, int position,long id) {
        	  String id0=null;
        	  try {
        		  System.gc();
        		  //String artist = musiccursor.getString(musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ARTIST));
        		 // String name = musiccursor.getString(musiccursor.getColumnIndex(MediaStore.Audio.Media.TITLE));
        		  //String albumName = musiccursor.getString(musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM));
        		  
        		  String songname = "Junoon";
        		  URL jsonURL = new URL("http://gdata.youtube.com/feeds/api/videos?q=Junoon&max-results=1&v=2&alt=jsonc"); 
        		  URLConnection jc = jsonURL.openConnection(); 
        		  InputStream is = jc.getInputStream(); 
        		  String jsonTxt = IOUtils.toString( is );
        		  JSONObject jj = new JSONObject(jsonTxt); 
        		  JSONObject jdata = jj.getJSONObject("data");
        		  JSONArray aitems = jdata.getJSONArray("items");
        		  JSONObject item0 = aitems.getJSONObject(0);
        		  id0 = item0.getString("id"); 
        		  
        		  //Log.v("aanchal",artist);
        		  //Log.v("aanchal",name);
        		  //Log.v("aanchal",name);
        	  } catch (Exception e) {
        		  e.printStackTrace();
        	  }
        	 <commit_msg>Remove spaces from song name<commit_after>package com.android.youtubemysongs;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;

import org.apache.commons.io.IOUtils;
import org.json.JSONArray;
import org.json.JSONObject;

import com.google.gdata.client.youtube.YouTubeQuery;
import com.google.gdata.data.youtube.*;
import com.google.gdata.util.ServiceException;
import com.google.gdata.client.youtube.YouTubeService;
import com.android.youtubemysongs.R;

public class Sample extends Activity {

	ListView musiclist;
    Cursor musiccursor;
    int music_column_index;
    int count;
    MediaPlayer mMediaPlayer;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.sample);
          init_phone_music_grid();
    }
    
    @SuppressWarnings("deprecation")
	private void init_phone_music_grid() {
          System.gc();
          String[] proj = { MediaStore.Audio.Media._ID,MediaStore.Audio.Media.DATA,MediaStore.Audio.Media.DISPLAY_NAME,MediaStore.Video.Media.SIZE };
          musiccursor = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,proj, null, null, null);
          count = musiccursor.getCount();
          musiclist = (ListView) findViewById(R.id.PhoneMusicList);
          musiclist.setAdapter(new MusicAdapter(getApplicationContext()));
          musiclist.setOnItemClickListener(musicgridlistener);
          mMediaPlayer = new MediaPlayer();
    }

    private OnItemClickListener musicgridlistener = new OnItemClickListener() {
          public void onItemClick(AdapterView parent, View v, int position,long id) {
        	  String id0=null;
        	  try {
        		  System.gc();
        		  //String artist = musiccursor.getString(musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ARTIST));
        		 // String name = musiccursor.getString(musiccursor.getColumnIndex(MediaStore.Audio.Media.TITLE));
        		  //String albumName = musiccursor.getString(musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM));
        		  
        		  String songname = "<NAME>";
        		  songname = songname.replace(" ", "%20");
        		  Log.v("rahul", songname);
        		  URL jsonURL = new URL("http://gdata.youtube.com/feeds/api/videos?q="+songname+"&max-results=1&format=5&v=2&alt=jsonc"); 
        		  URLConnection jc = jsonURL.openConnection(); 
        		  InputStream is = jc.getInputStream(); 
        		  String jsonTxt = IOUtils.toString( is );
        		  JSONObject jj = new JSONObject(jsonTxt); 
        		  JSONObject jdata = jj.getJSONObject("data");
        		  JSONArray aitems = jdata.getJSONArray("items");
        		  JSONObject item0 = aitems.getJSONObject(0);
        		  id0 = item0.getString("id"); 
        		  
        		  //Log.v("aanchal",artist);
        		  //Log.v("aanchal",name);
        		  //Log.v("aanchal",name);
        	  } catch (Exception e) {
        		  e.printStackTrace();
        	  }
        	 
{'fraction_non_alphanumeric': 0.10848208108482081, 'fraction_numerical': 0.0023522900235229, 'mean_word_length': 3.1683967704728953, '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': '4891612', 'n_tokens_mistral': 2202, 'n_tokens_neox': 2118, 'n_words': 373}