code: def _week_day_mappers(weekend_mask):
      """Creates functions to map from ordinals to week days and inverse.
  
      Creates functions to map from ordinal space (i.e. days since 31 Dec 0) to
      week days. The function assigns the value of 0 to the first non weekend
      day in the week starting on Sunday, 31 Dec 1 through to Saturday, 6 Jan 1 and
      the value assigned to each successive work day is incremented by 1. For a day
      that is not a week day, this count is not incremented from the previous week
      day (hence, multiple ordinal days may have the same week day value).
  
      Args:
        weekend_mask: A bool `Tensor` of length 7 or None. The weekend mask.
  
      Returns:
        A tuple of callables.
          `forward`: Takes one `Tensor` argument containing ordinals and returns a
            tuple of two `Tensor`s of the same shape as the input. The first
            `Tensor` is of type `int32` and contains the week day value. The second
            is a bool `Tensor` indicating whether the supplied ordinal was a weekend
            day (i.e. True where the day is a weekend day and False otherwise).
          `backward`: Takes one int32 `Tensor` argument containing week day values
            and returns an int32 `Tensor` containing ordinals for those week days.
      """
      if weekend_mask is None:
          default_forward = lambda x: (
              x,
              tf.zeros_like(x, dtype=tf.bool),
          )
          identity = lambda x: x
          return default_forward, identity
      weekend_mask = tf.convert_to_tensor(weekend_mask, dtype=tf.bool)
      weekend_mask = tf.roll(weekend_mask, -_DAYOFWEEK_0, axis=0)
      weekday_mask = tf.logical_not(weekend_mask)
      weekday_offsets = tf.cumsum(tf.cast(weekday_mask, dtype=tf.int32))
      num_workdays = weekday_offsets[-1]
      weekday_offsets -= 1  # Adjust the first workday to index 0.
      ordinal_offsets = tf.convert_to_tensor(
          [0, 1, 2, 3, 4, 5, 6], dtype=tf.int32
      )
      ordinal_offsets = ordinal_offsets[weekday_mask]
  
      def forward(ordinals):
          """Adjusts the ordinals by removing the number of weekend days so far."""
          mod, remainder = ordinals // 7, ordinals % 7
          weekday_values = mod * num_workdays + tf.gather(
              weekday_offsets, remainder
          )
          is_weekday = tf.gather(weekday_mask, remainder)
          return weekday_values, is_weekday
  
      def backward(weekday_values):
          """Converts from weekend adjusted values to ordinals."""
          return (weekday_values // num_workdays) * 7 + tf.gather(
              ordinal_offsets, weekday_values % num_workdays
          )
  
      return forward, backward
  
label_desc: Use image node_id 2 for calling a global function with example usage: _week_day_mappers(weekend_mask) and returns: forward,  backward, default_forward,  identity, weekday_values,  is_weekday, unknown