nodes: 0, module; 1, function_definition; 2, function_name:_final_redis_call; 3, parameters; 4, block; 5, identifier:self; 6, identifier:final_set; 7, identifier:sort_options; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, comment:"""
          The final redis call to obtain the values to return from the "final_set"
          with some sort options.
          """; 12, assignment; 13, comparison_operator:sort_options is not None; 14, comment:# a sort, or values, call the SORT command on the set; 15, block; 16, else_clause; 17, identifier:conn; 18, call; 19, identifier:sort_options; 20, None; 21, return_statement; 22, comment:# no sort, nor values, simply return the full set; 23, block; 24, attribute; 25, argument_list; 26, call; 27, return_statement; 28, attribute; 29, identifier:get_connection; 30, attribute; 31, argument_list; 32, call; 33, identifier:self; 34, identifier:cls; 35, identifier:conn; 36, identifier:sort; 37, identifier:final_set; 38, dictionary_splat; 39, attribute; 40, argument_list; 41, identifier:sort_options; 42, identifier:conn; 43, identifier:smembers; 44, identifier:final_set
code: def _final_redis_call(self, final_set, sort_options):
          """
          The final redis call to obtain the values to return from the "final_set"
          with some sort options.
          """
  
          conn = self.cls.get_connection()
          if sort_options is not None:
              # a sort, or values, call the SORT command on the set
              return conn.sort(final_set, **sort_options)
          else:
              # no sort, nor values, simply return the full set
              return conn.smembers(final_set)