import random


def get_proverb(filename):
    """
    This function reads a random line from a given file.

    :param filename: absolute or relative path to a file
    :type filename: str
    :return: a proverb
    :rtype: str
    """
    _ = 0  # initialize here
    with open(filename) as f:
        for _, line in enumerate(f):
            if "END_OF_FILE" in line:
                _ -= 1
                break

    # starts with index 1 because the first (index 0) line contains
    # the alphabet with all the letters used in proverbs in the file
    x = random.randint(1, _)
    with open(filename) as f:
        for _, line in enumerate(f):
            if _ == x:
                return line[:-1]