nodes: 0, module; 1, function_definition; 2, function_name:_get_bin; 3, parameters; 4, block; 5, identifier:self; 6, identifier:key; 7, expression_statement; 8, comment:# keys based on score; 9, expression_statement; 10, comment:# this doesnt return them in order, need to bin first; 11, for_statement; 12, return_statement; 13, string; 14, assignment; 15, identifier:item; 16, call; 17, block; 18, identifier:sortedDict; 19, string_content:Returns a binned dictionary based on redis zscore
  
          @return: The sorted dict; 20, identifier:sortedDict; 21, dictionary; 22, attribute; 23, argument_list; 24, expression_statement; 25, comment:# score is negated in redis; 26, expression_statement; 27, if_statement; 28, expression_statement; 29, attribute; 30, identifier:zscan_iter; 31, identifier:key; 32, assignment; 33, assignment; 34, comparison_operator:my_score not in sortedDict; 35, block; 36, call; 37, identifier:self; 38, identifier:redis_conn; 39, identifier:my_item; 40, call; 41, identifier:my_score; 42, unary_operator; 43, identifier:my_score; 44, identifier:sortedDict; 45, expression_statement; 46, attribute; 47, argument_list; 48, attribute; 49, argument_list; 50, subscript; 51, assignment; 52, subscript; 53, identifier:append; 54, identifier:my_item; 55, identifier:ujson; 56, identifier:loads; 57, subscript; 58, identifier:item; 59, integer:1; 60, subscript; 61, list; 62, identifier:sortedDict; 63, identifier:my_score; 64, identifier:item; 65, integer:0; 66, identifier:sortedDict; 67, identifier:my_score
code: def _get_bin(self, key):
          '''
          Returns a binned dictionary based on redis zscore
  
          @return: The sorted dict
          '''
          # keys based on score
          sortedDict = {}
          # this doesnt return them in order, need to bin first
          for item in self.redis_conn.zscan_iter(key):
              my_item = ujson.loads(item[0])
              # score is negated in redis
              my_score = -item[1]
  
              if my_score not in sortedDict:
                  sortedDict[my_score] = []
  
              sortedDict[my_score].append(my_item)
  
          return sortedDict