import json


def get_locations(path: str) -> dict:
    """
    Get dictionary with followers and their locations.
    """
    locations = {}
    with open(path) as json_file:
        data = json.load(json_file)
    followers = data['data']
    for follower in followers:
        if 'location' in follower:
            locations[follower['username']] = follower['location']
    return locations