code: def get_direction(self, direction, rev=False):
          
          if (direction < 90.0) or (direction >= 270.0):
              if not rev:
                  return 'up'
              else:
                  return 'down'
          elif (90.0 <= direction < 270.0):
              if not rev:
                  return 'down'
              else:
                  return 'up'
          else:
              return 'none'
docs: Translate a direction in compass degrees into 'up' or 'down'.