code: def mkdir_p(path, log=True):
      """Create a directory for the specified path.
      Parameters
      ----------
      path : str
          Path name
      log : bool
          Whether to print result for directory creation
      """
      try:
          os.makedirs(path)
          if log:
              print("Created directory {}".format(path))
      except OSError as exc:
          if exc.errno == errno.EEXIST and os.path.isdir(path) and log:
              print("Directory {} already exists.".format(path))
          else:
              raise
  
imports: import datetime
  import errno
  import os
  import pickle
  import random
  from pprint import pprint
  import dgl
  import numpy
  import torch
  from dgl.data.utils import _get_dgl_url, download, get_download_dir
  from scipy import io, sparse
label_desc: Use image node_id 2 for calling a global function with example usage: mkdir_p(path, log) without return types