nodes: 0, module; 1, function_definition; 2, function_name:normalize; 3, parameters; 4, block; 5, identifier:rp_pyxb; 6, expression_statement; 7, comment:# noinspection PyMissingOrEmptyDocstring; 8, function_definition; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, comment:"""Normalize a ReplicationPolicy PyXB type in place.
  
      The preferred and blocked lists are sorted alphabetically. As blocked nodes
      override preferred nodes, and any node present in both lists is removed from the
      preferred list.
  
      Args:
        rp_pyxb : ReplicationPolicy PyXB object
          The object will be normalized in place.
  
      """; 13, function_name:sort; 14, parameters; 15, block; 16, assignment; 17, call; 18, call; 19, identifier:r; 20, identifier:a; 21, expression_statement; 22, attribute; 23, binary_operator:set(_get_attr_or_list(rp_pyxb, 'pref')) - set(
          _get_attr_or_list(rp_pyxb, 'block')
      ); 24, identifier:sort; 25, argument_list; 26, identifier:sort; 27, argument_list; 28, call; 29, identifier:rp_pyxb; 30, identifier:preferredMemberNode; 31, call; 32, call; 33, identifier:rp_pyxb; 34, string; 35, identifier:rp_pyxb; 36, string; 37, attribute; 38, argument_list; 39, identifier:set; 40, argument_list; 41, identifier:set; 42, argument_list; 43, string_content:block; 44, string_content:pref; 45, attribute; 46, identifier:sort_value_list_pyxb; 47, call; 48, call; 49, call; 50, identifier:d1_common; 51, identifier:xml; 52, identifier:_get_attr_or_list; 53, argument_list; 54, identifier:_get_attr_or_list; 55, argument_list; 56, identifier:_get_attr_or_list; 57, argument_list; 58, identifier:r; 59, identifier:a; 60, identifier:rp_pyxb; 61, string; 62, identifier:rp_pyxb; 63, string; 64, string_content:pref; 65, string_content:block
code: def normalize(rp_pyxb):
      """Normalize a ReplicationPolicy PyXB type in place.
  
      The preferred and blocked lists are sorted alphabetically. As blocked nodes
      override preferred nodes, and any node present in both lists is removed from the
      preferred list.
  
      Args:
        rp_pyxb : ReplicationPolicy PyXB object
          The object will be normalized in place.
  
      """
  
      # noinspection PyMissingOrEmptyDocstring
      def sort(r, a):
          d1_common.xml.sort_value_list_pyxb(_get_attr_or_list(r, a))
  
      rp_pyxb.preferredMemberNode = set(_get_attr_or_list(rp_pyxb, 'pref')) - set(
          _get_attr_or_list(rp_pyxb, 'block')
      )
      sort(rp_pyxb, 'block')
      sort(rp_pyxb, 'pref')