def METHOD_NAME(
    begin_time,
    end_time,
    event_time,
    eeg_bads,
    status="unedited",
    name=None,
    pns_bads=None,
    nsegs=None,
):
    """Build content for a single segment in categories.xml.
    Segments are sorted into categories in categories.xml. In a segmented MFF
    each category can contain multiple segments, but in an averaged MFF each
    category only contains one segment (the average).
    """
    channel_status = [
        {"signalBin": 1, "exclusion": "badChannels", "channels": eeg_bads}
    ]
    if pns_bads:
        channel_status.append(
            {"signalBin": 2, "exclusion": "badChannels", "channels": pns_bads}
        )
    content = {
        "status": status,
        "beginTime": begin_time,
        "endTime": end_time,
        "evtBegin": event_time,
        "evtEnd": event_time,
        "channelStatus": channel_status,
    }
    if name:
        content["name"] = name
    if nsegs:
        content["keys"] = {"#seg": {"type": "long", "data": nsegs}}
    return content