<commit_before>package com.icecondor.nest;

import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import android.os.Build;

public class Util {
	public static String DateTimeIso8601Now() {
		return Util.DateTimeIso8601(System.currentTimeMillis());
	}
	
	public static String DateTimeIso8601NowShort() {
		return Util.DateTimeIso8601(System.currentTimeMillis()).substring(0,19);
	}
	
	public static String DateTimeIso8601(long offset) {
		DateFormat datePattern =  new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ssZ");
		datePattern.setTimeZone(TimeZone.getTimeZone("GMT"));
		String date = datePattern.format(new Date(offset));
		if (Build.VERSION.SDK_INT == 7) {
			// Android 2.1 timezone bug
			date = date.substring(0, 19)+"Z";
		}
        return date;
	}
	
	public static Date DateRfc822(String date) {
		 SimpleDateFormat rfc822DateFormats[] = new SimpleDateFormat[] { 
				 new SimpleDateFormat("EEE, d MMM yy HH:mm:ss z"), 
				 new SimpleDateFormat("EEE, d MMM yy HH:mm z"), 
				 new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z"), 
				 new SimpleDateFormat("EEE, d MMM yyyy HH:mm z"), 
				 new SimpleDateFormat("d MMM yy HH:mm z"), 
				 new SimpleDateFormat("d MMM yy HH:mm:ss z"), 
				 new SimpleDateFormat("d MMM yyyy HH:mm z"), 
				 new SimpleDateFormat("d MMM yyyy HH:mm:ss z"),
				 new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz"),
				 new SimpleDateFormat("yyyyMMdd'T'HHmmss"),
				 new SimpleDateFormat("yyyyMMdd")};
		 
		 Date parsed = null;
		 for(int i=0; i < rfc822DateFormats.length; i++) {
			 try {<commit_msg>add a reference #8258<commit_after>package com.icecondor.nest;

import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import android.os.Build;

public class Util {
	public static String DateTimeIso8601Now() {
		return Util.DateTimeIso8601(System.currentTimeMillis());
	}
	
	public static String DateTimeIso8601NowShort() {
		return Util.DateTimeIso8601(System.currentTimeMillis()).substring(0,19);
	}
	
	public static String DateTimeIso8601(long offset) {
		DateFormat datePattern =  new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ssZ");
		datePattern.setTimeZone(TimeZone.getTimeZone("GMT"));
		String date = datePattern.format(new Date(offset));
		if (Build.VERSION.SDK_INT == 7) {
			// Android 2.1 timezone bug
			// http://code.google.com/p/android/issues/detail?id=8258
			date = date.substring(0, 19)+"Z";
		}
        return date;
	}
	
	public static Date DateRfc822(String date) {
		 SimpleDateFormat rfc822DateFormats[] = new SimpleDateFormat[] { 
				 new SimpleDateFormat("EEE, d MMM yy HH:mm:ss z"), 
				 new SimpleDateFormat("EEE, d MMM yy HH:mm z"), 
				 new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z"), 
				 new SimpleDateFormat("EEE, d MMM yyyy HH:mm z"), 
				 new SimpleDateFormat("d MMM yy HH:mm z"), 
				 new SimpleDateFormat("d MMM yy HH:mm:ss z"), 
				 new SimpleDateFormat("d MMM yyyy HH:mm z"), 
				 new SimpleDateFormat("d MMM yyyy HH:mm:ss z"),
				 new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz"),
				 new SimpleDateFormat("yyyyMMdd'T'HHmmss"),
				 new SimpleDateFormat("yyyyMMdd")};
		 
		 Date parsed = null;
		 for(int i=0; i < rfc822DateFormats.length; i++) {
			 try {
{'fraction_non_alphanumeric': 0.1278085789320105, 'fraction_numerical': 0.025094835132769187, 'mean_word_length': 4.233587786259542, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2625632', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1164, 'n_words': 276}