def left_trim_lines(lines):
 lines_striped = list(zip(lines[1:], list(map(str.lstrip, lines[1:]))))
 lines_striped = list(filter(itemgetter(1), lines_striped))
 indent = min(([(len(line) - len(striped)) for (line, striped) in lines_striped] + [sys.maxsize]))
 if (indent < sys.maxsize):
  return [line[indent:] for line in lines]
 else:
  return list(lines)

def left_trim_lines ( lines ) : lines_striped = list ( zip ( lines [ 1 : ] , list ( map ( str . lstrip , lines [ 1 : ] ) ) ) ) lines_striped = list ( filter ( itemgetter ( 1 ) , lines_striped ) ) indent = min ( ( [ ( len ( line ) - len ( striped ) ) for ( line , striped ) in lines_striped ] + [ sys . maxsize ] ) ) if ( indent < sys . maxsize ) : return [ line [ indent : ] for line in lines ] else : return list ( lines )
remove all unnecessary leading space from lines .