def isbatch(line):
    """
    Batches are wrapped in BHS / BTS or have more than one
    message
    BHS = batch header segment
    BTS = batch trailer segment
    """
    return line and (
        line.strip()[:3] == "BHS"
        or (line.count("MSH") > 1 and line.strip()[:3] != "FHS")
    )