

class AnonymousAuthentication(object):
    anonymous_allowed_methods = ['GET']

    def __init__(self, allowed=None):
        if allowed is not None:
            self.anonymous_allowed_methods = allowed

    def is_authenticated(self, request, **kwargs):
        allowed_methods = [s.upper() for s in self.anonymous_allowed_methods]
        if request.method in allowed_methods:
            return True
        return False



class AnonymousAuthentication(object):
    allowed_methods = ['GET']

    def __init__(self, allowed=None):
        if allowed is not None:
            self.allowed_methods = allowed

    def is_authenticated(self, request, **kwargs):
        return (request.method in [s.upper() for s in self.allowed_methods])

Change some naming in AnonymousAuthentication
Change some naming in AnonymousAuthentication

  
  
  class AnonymousAuthentication(object):
-     anonymous_allowed_methods = ['GET']
+     allowed_methods = ['GET']
  
      def __init__(self, allowed=None):
          if allowed is not None:
-             self.anonymous_allowed_methods = allowed
+             self.allowed_methods = allowed
  
      def is_authenticated(self, request, **kwargs):
+         return (request.method in [s.upper() for s in self.allowed_methods])
-         allowed_methods = [s.upper() for s in self.anonymous_allowed_methods]
-         if request.method in allowed_methods:
-             return True
-         return False
  
Change some naming in AnonymousAuthentication
## Code Before:


class AnonymousAuthentication(object):
    anonymous_allowed_methods = ['GET']

    def __init__(self, allowed=None):
        if allowed is not None:
            self.anonymous_allowed_methods = allowed

    def is_authenticated(self, request, **kwargs):
        allowed_methods = [s.upper() for s in self.anonymous_allowed_methods]
        if request.method in allowed_methods:
            return True
        return False

## Instruction:
Change some naming in AnonymousAuthentication
## Code After:


class AnonymousAuthentication(object):
    allowed_methods = ['GET']

    def __init__(self, allowed=None):
        if allowed is not None:
            self.allowed_methods = allowed

    def is_authenticated(self, request, **kwargs):
        return (request.method in [s.upper() for s in self.allowed_methods])
