code: def _get_number_from_fmt(fmt):
      
      if '%' in fmt:
          # its datetime
          return len(("{0:" + fmt + "}").format(dt.datetime.now()))
      else:
          # its something else
          fmt = fmt.lstrip('0')
          return int(re.search('[0-9]+', fmt).group(0))
docs: Helper function for extract_values,
      figures out string length from format string.