code: def logging(log_dir, s, print_=True, log_=True):
      if print_:
          print(s)
      if log_dir != "" and log_:
          with open(log_dir, "a+") as f_log:
              f_log.write(s + "\n")
  
file_path: DeepKE/example/re/few-shot/run.py
imports: from logging import debug
  import hydra
  from hydra.utils import get_original_cwd
  import numpy
  import torch
  from torch.utils.data.dataloader import DataLoader
  import yaml
  import time
  from transformers import AutoConfig, AutoModelForMaskedLM
  from transformers.optimization import get_linear_schedule_with_warmup
  import os
  from tqdm import tqdm
  from deepke.relation_extraction.few_shot import *
  import wandb
label_desc: Use image node_id 1 for calling a global function with example usage: logging(log_dir, s, print_, log_) without return types