code: def translate_purposes(f):
      
      @wraps(f)
      def wr(r, pc):
          tmp = []
          for P in r["purposes"]:
              try:
                  tmp.append(POSTCODE_API_TYPEDEFS_PURPOSES[P])
              except:
                  logger.warning("Warning: {}: "
                                 "cannot translate 'purpose': {}".format(pc, P))
                  tmp.append(P)
  
          r.update({"purposes": tmp})
          return f(r, pc)
  
      return wr
docs: decorator to translate the purposes field.
  
      translate the values of the purposes field of the API response into
      translated values.