code: def is_valid_frequency(frequency):
      assert isinstance(frequency, int)
      assert frequency > 1
  
      if frequency < bar.Frequency.DAY:
          ret = True
      elif frequency == bar.Frequency.DAY:
          ret = True
      elif frequency == bar.Frequency.MONTH:
          ret = True
      else:
          ret = False
      return ret
  
imports: import abc
  import datetime
  import six
  from pyalgotrade.utils import dt
  from pyalgotrade import bar
label_desc: Use image node_id 1 for calling a global function with example usage: is_valid_frequency(frequency) and returns: ret