<commit_before>package com.kokhouser.napod.api;

import android.content.Intent;
import android.net.Uri;

import com.google.android.apps.muzei.api.Artwork;
import com.google.android.apps.muzei.api.MuzeiArtSource;
import com.kokhouser.napod.models.Astropic;
import com.kokhouser.napod.ui.MainView;

/**
 * Created by hkok on 7/30/2015.
 */
public class NAPODArtSource extends MuzeiArtSource implements MainView {
    private static final String SOURCE_NAME = "NAPODSource";
    private static String apiKey = "<KEY>";
    APICaller apiCaller;
    private Astropic currentPicture;

    public NAPODArtSource() {
        super(SOURCE_NAME);
        apiCaller = new APICaller(this);
    }

    @Override
    protected void onUpdate(int reason) {
        try{
            apiCaller.callPictureAPIWithKey("DEMO_KEY");
        }
        catch (Exception e){
            e.printStackTrace();
            try {
                apiCaller.callPictureAPIWithKey(apiKey);
            }
            catch (Exception f) {
                f.printStackTrace();
            }
        }
    }

    @Override
    public void showProgress() {

    }

    @Override
    public void hideProgress() {
<commit_msg>Added Muzei daily wallpaper switching<commit_after>package com.kokhouser.napod.api;

import android.content.Intent;
import android.net.Uri;

import com.google.android.apps.muzei.api.Artwork;
import com.google.android.apps.muzei.api.MuzeiArtSource;
import com.kokhouser.napod.models.Astropic;
import com.kokhouser.napod.ui.MainView;

/**
 * Created by hkok on 7/30/2015.
 */
public class NAPODArtSource extends MuzeiArtSource implements MainView {
    private static final String SOURCE_NAME = "NAPODSource";
    private static final int ROTATE_TIME_MILLIS = 60 * 60 * 24 * 1000; // rotate every 24 hours
    private static String apiKey = "<KEY>";
    APICaller apiCaller;
    private Astropic currentPicture;

    public NAPODArtSource() {
        super(SOURCE_NAME);
        apiCaller = new APICaller(this);
    }

    @Override
    protected void onUpdate(int reason) {
        try{
            apiCaller.callPictureAPIWithKey("DEMO_KEY");
            scheduleUpdate(System.currentTimeMillis() + ROTATE_TIME_MILLIS);
        }
        catch (Exception e){
            e.printStackTrace();
            try {
                apiCaller.callPictureAPIWithKey(apiKey);
            }
            catch (Exception f) {
                f.printStackTrace();
            }
        }
    }

    @Override
    public void showProgress() {

    }

    @Override
    public void hideProgress() {

{'fraction_non_alphanumeric': 0.0940536338904003, 'fraction_numerical': 0.010104935872522347, 'mean_word_length': 2.483085250338295, 'pattern_counts': {'":': 0, '<': 5, '<?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': '530537', 'n_tokens_mistral': 820, 'n_tokens_neox': 769, 'n_words': 165}