<commit_before># -*- encoding: utf-8 -*-
import requests
import os

from flask_restful import Resource

import os, sys
sys.path.append(os.path.abspath('..'))

from api.base import BaseForAPIGW
from api_gateway.settings import BACKEND_MOVIES_BASE_URL


class BaseForMoviesAPIGW(BaseForAPIGW):
    def __init__(self):
        self.base_url = BACKEND_MOVIES_BASE_URL
        self.api_key_query = ''


class MovieList(BaseForMoviesAPIGW, Resource):
    def get(self):
        resource = '/movies/'
        objects = self.response_text_from_request(resource)
        return text


class MoviesLatest(BaseForMoviesAPIGW, Resource):
    def get(self):
        resource = '/movies/latest/'
        objects = self.response_text_from_request(resource)
        return objects


class MoviesHighGrade(BaseForMoviesAPIGW, Resource):
    def get(self):
        resource = '/movies/grade/'
        objects = self.response_text_from_request(resource)
        return objects


def add_resources(api):
    api.add_resource(MovieList, '/movies/')
    api.add_resource(MoviesLatest, '/movies/latest/')
    api.add_resource(MoviesHighGrade, '/movies/grade/')
    
    return api<commit_msg>genre movie query 5 limit<commit_after># -*- encoding: utf-8 -*-
import requests
import os

from flask_restful import Resource

import os, sys
sys.path.append(os.path.abspath('..'))

from api.base import BaseForAPIGW
from api_gateway.settings import BACKEND_MOVIES_BASE_URL


class BaseForMoviesAPIGW(BaseForAPIGW):
    def __init__(self):
        self.base_url = BACKEND_MOVIES_BASE_URL
        self.api_key_query = ''


class MovieList(BaseForMoviesAPIGW, Resource):
    def get(self):
        resource = '/movies/'
        objects = self.response_text_from_request(resource)
        return objects


class MoviesLatest(BaseForMoviesAPIGW, Resource):
    def get(self):
        resource = '/movies/latest/'
        objects = self.response_text_from_request(resource)
        return objects


class MoviesHighGrade(BaseForMoviesAPIGW, Resource):
    def get(self):
        resource = '/movies/grade/'
        objects = self.response_text_from_request(resource)
        return objects


class GenreList(BaseForMoviesAPIGW, Resource):
    def get(self):
        resource = '/movies/genres/'
        objects = self.response_text_from_request(resource)
        return objects

   
class GenreMovieList(BaseForMoviesAPIGW, Resource):
    def get(self, name):
        resource = '/movies/genres/%s/' % name
        objects = self.response_text_from_request(resource)
        return objects


def add_resources(api):
    api.add_resource(MovieList, '/movies/')
    api.add_resource(MoviesLatest, '/movies/latest/')
    api.add_resource(MoviesHighGrade, '/movies/grade/')
    api.add_resource(GenreList, '/movies/genres/')
    api.add_resource(GenreMovieList, '/movies/genres/<string:name>/')
    
    return api
{'fraction_non_alphanumeric': 0.10299234516353514, 'fraction_numerical': 0.0010438413361169101, 'mean_word_length': 3.4712286158631414, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1327174', 'n_tokens_mistral': 953, 'n_tokens_neox': 907, 'n_words': 177}