code: def get_query_for_span(pattern: str, span: int) -> str:
      """Return query with timestamp placeholders filled."""
      # TODO(b/179853017): make UNIX_EPOCH_DATE_UTC timezone configurable.
      begin = UNIX_EPOCH_DATE_UTC + datetime.timedelta(days=span)
      end = begin + datetime.timedelta(days=1)
      pattern = pattern.replace(
          SPAN_BEGIN_TIMESTAMP, str(int(begin.timestamp()))
      )
      pattern = pattern.replace(
          SPAN_END_TIMESTMAP, str(int(end.timestamp()))
      )
      pattern = pattern.replace(
          SPAN_YYYYMMDD_UTC,
          begin.astimezone(datetime.timezone.utc).strftime("'%Y%m%d'"),
      )
      return pattern
  
imports: import datetime
  import os
  import re
  from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
  from absl import logging
  import numpy
  from tfx.dsl.io import fileio
  from tfx.proto import example_gen_pb2
  from tfx.proto import range_config_pb2
  from tfx.utils import io_utils
  from google.protobuf import json_format
  from tensorflow.core.example import example_pb2
  from tensorflow.core.example import feature_pb2
label_desc: Use image node_id 12 for calling a global function with example usage: get_query_for_span(pattern, span) and returns: pattern