def trim_docstring(docstring):
 if ((not docstring) or (not docstring.strip())):
  return ''
 lines = docstring.expandtabs().splitlines()
 indent = min([(len(line) - len(line.lstrip())) for line in lines if line.lstrip()])
 trimmed = ([lines[0].lstrip()] + [line[indent:].rstrip() for line in lines[1:]])
 return '\n'.join(trimmed).strip()

def trim_docstring ( docstring ) : if ( ( not docstring ) or ( not docstring . strip ( ) ) ) : return '' lines = docstring . expandtabs ( ) . splitlines ( ) indent = min ( [ ( len ( line ) - len ( line . lstrip ( ) ) ) for line in lines if line . lstrip ( ) ] ) trimmed = ( [ lines [ 0 ] . lstrip ( ) ] + [ line [ indent : ] . rstrip ( ) for line in lines [ 1 : ] ] ) return '\n' . join ( trimmed ) . strip ( )
get the docstring as a series of lines that can be sent .