nodes: 0, module; 1, function_definition; 2, function_name:getStateIndex; 3, parameters; 4, block; 5, identifier:self; 6, identifier:state; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""
          Returns the index of a state by calculating the state code and searching for this code a sorted list.
          Can be called on multiple states at once.
          """; 11, assignment; 12, call; 13, identifier:statecodes; 14, call; 15, attribute; 16, argument_list; 17, attribute; 18, argument_list; 19, call; 20, identifier:astype; 21, identifier:int; 22, identifier:self; 23, identifier:getStateCode; 24, identifier:state; 25, attribute; 26, argument_list; 27, identifier:np; 28, identifier:searchsorted; 29, attribute; 30, identifier:statecodes; 31, identifier:self; 32, identifier:codes
code: def getStateIndex(self,state):
          """
          Returns the index of a state by calculating the state code and searching for this code a sorted list.
          Can be called on multiple states at once.
          """
          statecodes = self.getStateCode(state)
          return np.searchsorted(self.codes,statecodes).astype(int)