code: def read_current_user(
      current_user: Optional[User] = Depends(get_current_user),
  ):
      if current_user is None:
          return {"msg": "Create an account first"}
      return current_user
  
file_path: fastapi/tests/test_security_api_key_header_optional.py
imports: from typing import Optional
  from fastapi import Depends, FastAPI, Security
  from fastapi.security import APIKeyHeader
  from fastapi.testclient import TestClient
  from pydantic import BaseModel
label_desc: Use image node_id 2 for calling a global function with example usage: read_current_user(current_user) and returns: current_user, dict