<commit_before>
package org.datazup.utils;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

import java.util.Locale;


/**
 * Created by ninel on 11/25/16.
 */

public class DateTimeUtils {

    public static DateTime resolve(Object obj){
        if (obj instanceof DateTime){
            return (DateTime)obj;
        }
        else if (obj instanceof Long)
            return resolve((Long)obj);
        else if (obj instanceof String){
            try {
                DateTime dt = resolve((String) obj, "EEE MMM dd HH:mm:ss Z yyyy");

                return dt;
            }catch (Exception e){
                try {
                    DateTime dt1 = resolve((String) obj);
                    return dt1;
                }catch (Exception e1){

                }
            }
        }
        return null;
    }

    public static DateTime resolve(Long timestamp){
        return new DateTime(timestamp);
    }

    public static DateTime resolve(String datetime){
        return new DateTime(datetime);
    }

    public static DateTime resolve(String datetime, String format){
        DateTimeFormatter fmt = DateTimeFormat.forPattern(format).withLocale(Locale.ENGLISH);
        DateTime dt = fmt.parseDateTime(datetime).toDateTime(DateTimeZone.UTC);
        return dt;
    }
}<commit_msg>update datetime format utils<commit_after>
package org.datazup.utils;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

import java.util.Locale;


/**
 * Created by ninel on 11/25/16.
 */

public class DateTimeUtils {

    public static DateTime resolve(Object obj){
        if (obj instanceof DateTime){
            return (DateTime)obj;
        }
        else if (obj instanceof Long)
            return resolve((Long)obj);
        else if (obj instanceof String){
            try {
                DateTime dt = resolve((String) obj, "EEE MMM dd HH:mm:ss Z yyyy");

                return dt;
            }catch (Exception e){

                try{
                    DateTime dt = resolve((String)obj, "yyyy-MM-dd hh:mm:ss.sss");
                    return  dt;
                }catch (Exception e1){

                    try {
                        DateTime dt1 = resolve((String) obj);
                        return dt1;
                    }catch (Exception e2){

                    }
                }

            }
        }
        return null;
    }

    public static DateTime resolve(Long timestamp){
        return new DateTime(timestamp);
    }

    public static DateTime resolve(String datetime){
        return new DateTime(datetime);
    }

    public static DateTime resolve(String datetime, String format){
        DateTimeFormatter fmt = DateTimeFormat.forPattern(format).withLocale(Locale.ENGLISH);
        DateTime dt = fmt.parseDateTime(datetime).toDateTime(DateTimeZone.UTC);
        return dt;
    }
}
{'fraction_non_alphanumeric': 0.09198036006546645, 'fraction_numerical': 0.006219312602291326, 'mean_word_length': 1.888468809073724, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2489304', 'n_tokens_mistral': 820, 'n_tokens_neox': 770, 'n_words': 220}