import random


def random_lines(file_path, num_lines):
    """ Randomly sample lines from a file

    The function reads the entire file into a list, so beware of large files!

    Parameters
    ----------
    file_path : path to the file that will be sampled

    num_lines : number of lines from the file to be sampled

    Returns
    -------
    rand_lines : a list containing a random sample of lines from the file
    """
    with open(file_path) as f:
        rand_lines = random.sample(f.read().splitlines(), num_lines)

    return rand_lines