'Returns the string leaf of a docstring. e.g. ``r\'\'\'foo\'\'\'``.'

def get_doc_node(self):

    if (self.type == 'file_input'):
        node = self.children[0]
    elif isinstance(self, ClassOrFunc):
        node = self.children[(self.children.index(':') + 1)]
        if (node.type == 'suite'):
            node = node.children[1]
    else:
        simple_stmt = self.parent
        c = simple_stmt.parent.children
        index = c.index(simple_stmt)
        if (not index):
            return None
        node = c[(index - 1)]
    if (node.type == 'simple_stmt'):
        node = node.children[0]
    if (node.type == 'string'):
        return node
    return None
