#NEWLINE# def CheckRequires( self , token ) : #NEWLINE# #INDENT# 'Checks alphabetization of goog.require statements.\n\n    Iterates over tokens in given token stream, identifies goog.require tokens,\n    and checks that they occur in alphabetical order by the dependency being\n    required.\n\n    Args:\n      token: A token in the token stream before any goog.require tokens.\n\n    Returns:\n      The first require token in the token stream.\n\n      None is returned if all goog.require statements are already sorted.\n    ' #NEWLINE# require_tokens = self . _GetRequireOrProvideTokens ( token , 'goog.require' ) #NEWLINE# require_strings = self . _GetRequireOrProvideTokenStrings ( require_tokens ) #NEWLINE# sorted_require_strings = sorted ( require_strings ) #NEWLINE# if ( require_strings != sorted_require_strings ) : #NEWLINE# #INDENT# return require_tokens [ 0 ] #NEWLINE# #UNINDENT# return None