from pathlib import Path
import ast


def get_neighbors(peer_name: str):
    """gets the directly connected nodes of a peer"""
    neighbors_path = str(Path(__file__).parent.parent.parent) + \
                     "/.data/neighbors/"
    with open("{0}/{1}".format(neighbors_path, peer_name), "r") as neighbors_file:
        return ast.literal_eval(neighbors_file.read())