<s> from __future__ import absolute_import , unicode_literals , division <EOL> import logging <EOL> import psd_tools . reader . header <EOL> import psd_tools . reader . color_mode_data <EOL> import psd_tools . reader . image_resources <EOL> import psd_tools . reader . layers <EOL> from psd_tools . debug import pretty_namedtuple <EOL> logger = logging . getLogger ( __name__ ) <EOL> ParseResult = pretty_namedtuple ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ) <EOL> def parse ( fp , encoding = '<STR_LIT:utf8>' ) : <EOL> header = psd_tools . reader . header . read ( fp ) <EOL> return ParseResult ( <EOL> header , <EOL> psd_tools . reader . color_mode_data . read ( fp ) , <EOL> psd_tools . reader . image_resources . read ( fp , encoding ) , <EOL> psd_tools . reader . layers . read ( fp , encoding , header . depth ) , <EOL> psd_tools . reader . layers . read_image_data ( fp , header ) <EOL> ) </s>
