code: def mkdir(path):
      
      try:
          os.makedirs(path)
          # sanity check
          if not os.path.isdir(path):  # pragma: no cover
              raise IOError('path is not a directory')
      except OSError as e:
          # EEXIST
          if e.errno == 17 and os.path.isdir(path):
              return
          raise
docs: Make a directory and its parents.
  
      Args:
          path (str): path to create
  
      Returns:
          None
  
      Raises:
          OSError if the directory cannot be created.