def read(file_path, lines=False):
    """Returns contents of file either as a string or list of lines."""
    with open(file_path, 'r') as fp:
        if lines:
            return fp.readlines()
        return fp.read()