code: def parse_utc_date_with_limit(
      date_str: str, max_window_in_days: int = None
  ) -> dt.datetime:
      """Parses common date string formats to UTC datetime objects."""
      date = parse_local_date(date_str)
  
      # Convert date to UTC
      date_utc = date.astimezone(pytz.utc)
  
      # If max_window_in_days is provided, apply the logic
      if max_window_in_days is not None:
          # Get the current UTC time
          now_utc = dt.datetime.utcnow().replace(tzinfo=pytz.utc)
          # Check if the parsed date is earlier than the maximum window allowed
          max_window_date = now_utc - dt.timedelta(
              days=max_window_in_days
          )
          if date_utc < max_window_date:
              return max_window_date
      return date_utc
  
imports: import datetime
  import pytz
  import re
label_desc: Use image node_id 2 for calling a global function with example usage: parse_utc_date_with_limit(date_str, max_window_in_days) and returns: date_utc, max_window_date