#NEWLINE# @ staticmethod #NEWLINE# def get_sector_id( redirect_uri , client_info ) : #NEWLINE# #INDENT# '\n        Pick the sector id given a number of factors\n        :param redirect_uri: The redirect_uri used\n        :param client_info: Information provided by the client in the\n        client registration\n        :return: A sector_id or None\n        ' #NEWLINE# _redirect_uri = unquote ( redirect_uri ) #NEWLINE# part = urlparse ( _redirect_uri ) #NEWLINE# if part . fragment : #NEWLINE# #INDENT# raise ValueError #NEWLINE# #UNINDENT# ( _base , _query ) = splitquery ( _redirect_uri ) #NEWLINE# sid = '' #NEWLINE# try : #NEWLINE# #INDENT# if ( _base in client_info [ 'si_redirects' ] ) : #NEWLINE# #INDENT# sid = client_info [ 'sector_id' ] #NEWLINE# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# uit = client_info [ 'subject_type' ] #NEWLINE# if ( uit == 'pairwise' ) : #NEWLINE# #INDENT# sid = _base #NEWLINE# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return sid