def METHOD_NAME(args):
    if args.cache_file and os.path.exists(args.cache_file):
        mtime = os.path.getmtime(args.cache_file)
        if datetime.datetime.fromtimestamp(
            mtime
        ) < datetime.datetime.now() - datetime.timedelta(
            seconds=args.jwt_token_expiration_time
        ):
            os.remove(args.cache_file)
        else:
            print(pathlib.Path(args.cache_file).read_text(encoding="utf-8"))
    if args.pass_profile:
        application_id, private_key = get_from_pass(args.pass_profile)
    else:
        application_id, private_key = get_private_key(args.install_namespace)
    github_app = GitHub(
        private_key,
        application_id,
        expiration_time=args.jwt_token_expiration_time,
        github_api_url=args.api_url,
    )
    if args.jwt_token:
        print(github_app.jwt_token)
        sys.exit(0)
    if not args.installation_id:
        print(
            "You need to provide an installation id or have the -j flag to only generate jwt token"
        )
        sys.exit(1)
    github_app.token = github_app.get_token(args.installation_id)
    print(github_app.token)
    if args.cache_file:
        print(
            pathlib.Path(args.cache_file).write_text(
                str(github_app.token), encoding="utf-8"
            )
        )