code: def to_utc(df):
      
  
      try:
          df.index = df.index.tz_localize('UTC')
      except TypeError:
          df.index = df.index.tz_convert('UTC')
  
      return df
docs: For use in tests; applied UTC timestamp to DataFrame.