<commit_before>package motocitizen.utils;

import android.location.Location;
import android.location.LocationManager;
import android.os.Build;
import android.view.View;

import com.google.android.gms.maps.model.LatLng;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MyUtils {
    public static LatLng LocationToLatLng(Location location) {
        return new LatLng(location.getLatitude(), location.getLongitude());
    }

    public static Location LatLngToLocation(LatLng latlng) {
        Location location = new Location(LocationManager.GPS_PROVIDER);
        location.setLatitude(latlng.latitude);
        location.setLongitude(latlng.longitude);
        location.setAccuracy(0);
        return location;
    }

    public static List<String> getPhonesFromText(String in) {
        List<String> out = new ArrayList<>();
        in = in + ".";
        Matcher matcher = Pattern.compile("[7|8][ \\(-]?[\\d]{3}[ \\)-]?[\\d]{3}[ -]?[\\d]{2}[ -]?[\\d]{2}[\\D]").matcher(in);
        while (matcher.find()) {
            out.add("+7" + matcher.group().replaceAll("[^0-9]", "").substring(1));
        }
        return out;
    }

    public static String getIntervalFromNowInText(Date date) {
        return getIntervalFromNowInText(date, false);
    }

    public static String getIntervalFromNowInText(Date date, boolean full) {
        StringBuilder out     = new StringBuilder();
        Date          now     = new Date();
        int           minutes = (int) (now.getTime() - date.getTime()) / (60000);
        if (minutes <= 0) {
            return "Только что";
        }
        int hours = minutes / 60;
        minutes -= hours * 60;
        int min = minutes % 10;
        if (full) {
            if (hours == 1 || hours == 21) {
                out.append(String.valueOf(hours)).append(" час ");
            } else if (hours == 2 || hours == 3 || hours == 4 || hours == 22 || hours == 23 || hours == 24) {
                out.append(String.valueOf(hours)).append(" часа ");
            } else if (hours > 4 && hours < 21) {
                out.append(String.valueOf(hours)).append(" часов ");
            }
            if (minutes > 10 && minutes < 20) {
                out.append(String.valueOf(minutes)).append(" минут");
            } else if (min == 1) {
                out.append(String.valueOf(minutes)).append(" минуту");
            } else if (min > 1 && min < 5) {
                out.append(String.valueOf(minutes)).append(" минуты");
            } else if (min > 4 || min == 0) {
                out.append(String.valueOf(minutes)).append(" минут");
            }
            out.append(" назад");
        } else {
            out.append(String.valueOf(hours)).append("ч ");
            out.append(String.valueOf(minutes)).append("м");
        }
        return out.toString();
    }

    public static String getStringTime(Date date, boolean full) {
        String out;
        if (full) {
            out = Const.FULL_TIME_FORMAT.format(date);
        } else {
            out = Const.TIME_FORMAT.format(date);
        }
        return out;
    }
<commit_msg>Чистка мусора 3<commit_after>package motocitizen.utils;

import android.location.Location;
import android.location.LocationManager;
import android.os.Build;
import android.view.View;

import com.google.android.gms.maps.model.LatLng;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MyUtils {
    public static LatLng LocationToLatLng(Location location) {
        return new LatLng(location.getLatitude(), location.getLongitude());
    }

    public static Location LatLngToLocation(LatLng latlng) {
        Location location = new Location(LocationManager.GPS_PROVIDER);
        location.setLatitude(latlng.latitude);
        location.setLongitude(latlng.longitude);
        location.setAccuracy(0);
        return location;
    }

    public static List<String> getPhonesFromText(String in) {
        List<String> out = new ArrayList<>();
        in = in + ".";
        Matcher matcher = Pattern.compile("[7|8][ \\(-]?[\\d]{3}[ \\)-]?[\\d]{3}[ -]?[\\d]{2}[ -]?[\\d]{2}[\\D]").matcher(in);
        while (matcher.find()) {
            out.add("+7" + matcher.group().replaceAll("[^0-9]", "").substring(1));
        }
        return out;
    }

    public static String getIntervalFromNowInText(Date date) {
        return getIntervalFromNowInText(date, false);
    }

    public static String getIntervalFromNowInText(Date date, boolean full) {
        StringBuilder out     = new StringBuilder();
        Date          now     = new Date();
        int           minutes = (int) (now.getTime() - date.getTime()) / (60000);
        if (minutes <= 0) {
            return "Только что";
        }
        int hours = minutes / 60;
        minutes -= hours * 60;
        int min = minutes % 10;
        if (full) {
            switch(hours){
                case 1:
                case 21:
                    out.append(String.valueOf(hours)).append(" час ");
                    break;
                case 2:
                case 3:
                case 4:
                case 22:
                case 23:
                case 24:
                    out.append(String.valueOf(hours)).append(" часа ");
                    break;
                default:
                    out.append(String.valueOf(hours)).append(" часов ");
            }
            if (minutes > 10 && minutes < 20) {
                out.append(String.valueOf(minutes)).append(" минут");
            } else if (min == 1) {
                out.append(String.valueOf(minutes)).append(" минуту");
            } else if (min > 1 && min < 5) {
                out.append(String.valueOf(minutes)).append(" минуты");
            } else if (min > 4 || min == 0) {
                out.append(String.valueOf(minutes)).append(" минут");
            }
            out.append(" назад");
        } else {
            out.append(String.valueOf(hours)).append("ч ");
            out.append(String.valueOf(minutes)).append("м");
        }
        return out.toString();
    }

    public static String getStringTime(Date date, boolean full) {
        String out;
        if (full) {
            out = Const.FULL_TIME_FORMAT.format(date);
        } else {
            out = Const.TIME_FORMAT.format(date);
        }
        return out;
    }

{'fraction_non_alphanumeric': 0.14186011227431347, 'fraction_numerical': 0.013958428159611591, 'mean_word_length': 1.9801084990958409, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '5099070', 'n_tokens_mistral': 2006, 'n_tokens_neox': 1891, 'n_words': 413}