def read(self, params, args, data):
result_count = None<EOL>result_links = None<EOL>if params is None:<EOL><INDENT>params = []<EOL><DEDENT>if args:<EOL><INDENT>args = args.copy()<EOL><DEDENT>else:<EOL><INDENT>args = {}<EOL><DEDENT>ctx = self._create_context(params, args, data)<EOL>row_id = ctx.get_row_id()<EOL>if not row_id:<EOL><INDENT>self._transform_list_args(args)<EOL>if '<STR_LIT>' in args or '<STR_LIT>' in args:<EOL><INDENT>ctx = self._create_context(params, args, data)<EOL>result_count = self._get_collection_count(ctx)<EOL><DEDENT>if '<STR_LIT>' in args:<EOL><INDENT>result_links = _get_link_pages(<EOL>page=args['<STR_LIT>'],<EOL>per_page=int(args['<STR_LIT>']),<EOL>count=result_count,<EOL>page_url=request.url<EOL>)<EOL><DEDENT>if '<STR_LIT>' not in args:<EOL><INDENT>args['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT><DEDENT>self._create_related(args)<EOL>try:<EOL><INDENT>return ResourceResult(<EOL>body=super(JsonServerResource, self).read(params, args, data),<EOL>count=result_count,<EOL>links=result_links<EOL>)<EOL><DEDENT>except NoResultFound:<EOL><INDENT>return NOT_FOUND<EOL><DEDENT>
Modifies the parameters and adds metadata for read results.