code: def from_dict(self, dirent):
          
          # Check that we have at least as much data as the __init__ requires
          for k in ['perms', 'owner', 'group', 'name', 'dir']:
              if k not in dirent:
                  raise ValueError("Need required key '{k}'".format(k=k))
          # Copy all values across
          for k in dirent:
              setattr(self, k, dirent[k])
          # Create perms parts
          self.perms_owner = self.perms[0:3]
          self.perms_group = self.perms[3:6]
          self.perms_other = self.perms[6:9]
          return self
docs: Create a new FilePermissions object from the given dictionary.  This
          works with the FileListing parser class, which has already done the
          hard work of pulling many of these fields out.  We create an object
          with all the dictionary keys available as properties, and also split
          the ``perms`` string up into owner, group