def message_from_file(fp, *args, **kws):
 from email.parser import Parser
 return Parser(*args, **kws).parse(fp)

def message_from_file ( fp , * args , ** kws ) : from email . parser import Parser return Parser ( * args , ** kws ) . parse ( fp )
read a file and parse its contents into a message object model .