code: def calculate_cardinality(
          angle,
          earthquake_hazard=None,
          place_exposure=None
  ):
      
      # this method could still be improved later, since the acquisition interval
      # is a bit strange, i.e the input angle of 22.499° will return `N` even
      # though 22.5° is the direction for `NNE`
      _ = earthquake_hazard, place_exposure  # NOQA
  
      direction_list = tr(
          'N,NNE,NE,ENE,E,ESE,SE,SSE,S,SSW,SW,WSW,W,WNW,NW,NNW'
      ).split(',')
  
      bearing = float(angle)
      direction_count = len(direction_list)
      direction_interval = 360. / direction_count
      index = int(floor(bearing / direction_interval))
      index %= direction_count
      return direction_list[index]
docs: Simple postprocessor where we compute the cardinality of an angle.
  
      :param angle: Bearing angle.
      :type angle: float
  
      :param earthquake_hazard: The hazard to use.
      :type earthquake_hazard: str
  
      :param place_exposure: The exposure to use.
      :type place_exposure: str
  
      :return: Cardinality text.
      :rtype: str