code: def from_path(cls, path: pathlib.Path) -> 'Entity':
          
          if path.is_file():
              return File.from_path(path)
          return Directory.from_path(path)
docs: Create an entity from a local path.
  
          :param path: The path to the entity, either a file or directory.
          :return: An entity instance representing the path.