code: def get_num_days_required(offset, period='d', perc_required=0.90):
      
      x = pd.to_datetime('2010-01-01')
      delta = x - (x - offset)
      # convert to 'trading days' - rough guestimate
      days = delta.days * 0.69
  
      if period == 'd':
          req = days * perc_required
      elif period == 'm':
          req = (days / 20) * perc_required
      elif period == 'y':
          req = (days / 252) * perc_required
      else:
          raise NotImplementedError(
              'period not supported. Supported periods are d, m, y')
  
      return req
docs: Estimates the number of days required to assume that data is OK.
  
      Helper function used to determine if there are enough "good" data
      days over a given period.
  
      Args:
          * offset (DateOffset): Offset (lookback) period.
          * period (str): Period string.
          * perc_required (float): percentage of number of days
              expected required.