code: def is_leap_year(years):
      """Calculates whether years are leap years.
  
      Args:
        years: Tensor of int32 type. Elements should be positive.
  
      Returns:
        Tensor of bool type.
      """
      years = tf.convert_to_tensor(years, tf.int32)
  
      def divides_by(n):
          return tf.math.equal(years % n, 0)
  
      return tf.math.logical_and(
          divides_by(4),
          tf.math.logical_or(~divides_by(100), divides_by(400)),
      )
  
file_path: tf-quant-finance/tf_quant_finance/datetime/date_utils.py
imports: import tensorflow.compat.v2
label_desc: Use image node_id 5 for calling a global function with example usage: is_leap_year(years) and returns: tf, tf