def indent(string, nspaces):
    """ Indents each of the lines of a multiline string.

        :param string: Input string to indent
        :type string: str
        :param nspaces: number of spaces to indent the lines of the string
        :type nspaces: int
        :return indented_string: string indented by nspaces
        :rtype string
    """

    pad = nspaces * ' '
    indented_string = ''.join(pad+line for line in string.splitlines(True))

    return indented_string