code: def update_target_variables(
      target_variables,
      source_variables,
      tau=1.0,
      use_locking=False,
      name="update_target_variables",
  ):
      """Returns an op to update a list of target variables from source variables.
  
      The update rule is:
      `target_variable = (1 - tau) * target_variable + tau * source_variable`.
  
      Args:
        target_variables: a list of the variables to be updated.
        source_variables: a list of the variables used for the update.
        tau: weight used to gate the update. The permitted range is 0 < tau <= 1,
          with small tau representing an incremental update, and tau == 1
          representing a full update (that is, a straight copy).
        use_locking: use `tf.Variable.assign`'s locking option when assigning
          source variable values to target variables.
        name: sets the `name_scope` for this op.
  
      Raises:
        TypeError: when tau is not a Python float
        ValueError: when tau is out of range, or the source and target variables
          have different numbers or shapes.
  
      Returns:
        An op that executes all the variable updates.
      """
      if not isinstance(tau, float) and not tf.is_tensor(tau):
          raise TypeError(
              "Tau has wrong type (should be float) {}".format(tau)
          )
      if not tf.is_tensor(tau) and not 0.0 < tau <= 1.0:
          raise ValueError("Invalid parameter tau {}".format(tau))
      if len(target_variables) != len(source_variables):
          raise ValueError(
              "Number of target variables {} is not the same as "
              "number of source variables {}".format(
                  len(target_variables), len(source_variables)
              )
          )
  
      same_shape = all(
          trg.get_shape() == src.get_shape()
          for trg, src in zip(target_variables, source_variables)
      )
      if not same_shape:
          raise ValueError(
              "Target variables don't have the same shape as source "
              "variables."
          )
  
      def update_op(target_variable, source_variable, tau):
          if tau == 1.0:
              return target_variable.assign(
                  source_variable, use_locking
              )
          else:
              return target_variable.assign(
                  tau * source_variable + (1.0 - tau) * target_variable,
                  use_locking,
              )
  
      with tf.name_scope(
          name, values=target_variables + source_variables
      ):
          update_ops = [
              update_op(target_var, source_var, tau)
              for target_var, source_var in zip(
                  target_variables, source_variables
              )
          ]
          return tf.group(name="update_all_variables", *update_ops)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow.compat.v1
  from trfl import periodic_ops
label_desc: Use image node_id 1 for calling a global function with example usage: update_target_variables(target_variables, source_variables, tau, use_locking, name) and returns: tf, target_variable, target_variable