def _path(self, res_id=None, args=None, raw_args='<STR_LIT>'):<EOL>
if args:<EOL><INDENT>args = '<STR_LIT:?>' + urlencode(args)<EOL><DEDENT>else:<EOL><INDENT>args = '<STR_LIT>'<EOL><DEDENT>if args:<EOL><INDENT>args += '<STR_LIT:&>' + raw_args<EOL><DEDENT>elif raw_args:<EOL><INDENT>args = '<STR_LIT:?>' + raw_args<EOL><DEDENT>if res_id:<EOL><INDENT>return "<STR_LIT>".format(<EOL>path=self.PATH,<EOL>id_=res_id,<EOL>args=args<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>".format(<EOL>path=self.PATH,<EOL>args=args<EOL>)<EOL><DEDENT>
Generate a resource link

        :param res_id: resource id
        :param args: optional url arguments as {name: value}
        :param raw_args: url arguments in string, appended after args
        :return: url path for resource