def course_discovery_api_client(user, catalog_url):
if JwtBuilder is None:<EOL><INDENT>raise NotConnectedToOpenEdX(<EOL>_("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>)<EOL><DEDENT>jwt = JwtBuilder.create_jwt_for_user(user)<EOL>return EdxRestApiClient(catalog_url, jwt=jwt)<EOL>
Return a Course Discovery API client setup with authentication for the specified user.