@main.command()<EOL>@click.argument('<STR_LIT:title>', required=True, type=text)<EOL>@click.argument('<STR_LIT:body>', required=False, type=text)<EOL>@click.option('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', envvar='<STR_LIT>', type=text)<EOL>@click.option('<STR_LIT>', '<STR_LIT>', type=click.INT)<EOL>@click.option('<STR_LIT>', '<STR_LIT>', type=click.Choice(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']))<EOL>@click.option('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', type=text)<EOL>@click.option('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', type=click.File('<STR_LIT:rb>'))<EOL>@click.option('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', default=False)<EOL>@click.pass_context<EOL>def keyword(ctx, app_id, body_file, json_flag,<EOL>title, body, max_num, forcus, request_id):<EOL>
app_id = clean_app_id(app_id)<EOL>body = clean_body(body, body_file)<EOL>api = GoolabsAPI(app_id)<EOL>ret = api.keyword(<EOL>title=title,<EOL>body=body,<EOL>max_num=max_num,<EOL>forcus=forcus,<EOL>request_id=request_id,<EOL>)<EOL>if json_flag:<EOL><INDENT>click.echo(format_json(api.response.json()))<EOL>return<EOL><DEDENT>for k in ret['<STR_LIT>']:<EOL><INDENT>k = dict((key.encode('<STR_LIT:utf-8>'), k[key]) for key in k.keys())<EOL>for keyword, score in six.iteritems(k):<EOL><INDENT>click.echo(u'<STR_LIT>'.format(text(keyword), score))<EOL><DEDENT><DEDENT>
Extract "keywords" from an input document.