def get_infile(filename):
 if filename.endswith('.gz'):
  fin = GzipFile(filename, 'rb')
 else:
  fin = open(filename, 'U')
 return fin

def get_infile ( filename ) : if filename . endswith ( '.gz' ) : fin = GzipFile ( filename , 'rb' ) else : fin = open ( filename , 'U' ) return fin
returns filehandle .