def fix_lines(source_lines, options, filename=u''):
 original_newline = find_newline(source_lines)
 tmp_source = u''.join(normalize_line_endings(source_lines, u'\n'))
 previous_hashes = set()
 if options.line_range:
  fixed_source = tmp_source
 else:
  fixed_source = apply_global_fixes(tmp_source, options, filename=filename)
 passes = 0
 long_line_ignore_cache = set()
 while (hash(fixed_source) not in previous_hashes):
  if ((options.pep8_passes >= 0) and (passes > options.pep8_passes)):
   break
  passes += 1
  previous_hashes.add(hash(fixed_source))
  tmp_source = copy.copy(fixed_source)
  fix = FixPEP8(filename, options, contents=tmp_source, long_line_ignore_cache=long_line_ignore_cache)
  fixed_source = fix.fix()
 sio = io.StringIO(fixed_source)
 return u''.join(normalize_line_endings(sio.readlines(), original_newline))

def fix_lines ( source_lines , options , filename = u'' ) : original_newline = find_newline ( source_lines ) tmp_source = u'' . join ( normalize_line_endings ( source_lines , u'\n' ) ) previous_hashes = set ( ) if options . line_range : fixed_source = tmp_source else : fixed_source = apply_global_fixes ( tmp_source , options , filename = filename ) passes = 0 long_line_ignore_cache = set ( ) while ( hash ( fixed_source ) not in previous_hashes ) : if ( ( options . pep8_passes >= 0 ) and ( passes > options . pep8_passes ) ) : break passes += 1 previous_hashes . add ( hash ( fixed_source ) ) tmp_source = copy . copy ( fixed_source ) fix = FixPEP8 ( filename , options , contents = tmp_source , long_line_ignore_cache = long_line_ignore_cache ) fixed_source = fix . fix ( ) sio = io . StringIO ( fixed_source ) return u'' . join ( normalize_line_endings ( sio . readlines ( ) , original_newline ) )
return fixed source code .