def read(self, obj):
path, frag = [], obj<EOL>for part in self.parts:<EOL><INDENT>path.append(part)<EOL>if isinstance(frag, dict):<EOL><INDENT>try:<EOL><INDENT>frag = frag[part]<EOL><DEDENT>except KeyError as error:<EOL><INDENT>raise NotFound('<STR_LIT::>'.join(path)) from error<EOL><DEDENT><DEDENT>elif isinstance(frag, (list, tuple)):<EOL><INDENT>try:<EOL><INDENT>frag = frag[int(part)]<EOL><DEDENT>except IndexError as error:<EOL><INDENT>raise NotFound('<STR_LIT::>'.join(path)) from error<EOL><DEDENT>except ValueError as error:<EOL><INDENT>raise WrongType('<STR_LIT::>'.join(path)) from error<EOL><DEDENT><DEDENT>elif isinstance(frag, (str, int)):<EOL><INDENT>raise WrongType('<STR_LIT::>'.join(path))<EOL><DEDENT>else:<EOL><INDENT>raise NotFound('<STR_LIT::>'.join(path))<EOL><DEDENT><DEDENT>return frag<EOL>
Returns
    object: fragment