def main(argv):
  flags = common_flags.ParseFlags(argv,
                                  'List token info about a user and client.',
                                  AddFlags)
  http = auth_helper.GetAuthorizedHttp(flags)
  user_api = users_api.UsersApiWrapper(http)
  if not user_api.IsDomainUser(flags.user_email):
    print 'User %s not found.' % flags.user_email
    sys.exit(1)
  apps_security_api = tokens_api.TokensApiWrapper(http)
  try:
    apps_security_api.PrintTokenForUserClientId(flags.user_email,
                                                flags.client_id,
                                                flags.long_list)
  except admin_api_tool_errors.AdminAPIToolTokenRequestError as e:
    log_utils.LogError(
        'Unable to retrieve tokens for user %s.' % flags.user_email, e)
    sys.exit(1)
A script to test Apps Security APIs.
dataset/ETHPy150Open google/gfw-toolkit/toolkit/cmds/ls_tokens_for_user_clientid.py/main