code: def _resolve_periods_in_year(scale, frame):
      
      if scale is None:
          return periodicity(frame)
      elif isinstance(scale, basestring):
          return periodicity(scale)
      elif np.isscalar(scale):
          return scale
      else:
          raise ValueError("scale must be None, scalar, or string, not %s" % type(scale))
docs: Convert the scale to an annualzation factor.  If scale is None then attempt to resolve from frame. If scale is a scalar then
          use it. If scale is a string then use it to lookup the annual factor