The for loop is for the gradient descent update which is manually implemented in the example. Parameters are reduced by their gradient times learning rate.
To your first question, if you are referring to Pascanu et al. clipping which is based on the norm of the gradient, then torch.nn.utils.clip_grad_norm does that for you. The clipping threshold is usually tuned as a hyperparameter as there is no way to determine what the norm of the gradients would be through the training.