code: def delete(method, hmc, uri, uri_parms, logon_required):
          
          try:
              user = hmc.lookup_by_uri(uri)
          except KeyError:
              raise InvalidResourceError(method, uri)
          # Check user type
          type_ = user.properties['type']
          if type_ == 'pattern-based':
              raise BadRequestError(
                  method, uri, reason=312,
                  message="Cannot delete pattern-based user {!r}".
                  format(user.name))
          # Delete the mocked resource
          user.manager.remove(user.oid)
docs: Operation: Delete User.