@click.command('<STR_LIT>', short_help='<STR_LIT>')<EOL>@click.option('<STR_LIT>',<EOL>help='<STR_LIT>'<EOL>)<EOL>@click.option('<STR_LIT>', '<STR_LIT>',<EOL>help='<STR_LIT>'<EOL>)<EOL>@click.option('<STR_LIT>', '<STR_LIT>',<EOL>is_flag=True,<EOL>help='<STR_LIT>'<EOL>)<EOL>@click.option('<STR_LIT>', '<STR_LIT>',<EOL>is_flag=True,<EOL>help='<STR_LIT>'<EOL>)<EOL>@click.option('<STR_LIT>',<EOL>is_flag=True,<EOL>help='<STR_LIT>'<EOL>)<EOL>@click.option('<STR_LIT>',<EOL>is_flag=True,<EOL>help='<STR_LIT>'<EOL>)<EOL>@click.option('<STR_LIT>',<EOL>is_flag=True,<EOL>help='<STR_LIT>'<EOL>)<EOL>@click.option('<STR_LIT>', '<STR_LIT>',<EOL>type=click.Choice(CASE_STATUSES),<EOL>help='<STR_LIT>'<EOL>)<EOL>@json_option<EOL>@click.pass_context<EOL>def cases(context, case_id, institute, reruns, finished, causatives, research_requested,<EOL>is_research, status, json):
adapter = context.obj['<STR_LIT>']<EOL>models = []<EOL>if case_id:<EOL><INDENT>case_obj = adapter.case(case_id=case_id)<EOL>if case_obj:<EOL><INDENT>models.append(case_obj)<EOL><DEDENT>else:<EOL><INDENT>LOG.info("<STR_LIT>".format(case_id))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>models = adapter.cases(collaborator=institute, reruns=reruns,<EOL>finished=finished, has_causatives=causatives,<EOL>research_requested=research_requested,<EOL>is_research=is_research, status=status)<EOL>models = [case_obj for case_obj in models]<EOL>if len(models) == <NUM_LIT:0>:<EOL><INDENT>LOG.info("<STR_LIT>")<EOL><DEDENT><DEDENT>if json:<EOL><INDENT>click.echo(dumps(models))<EOL>return<EOL><DEDENT>for model in models:<EOL><INDENT>pp(model)<EOL><DEDENT>
Interact with cases existing in the database.