code: def make_directory(path):
      
      if not os.path.exists(path):
          # concurrent writes that try to create the same dir can fail
          try:
              os.makedirs(path)
  
          except OSError as e:
              if e.errno == errno.EEXIST:
                  pass
              else:
                  raise e
docs: Make a directory and any intermediate directories that don't already
      exist. This function handles the case where two threads try to create
      a directory at once.