nodes: 0, module; 1, function_definition; 2, function_name:top_expression_effect; 3, parameters; 4, block; 5, identifier:self; 6, identifier:expression_levels; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, function_definition; 11, return_statement; 12, comment:"""
          Return effect whose transcript has the highest expression level.
          If none of the effects are expressed or have associated transcripts,
          then return None. In case of ties, add lexicographical sorting by
          effect priority and transcript length.
          """; 13, assignment; 14, comparison_operator:len(effect_expression_dict) == 0; 15, block; 16, function_name:key_fn; 17, parameters; 18, block; 19, subscript; 20, identifier:effect_expression_dict; 21, call; 22, call; 23, integer:0; 24, return_statement; 25, identifier:effect_fpkm_pair; 26, expression_statement; 27, expression_statement; 28, return_statement; 29, call; 30, integer:0; 31, attribute; 32, argument_list; 33, identifier:len; 34, argument_list; 35, None; 36, comment:"""
              Sort effects primarily by their expression level
              and secondarily by the priority logic used in
              `top_priority_effect`.
              """; 37, assignment; 38, tuple; 39, identifier:max; 40, argument_list; 41, identifier:self; 42, identifier:effect_expression; 43, identifier:expression_levels; 44, identifier:effect_expression_dict; 45, tuple_pattern; 46, identifier:effect_fpkm_pair; 47, identifier:fpkm; 48, call; 49, call; 50, keyword_argument; 51, identifier:effect; 52, identifier:fpkm; 53, identifier:multi_gene_effect_sort_key; 54, argument_list; 55, attribute; 56, argument_list; 57, identifier:key; 58, identifier:key_fn; 59, identifier:effect; 60, identifier:effect_expression_dict; 61, identifier:items
code: def top_expression_effect(self, expression_levels):
          """
          Return effect whose transcript has the highest expression level.
          If none of the effects are expressed or have associated transcripts,
          then return None. In case of ties, add lexicographical sorting by
          effect priority and transcript length.
          """
          effect_expression_dict = self.effect_expression(expression_levels)
  
          if len(effect_expression_dict) == 0:
              return None
  
          def key_fn(effect_fpkm_pair):
              """
              Sort effects primarily by their expression level
              and secondarily by the priority logic used in
              `top_priority_effect`.
              """
              (effect, fpkm) = effect_fpkm_pair
              return (fpkm, multi_gene_effect_sort_key(effect))
  
          return max(effect_expression_dict.items(), key=key_fn)[0]