code: def is_fixed_duration(frequency):
      """Determines if a `pd.DateOffset` represents a fixed number of seconds."""
      # pylint: disable=unused-import,g-import-not-at-top
      import pandas as pd  # Defer import to avoid a package-level Pandas dep.
  
      # pylint: enable=unused-import,g-import-not-at-top
  
      # Most Pandas offsets define `self.nanos` if and only if they are
      # fixed-duration (this is checked below), but `pd.DateOffset` doesn't do
      # this for some reason, so handle this case explicitly.
      if (
          type(frequency) == pd.DateOffset
      ):  # pylint: disable=unidiomatic-typecheck
          if frequency.kwds.get("months", 0) != 0:
              return False
          if frequency.kwds.get("years", 0) != 0:
              return False
          return True
      # Handle custom frequencies like `pd.offsets.MonthsEnd()`.
      try:
          frequency.nanos
      except ValueError:
          return False
      return True
  
file_path: probability/tensorflow_probability/python/sts/internal/seasonality_util.py
imports: import collections
  import enum
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 7 for calling a global function with example usage: is_fixed_duration(frequency) and returns: True, True, False, False, False