def prepare_docstring(s, ignore=1):
 lines = s.expandtabs().splitlines()
 margin = sys.maxsize
 for line in lines[ignore:]:
  content = len(line.lstrip())
  if content:
   indent = (len(line) - content)
   margin = min(margin, indent)
 for i in range(ignore):
  if (i < len(lines)):
   lines[i] = lines[i].lstrip()
 if (margin < sys.maxsize):
  for i in range(ignore, len(lines)):
   lines[i] = lines[i][margin:]
 while (lines and (not lines[0])):
  lines.pop(0)
 if (lines and lines[(-1)]):
  lines.append('')
 return lines

def prepare_docstring ( s , ignore = 1 ) : lines = s . expandtabs ( ) . splitlines ( ) margin = sys . maxsize for line in lines [ ignore : ] : content = len ( line . lstrip ( ) ) if content : indent = ( len ( line ) - content ) margin = min ( margin , indent ) for i in range ( ignore ) : if ( i < len ( lines ) ) : lines [ i ] = lines [ i ] . lstrip ( ) if ( margin < sys . maxsize ) : for i in range ( ignore , len ( lines ) ) : lines [ i ] = lines [ i ] [ margin : ] while ( lines and ( not lines [ 0 ] ) ) : lines . pop ( 0 ) if ( lines and lines [ ( - 1 ) ] ) : lines . append ( '' ) return lines
convert a docstring into lines of parseable rest .