code: def response_from_prediction(self, y_pred, single=True):
          
          result = y_pred.tolist()
          if single:
              result = result[0]
          response = {
              'metadata': get_metadata(),
              'result': result,
              }
          return make_ujson_response(response, status_code=200)
docs: Turns a model's prediction in *y_pred* into a JSON
          response.