code: def winddir_text(pts):
      "Convert wind direction from 0..15 to compass point text"
      global _winddir_text_array
      if pts is None:
          return None
      if not isinstance(pts, int):
          pts = int(pts + 0.5) % 16
      if not _winddir_text_array:
          _ = pywws.localisation.translation.ugettext
          _winddir_text_array = (
              _(u'N'), _(u'NNE'), _(u'NE'), _(u'ENE'),
              _(u'E'), _(u'ESE'), _(u'SE'), _(u'SSE'),
              _(u'S'), _(u'SSW'), _(u'SW'), _(u'WSW'),
              _(u'W'), _(u'WNW'), _(u'NW'), _(u'NNW'),
              )
      return _winddir_text_array[ptsf winddir_text(pts):
      "Convert wind direction from 0..15 to compass point text"
      global _winddir_text_array
      if pts is None:
          return None
      if not isinstance(pts, int):
          pts = int(pts + 0.5) % 16
      if not _winddir_text_array:
          _ = pywws.localisation.translation.ugettext
          _winddir_text_array = (
              _(u'N'), _(u'NNE'), _(u'NE'), _(u'ENE'),
              _(u'E'), _(u'ESE'), _(u'SE'), _(u'SSE'),
              _(u'S'), _(u'SSW'), _(u'SW'), _(u'WSW'),
              _(u'W'), _(u'WNW'), _(u'NW'), _(u'NNW'),
              )
      return _winddir_text_array[pts]
docs: Convert wind direction from 0..15 to compass point text