<commit_before># pylint: disable=W0232
from django.conf.urls import url
from tastypie.resources import ModelResource
from tastypie.authentication import ApiKeyAuthentication
from tastypie.authorization import Authorization
from tastypie.exceptions import Unauthorized
from tastypie import fields
from . import models


class GameLibraryAuthorization(Authorization):
    def create_list(self, object_list, bundle):
        raise Unauthorized()

    def read_list(self, object_list, bundle):
        return object_list.filter(user=bundle.request.user)

    def delete_list(self, object_list, bundle):
        raise Unauthorized()


class GameResource(ModelResource):
    # pylint: disable=W0232, R0903
    class Meta:
        queryset = models.Game.objects.all()
        fields = ['name', 'slug', 'year', 'platforms', 'title_logo', 'icon',
                  'is_public', 'updated']
        allowed_methods = ['get']
        detail_uri_name = 'slug'

    def override_urls(self):
        return [
            url(r"^(?P<resource_name>%s)/(?P<slug>[\w\d_.-]+)/$"
                % self._meta.resource_name,
                self.wrap_view('dispatch_detail'),<commit_msg>[api] Add 'steamid' to the queryable fields<commit_after># pylint: disable=W0232
from django.conf.urls import url
from tastypie.resources import ModelResource
from tastypie.authentication import ApiKeyAuthentication
from tastypie.authorization import Authorization
from tastypie.exceptions import Unauthorized
from tastypie import fields
from . import models


class GameLibraryAuthorization(Authorization):
    def create_list(self, object_list, bundle):
        raise Unauthorized()

    def read_list(self, object_list, bundle):
        return object_list.filter(user=bundle.request.user)

    def delete_list(self, object_list, bundle):
        raise Unauthorized()


class GameResource(ModelResource):
    # pylint: disable=W0232, R0903
    class Meta:
        queryset = models.Game.objects.all()
        fields = ['name', 'slug', 'year', 'platforms', 'title_logo', 'icon',
                  'is_public', 'updated', 'steamid']
        allowed_methods = ['get']
        detail_uri_name = 'slug'

    def override_urls(self):
        return [
            url(r"^(?P<resource_name>%s)/(?P<slug>[\w\d_.-]+)/$"
                % self._meta.resource_name,
                self.wrap_view('dispatch_detail'),
{'fraction_non_alphanumeric': 0.11092366090257276, 'fraction_numerical': 0.010122311261071278, 'mean_word_length': 3.425373134328358, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6737177', 'n_tokens_mistral': 713, 'n_tokens_neox': 691, 'n_words': 162}