code: def makedirs(path, mode=0o777):
      
      try:
          os.makedirs(path, mode)
          return True
      except OSError as e:
          if e.errno != errno.EEXIST:
              # We don't want to swallow errors other than EEXIST,
              # because we could be obscuring a real problem.
              raise
          return False
docs: Create a directory if it doesn't already exist (keeping concurrency in mind).
  
      :param path: The pathname of the directory to create (a string).
      :param mode: The mode to apply to newly created directories (an integer,
                   defaults to the octal number ``0777``).
      :returns: :data:`True` when the directory was created, :data:`False` if it already
                existed.
      :raises: Any exceptions raised by :func:`os.makedirs()` except for
               :data:`errno.EEXIST` (this error is swallowed and :data:`False` is
               returned instead).