<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Google Maps API - authorized access
This notebook provides introduction to requesting data from Google Maps API using Python.
There is a standout Python package developed explicitly for that purpose. To install that package go to the comman prompt and enter the following command
Step1:  Reminder
Step2:  If you print the results above, it will again be a JSON document, yet again unreadible. Let's again make it pretty.
<ASSISTANT_TASK:>
Python Code:
import googlemaps
from datetime import datetime
Explanation: Google Maps API - authorized access
This notebook provides introduction to requesting data from Google Maps API using Python.
There is a standout Python package developed explicitly for that purpose. To install that package go to the comman prompt and enter the following command:
pip install googlemaps
Once the package is installed, you may go to https://developers.google.com/console for creating an API key. You will also need to manually enable separate API services for your account. This tutorial uses only two services that you need to enable: Geocoding API and Directions API. Make sure to disable them after finishing the tutorial to avoid excessing the free usage limits.
Before proceeding to code, one may check what looks like the response received by the Google Maps (Geocoding) API for, e.g. city Yerevan - https://maps.googleapis.com/maps/api/geocode/json?address=Yerevan (a JSON file, as usually).
End of explanation
gmaps = googlemaps.Client(key='somesecretkeyhere')
# Geocoding an address
geocode_result = gmaps.geocode('1600 Amphitheatre Parkway, Mountain View, CA')
type(geocode_result)
from pprint import pprint
pprint(geocode_result)
# Look up an address with reverse geocoding
reverse_geocode_result = gmaps.reverse_geocode((40.714224, -73.961452))
Explanation: Reminder: The API key is secret, and should not be shown publicly.
End of explanation
pprint(reverse_geocode_result)
# Request directions via public transit
now = datetime.now()
directions_result = gmaps.directions("Yerevan, Armenia","Dilijan, Armenia", departure_time=now)
pprint(directions_result)
for i in directions_result:
    legs = i["legs"]
    for leg in legs:
        dist = leg["distance"]
        print dist
type(dist)
loc1 = raw_input("Please, provide the start location: ")+", Armenia"
loc2 = raw_input("Please, provide the end location: ")+", Armenia"
directions_result = gmaps.directions(loc1,loc2, departure_time=datetime.now())
for i in directions_result:
    legs = i["legs"]
    for leg in legs:
        dist = leg["distance"]
print("\n")
print("The distance between "+loc1+" and "+loc2+" is "+dist["text"])
Explanation: If you print the results above, it will again be a JSON document, yet again unreadible. Let's again make it pretty.
End of explanation
<END_TASK>