def head(fh, num, show_header):
    """Return num lines from file handle"""

    lines = [f'==> {fh.name} <==\n'] if show_header else []
    for line_num, line in enumerate(fh, start=1):
        lines.append(line)
        if line_num == num:
            break

    return ''.join(lines)