code: def __create_dir_property(self, dir_name, docstring):
          
          property_name = "{}_dir".format(dir_name)
          private_name = "_" + property_name
          setattr(self, private_name, None)
  
          def fget(self):
              return getattr(self, private_name)
  
          def fset(self, path):
              verify_dir(path, dir_name)
              setattr(self, private_name, path)
  
          p = property(fget=fget, fset=fset, doc=docstring)
          setattr(self.__class__, property_name, p)
docs: Generate getter and setter for a directory property.