code: def makedirs(path):
      
      if path:
          if not os.path.exists(path):
              log.debug("makedirs({})".format(path))
              os.makedirs(path)
          else:
              realpath = os.path.realpath(path)
              if not os.path.isdir(realpath):
                  raise ScriptWorkerException(
                      "makedirs: {} already exists and is not a directory!".format(path)
                  )
docs: Equivalent to mkdir -p.
  
      Args:
          path (str): the path to mkdir -p
  
      Raises:
          ScriptWorkerException: if path exists already and the realpath is not a dir.