parameters: (tag_dicts, tag_list, parent_list, all_children_list)
return_statement: return exclusive_list
docstring: Infer exclusive label relations according to hierarchical relations
docstring_summary: Infer exclusive label relations according to hierarchical relations
docstring_tokens: Infer exclusive label relations according to hierarchical relations
function: def gen_exclusive_list(tag_dicts, tag_list, parent_list, all_children_list):
      """Infer exclusive label relations according to hierarchical relations"""
      exclusive_list = []
      all_d_tags = [t['tag'] for t in tag_dicts]
      for p in range(len(tag_list)):
          idx = all_d_tags.index(tag_list[p])
          exclusive_list.append([tag_list.index(ex) for ex in
                                      tag_dicts[idx]['exclusive'] if ex in tag_list])
      while True:
          flag = False
          for p in range(len(tag_list)):
              cur_ex = exclusive_list[p]
              next_ex = cur_ex[:]
              for ex in cur_ex:
                  next_ex += all_children_list[ex]
              for parent in parent_list[p]:
                  next_ex += exclusive_list[parent]
              next_ex = unique(next_ex)
              flag = flag or (set(next_ex) != set(cur_ex))
              exclusive_list[p] = next_ex
          if not flag:
              break
  
      return exclusive_list
function_tokens: def gen_exclusive_list ( tag_dicts , tag_list , parent_list , all_children_list ) : exclusive_list = [ ] all_d_tags = [ t [ 'tag' ] for t in tag_dicts ] for p in range ( len ( tag_list ) ) : idx = all_d_tags . index ( tag_list [ p ] ) exclusive_list . append ( [ tag_list . index ( ex ) for ex in tag_dicts [ idx ] [ 'exclusive' ] if ex in tag_list ] ) while True : flag = False for p in range ( len ( tag_list ) ) : cur_ex = exclusive_list [ p ] next_ex = cur_ex [ : ] for ex in cur_ex : next_ex += all_children_list [ ex ] for parent in parent_list [ p ] : next_ex += exclusive_list [ parent ] next_ex = unique ( next_ex ) flag = flag or ( set ( next_ex ) != set ( cur_ex ) ) exclusive_list [ p ] = next_ex if not flag : break return exclusive_list