code: def _authstr(self, auth):
          
          if type(auth) is dict:
              return '{' + ','.join(["{0}:{1}".format(k, auth[k]) for k in sorted(auth.keys())]) + '}'
          return auth
docs: Convert auth to str so that it can be hashed