code: def chown(path, user=None, group=None):
      
      import os
      import pwd
      import grp
      uid = pwd.getpwnam(user).pw_uid if user else -1
      gid = grp.getgrnam(group).gr_gid if group else -1
      return os.chown(path, uid, gid)
docs: change ownership of path