code: def get_period_label(dt, data_frequency):
      """
      The period label for the specified date and frequency.
  
      Parameters
      ----------
      dt: datetime
      data_frequency: str
  
      Returns
      -------
      str
  
      """
      if data_frequency == "minute":
          return "{}-{:02d}".format(dt.year, dt.month)
      else:
          return "{}".format(dt.year)
  
file_path: catalyst/catalyst/exchange/utils/datetime_utils.py
imports: import calendar
  import math
  import re
  from datetime import datetime, timedelta, date
  import pandas
  import pytz
  from catalyst.exchange.exchange_errors import InvalidHistoryFrequencyError, InvalidHistoryFrequencyAlias
label_desc: Use image node_id 7 for calling a global function with example usage: get_period_label(dt, data_frequency) and returns: str, str