<commit_before>'use strict';
var React = require('react-native');
var {
	Animated,
	Easing,
	Platform
} = React;

var dateFormat = require('dateformat');

module.exports = {
	
	platformIOS: function() {
		if (Platform.OS === 'ios') {
			return true;
		} else {
			return false;
		}
	},

	platformAndroid: function() {
		if (Platform.OS === 'android') {
			return true;
		} else {
			return false;
		}
	},

	getPlatform: function() {
		return Platform.OS;
	},

	startReloadAnimation2: function(anim, toVal, duration) {
		Animated.timing(anim, { toValue: toVal, duration: duration, easing: Easing.linear }).start();
	},

	startReloadAnimation: function(anim) {
		Animated.timing(anim, { toValue: 100, duration: 60000, easing: Easing.linear }).start();
	},

	stopReloadAnimation: function(anim) {<commit_msg>Added openURL and getDirectionsURL to util/general<commit_after>'use strict';
var React = require('react-native');
var {
	Animated,
	Easing,
	Platform,
	Linking,
} = React;

var dateFormat = require('dateformat');

module.exports = {
	
	platformIOS: function() {
		if (Platform.OS === 'ios') {
			return true;
		} else {
			return false;
		}
	},

	platformAndroid: function() {
		if (Platform.OS === 'android') {
			return true;
		} else {
			return false;
		}
	},

	getPlatform: function() {
		return Platform.OS;
	},

	openURL: function(url) {
		Linking.canOpenURL(url).then(supported => {
			if (!supported) {
				logger.log('ERR: openURL: Unable to handle url: ' + url);
			} else {
				return Linking.openURL(url);
			}
		}).catch(err => logger.log('ERR: openURL: ' + err));
	},

	getDirectionsURL: function(method, startLat, startLon, stopLat, stopLon) {

		var directionsURL;

		if (this.platformIOS()) {
			if (method === 'walk') {
				directionsURL = 'http://maps.apple.com/?saddr=' + startLat + ',' + startLon + '&daddr=' + stopLat + ',' + stopLon + '&dirflg=w';
			} else {
				// Default to driving directions
				directionsURL = 'http://maps.apple.com/?saddr=' + startLat + ',' + startLon + '&daddr=' + stopLat + ',' + stopLon + '&dirflg=d';
			}
		} else {
			if (method === 'walk') {
				directionsURL = 'https://www.google.com/maps/dir/' + startLat + ',' + startLon + '/' + stopLat + ',' + stopLon + '/@' + startLat + ',' + startLon + ',18z/data=!4m2!4m1!3e1';
			} else {
				// Default to driving directions
				directionsURL = 'https://www.google.com/maps/dir/' + startLat + ',' + startLon + '/' + stopLat + ',' + stopLon + '/@' + startLat + ',' + startLon + ',18z/data=!4m2!4m1!3e0';
			}
		}

		return directionsURL;
	},

	startReloadAnimation2: function(anim, toVal, duration) {
		Animated.timing(anim, { toValue: toVal, duration: duration, easing: Easing.linear }).start();
	},

	startReloadAnimation: function(anim) {
		Animated.timing(anim, { toValue: 100, duration: 60000, easing: Easing.linear }).start();
	},

	stopReloadAnimation: function(anim) {
{'fraction_non_alphanumeric': 0.17945157931273864, 'fraction_numerical': 0.011801457827143353, 'mean_word_length': 3.701468189233279, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '7616420', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1022, 'n_words': 212}