parameters: (self, dir_name, mode=PERM_DEF)
docstring: Create a leaf Fake directory + create any non-existent parent dirs.
  
      Args:
        dir_name: (str) Name of directory to create.
        mode: (int) Mode to create directory (and any necessary parent
          directories) with. This argument defaults to 0o777.  The umask is
          applied to this mode.
  
      Raises:
        OSError: if the directory already exists or as per
        FakeFilesystem.CreateDirectory
docstring_summary: Create a leaf Fake directory + create any non-existent parent dirs.
docstring_tokens: Create a leaf Fake directory + create any non - existent parent dirs .
function: def makedirs(self, dir_name, mode=PERM_DEF):
      """Create a leaf Fake directory + create any non-existent parent dirs.
  
      Args:
        dir_name: (str) Name of directory to create.
        mode: (int) Mode to create directory (and any necessary parent
          directories) with. This argument defaults to 0o777.  The umask is
          applied to this mode.
  
      Raises:
        OSError: if the directory already exists or as per
        FakeFilesystem.CreateDirectory
      """
      dir_name = self.filesystem.NormalizePath(dir_name)
      path_components = self.filesystem.GetPathComponents(dir_name)
  
      # Raise a permission denied error if the first existing directory is not
      # writeable.
      current_dir = self.filesystem.root
      for component in path_components:
        if component not in current_dir.contents:
          if not current_dir.st_mode & PERM_WRITE:
            raise OSError(errno.EACCES, 'Permission Denied', dir_name)
          else:
            break
        else:
          current_dir = current_dir.contents[component]
  
      self.filesystem.CreateDirectory(dir_name, mode & ~self.filesystem.umask)
function_tokens: def makedirs ( self , dir_name , mode = PERM_DEF ) : dir_name = self . filesystem . NormalizePath ( dir_name ) path_components = self . filesystem . GetPathComponents ( dir_name ) # Raise a permission denied error if the first existing directory is not # writeable. current_dir = self . filesystem . root for component in path_components : if component not in current_dir . contents : if not current_dir . st_mode & PERM_WRITE : raise OSError ( errno . EACCES , 'Permission Denied' , dir_name ) else : break else : current_dir = current_dir . contents [ component ] self . filesystem . CreateDirectory ( dir_name , mode & ~ self . filesystem . umask )