def lineAtPos(s, pos):
    """
	lineAtPos: return the line of a string containing the given index.
	s		a string
	pos		an index into s
	"""
    if len(s) < 1:
        return ''
    if pos > len(s):
        pos = len(s) - 1
    while pos > 0:
        if s[pos] == '\n':
            pos = pos + 1
            break
        else:
            pos = pos - 1
    s = s[pos:]
    list = s.split('\n')
    return list[0]
