code: def setup_logging(args):
      project_name = args.model_ckpt.split("/")[-1]
      logger = logging.getLogger(__name__)
      log_dir = Path(args.save_dir) / "log/"
      log_dir.mkdir(exist_ok=True)
      filename = f"debug_{accelerator.process_index}.log"
      logging.basicConfig(
          format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
          datefmt="%m/%d/%Y %H:%M:%S",
          level=logging.INFO,
          handlers=[
              logging.FileHandler(log_dir / filename),
              logging.StreamHandler(),
          ],
      )
      if (
          accelerator.is_main_process
      ):  # we only want to setup logging once
          accelerator.init_trackers(project_name, vars(args))
          run_name = accelerator.trackers[0].run.name
          logger.setLevel(logging.INFO)
          datasets.utils.logging.set_verbosity_info()
          transformers.utils.logging.set_verbosity_info()
      else:
          run_name = ""
          logger.setLevel(logging.ERROR)
          datasets.utils.logging.set_verbosity_error()
          transformers.utils.logging.set_verbosity_error()
      return logger, run_name
  
imports: import logging
  import os
  import time
  from argparse import Namespace
  from pathlib import Path
  import datasets
  import torch
  from datasets import load_dataset
  from torch.optim import AdamW
  from torch.utils.data import IterableDataset
  from torch.utils.data.dataloader import DataLoader
  from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
  import transformers
  from accelerate import Accelerator, DistributedType
  from arguments import TrainingArguments
  from huggingface_hub import Repository
  from transformers import AutoModelForCausalLM, AutoTokenizer, HfArgumentParser, get_scheduler, set_seed
label_desc: Use image node_id 1 for calling a global function with example usage: setup_logging(args) and returns: logger,  run_name