<commit_before><?php

Class Kohana_Gmaps {

	/**
	 * The URL to the Google Maps RESTfull API
	 */
	const API_URL = 'http://maps.googleapis.com/maps/api/';

	/**
	 * A list of supported Google Maps web services
	 */
	protected static $_APIs = array('geocode', 'distancematrix');

	/**
	 * Use Geocoding to determine the well formatted, fully qualified address of
	 * the passed location string.
	 *
	 * @link https://developers.google.com/maps/documentation/geocoding/
	 *
	 * @param  string $location The location to geocode
	 * @return string
	 */
	public static function geocode($location)
	{
		try
		{
			$parameters = array(
				'address' => $location,
			);

			$response = self::make_request('geocode', $parameters);
		}
		catch (Kohana_Exception $e)
		{
			return FALSE;
		}

		return $response['results'][0];
	}

	/**
	 * Determine the distance and travel time between two locations.
	 *
	 * @param  string  $origin      The start point
	 * @param  string  $destination The end point
	 * @param  boolean $imperical   Use imperical units?
	 * @return array
	 */
	public static function distance($origin, $destination, $imperical = TRUE)
	{
		try
		{
			$parameters = array(
				'origins'      => $origin,
				'destinations' => $destination,
			);<commit_msg>Allow use of imperial units<commit_after><?php

Class Kohana_Gmaps {

	/**
	 * The URL to the Google Maps RESTfull API
	 */
	const API_URL = 'http://maps.googleapis.com/maps/api/';

	/**
	 * A list of supported Google Maps web services
	 */
	protected static $_APIs = array('geocode', 'distancematrix');

	/**
	 * Use Geocoding to determine the well formatted, fully qualified address of
	 * the passed location string.
	 *
	 * @link https://developers.google.com/maps/documentation/geocoding/
	 *
	 * @param  string $location The location to geocode
	 * @return string
	 */
	public static function geocode($location)
	{
		try
		{
			$parameters = array(
				'address' => $location,
			);

			$response = self::make_request('geocode', $parameters);
		}
		catch (Kohana_Exception $e)
		{
			return FALSE;
		}

		return $response['results'][0];
	}

	/**
	 * Determine the distance and travel time between two locations.
	 *
	 * @param  string  $origin      The start point
	 * @param  string  $destination The end point
	 * @param  boolean $imperial    Use imperial units?
	 * @return array
	 */
	public static function distance($origin, $destination, $imperial = TRUE)
	{
		try
		{
			// Setup the origin and destination
			$parameters = array(
				'origins'      => $origin,
				'destinations' => $destination,
			);

			// Should we use imperial units
			if ($imperial)
			{
				$parameters += array('units' => 'imperial');
			}
{'fraction_non_alphanumeric': 0.12435040831477358, 'fraction_numerical': 0.0007423904974016332, 'mean_word_length': 3.0895295902883158, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 2, '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': '1171078', 'n_tokens_mistral': 943, 'n_tokens_neox': 808, 'n_words': 249}