

def getdoc(object):
    'Get the documentation string for an object.\n\n    All tabs are expanded to spaces.  To clean up docstrings that are\n    indented to line up with blocks of code, any whitespace than can be\n    uniformly removed from the second line onwards is removed.'
    try:
        doc = object.__doc__
    except AttributeError:
        return None
    if (not isinstance(doc, types.StringTypes)):
        return None
    try:
        lines = string.split(string.expandtabs(doc), '\n')
    except UnicodeError:
        return None
    else:
        margin = sys.maxint
        for line in lines[1:]:
            content = len(string.lstrip(line))
            if content:
                indent = (len(line) - content)
                margin = min(margin, indent)
        if lines:
            lines[0] = lines[0].lstrip()
        if (margin < sys.maxint):
            for i in range(1, len(lines)):
                lines[i] = lines[i][margin:]
        while (lines and (not content[(- 1)])):
            lines.pop()
        while (lines and (not lines[0])):
            lines.pop(0)
        return string.join(lines, '\n')

dataset/ETHPy150Open cournape/Bento/bento/compat/inspect.py getdoc/VarMisuse@209/328 `lines`->`content`