code: def _num_days_in_month(month, year):
      """Returns number of days in a given month of a given year."""
      days_in_months = tf.constant(_DAYS_IN_MONTHS_COMBINED, tf.int32)
      is_leap = date_utils.is_leap_year(year)
      return tf.gather(
          days_in_months, month + 12 * tf.dtypes.cast(is_leap, tf.int32)
      )
  
imports: import collections.abc
  import datetime
  import numpy
  import tensorflow.compat.v2
  from tf_quant_finance.datetime import constants
  from tf_quant_finance.datetime import date_utils
  from tf_quant_finance.datetime import periods
  from tf_quant_finance.datetime import tensor_wrapper
label_desc: Use image node_id 1 for calling a global function with example usage: _num_days_in_month(month, year) and returns: tf