@decorator<EOL>def api_token_required(f, *args, **kwargs):
try:<EOL><INDENT>if args[<NUM_LIT:0>].api_token is None:<EOL><INDENT>raise AttributeError('<STR_LIT>')<EOL><DEDENT><DEDENT>except AttributeError:<EOL><INDENT>raise AttributeError('<STR_LIT>')<EOL><DEDENT>return f(*args, **kwargs)<EOL>
Decorator helper function to ensure some methods aren't needlessly called
without an api_token configured.