def get_leading_whitespace(s):
    """
    Gets the leading whitespace of a string. Mainly used to
    determine how many space were there originally before adding a
    docstring. So that a docstring is placed in the same
    pattern
    Parameters
    ----------
    str s: String text
    """
    accumulator = []
    for c in s:
        if c in ' \t\x0b\x0c\r\n':
            accumulator.append(c)
        else:
            break
    return ''.join(accumulator)
