def get_samples_from_file(f, leading_str):
    """Return a list of ordered samples from file.
    f --- iterate over lines of a file or strings
    ...doctest:
        >>> f = '#abc\\tsample0\\tsample1'
        >>> get_samples_from_file([f], '#abc')
        ['sample0', 'sample1']
    """
    for line in f:
        line = line.strip()
        if line.startswith(leading_str):
            return line[len(leading_str):].strip().split('\t')
        elif len(line) > 0 and line[0] != '#':
            break
    raise ValueError("Could not get samples")