def open_file(path):
    """
    Open file and read the contents.

    Args:
        path (str): Path to file.

    Returns:
        str: File contents.
    """
    try:
        with open(path, 'r') as f:
            leads = f.read()
            return leads
    except OSError:
        print('Cannot open file')