from __future__ import absolute_import
from requests.auth import AuthBase


class ApiKeyAuth(AuthBase):
    def __init__(self, username, apikey):
        self.username = username
        self.apikey = apikey

    def __eq__(self, other):
        return all([
            self.username == getattr(other, 'username', None),
            self.apikey == getattr(other, 'apikey', None)
        ])

    def __ne__(self, other):
        return not self == other

    def __call__(self, r):
        r.headers['Authorization'] = 'apikey %s:%s' % (self.username, self.apikey)
        return r

@@ -215,25 +215,16 @@
 ef _
-_eq__(self, other
+key(self
 ):%0A 
@@ -241,76 +241,66 @@
 urn 
-all(%5B%0A            self.username == getattr(other, 'username', None),
+(self.username, self.apikey)%0A%0A    def __eq__(self, other):
 %0A   
@@ -308,67 +308,98 @@
     
-   
+return
  self.
-api
+_
 key
+()
  == 
-getattr(other, 'apikey', None)%0A        %5D
+other.key()%0A%0A    def __hash__(self):%0A        return hash(self._key()
 )%0A%0A 

implement hash