class_docstr: Log OpenAI fine-tunes to [Weights & Biases](https://wandb.me/openai-docs).
class_docstr_tok: ["Log","OpenAI","fine-tunes","to","[","Weights","&","Biases","]","(","https",":","\/\/wandb.me\/openai-docs",")","."]
code: def _ensure_logged_in(cls):
      if not cls._logged_in:
          if wandb.login():
              cls._logged_in = True
          else:
              raise Exception(
                  "It appears you are not currently logged in to Weights & Biases. "
                  "Please run `wandb login` in your terminal. "
                  "When prompted, you can obtain your API key by visiting wandb.ai/authorize."
              )
  
imports: import datetime
  import io
  import json
  import re
  import time
  from typing import Any, Dict, Optional, Tuple
  from pkg_resources import parse_version
  import wandb
  from wandb import util
  from wandb.data_types import Table
  from wandb.sdk.lib import telemetry
  from wandb.sdk.wandb_run import Run
  from openai import OpenAI
  from openai.types.fine_tuning import FineTuningJob
  from openai.types.fine_tuning.fine_tuning_job import Hyperparameters
label_desc: Use image node_id 4 for calling the WandbLogger obj's underlying member method code with example usage: obj._ensure_logged_in(cls) without return types