def METHOD_NAME(
    infile, sample_id=None, chrom_names=None, chrom_prefix=None, from_log10=False
):
    """Read one sample from a SEG file.
    Parameters
    ----------
    sample_id : string, int or None
        If a string identifier, return the sample matching that ID.  If a
        positive integer, return the sample at that index position, counting
        from 0. If None (default), return the first sample in the file.
    chrom_names : dict
        Map (string) chromosome IDs to names. (Applied before chrom_prefix.)
        e.g. {'23': 'X', '24': 'Y', '25': 'M'}
    chrom_prefix : str
        Prepend this string to chromosome names. (Usually 'chr' or None)
    from_log10 : bool
        Convert values from log10 to log2.
    Returns
    -------
    DataFrame of the selected sample's segments.
    """
    results = parse_seg(infile, chrom_names, chrom_prefix, from_log10)
    if isinstance(sample_id, int):
        # Select sample by index number
        for i, (_sid, dframe) in enumerate(results):
            if i == sample_id:
                return dframe
        else:
            raise IndexError(f"No sample index {sample_id} found in SEG file")
    elif isinstance(sample_id, str):
        # Select sample by name
        for sid, dframe in results:
            if sid == sample_id:
                return dframe
        else:
            raise IndexError(f"No sample ID '{sample_id}' found in SEG file")
    else:
        # Select the first sample
        sid, dframe = next(results)
        try:
            next(results)
        except StopIteration:
            pass
        else:
            logging.warning(
                "WARNING: SEG file contains multiple samples; "
                "returning the first sample '%s'",
                sid,
            )
        return dframe