code: def _clip_gradients_by_norm(grads_and_vars, clip_gradients):
      """Clips gradients by global norm."""
      gradients, variables = zip(*grads_and_vars)
      clipped_gradients, _ = tf.clip_by_global_norm(
          gradients, clip_gradients
      )
      return list(zip(clipped_gradients, variables))
  
file_path: finetune/finetune/util/optimize_loss.py
imports: import logging
  import tensorflow
  from finetune.optimizers.adafactor import AdafactorOptimizer
  from finetune.optimizers.gradient_accumulation import get_grad_accumulation_optimizer
  from finetune.optimizers.learning_rate_schedules import schedules
  from finetune.optimizers.weight_decay import AdamW
label_desc: Use image node_id 1 for calling a global function with example usage: _clip_gradients_by_norm(grads_and_vars, clip_gradients) and returns: list