nodes: 0, module; 1, function_definition; 2, function_name:_get_pos; 3, parameters; 4, block; 5, identifier:self; 6, identifier:key; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, comment:"""Get the index of the given key in the sorted key list.
  
          We return the position with the nearest hash based on
          the provided key unless we reach the end of the continuum/ring
          in which case we return the 0 (beginning) index position.
  
          :param key: the key to hash and look for.
          """; 11, assignment; 12, comparison_operator:p == len(self.runtime._keys); 13, block; 14, else_clause; 15, identifier:p; 16, call; 17, identifier:p; 18, call; 19, return_statement; 20, block; 21, identifier:bisect; 22, argument_list; 23, identifier:len; 24, argument_list; 25, integer:0; 26, return_statement; 27, attribute; 28, call; 29, attribute; 30, identifier:p; 31, attribute; 32, identifier:_keys; 33, attribute; 34, argument_list; 35, attribute; 36, identifier:_keys; 37, identifier:self; 38, identifier:runtime; 39, identifier:self; 40, identifier:hashi; 41, identifier:key; 42, identifier:self; 43, identifier:runtime
code: def _get_pos(self, key):
          """Get the index of the given key in the sorted key list.
  
          We return the position with the nearest hash based on
          the provided key unless we reach the end of the continuum/ring
          in which case we return the 0 (beginning) index position.
  
          :param key: the key to hash and look for.
          """
          p = bisect(self.runtime._keys, self.hashi(key))
          if p == len(self.runtime._keys):
              return 0
          else:
              return p