nodes: 0, module; 1, function_definition; 2, function_name:serialize_text; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, string; 13, boolean_operator; 14, block; 15, assignment; 16, assignment; 17, identifier:uri; 18, identifier:od; 19, block; 20, call; 21, string_content:Returns a serialized form of the Namepace.
  
          All the elements in the namespace are sorted by
          URI, joined to the associated prefix with a colon and
          separated with spaces.
          :return: bytes; 22, comparison_operator:self._uri_to_prefix is None; 23, comparison_operator:len(self._uri_to_prefix) == 0; 24, return_statement; 25, identifier:od; 26, call; 27, identifier:data; 28, list; 29, expression_statement; 30, attribute; 31, argument_list; 32, attribute; 33, None; 34, call; 35, integer:0; 36, string; 37, attribute; 38, argument_list; 39, call; 40, call; 41, identifier:encode; 42, string; 43, identifier:self; 44, identifier:_uri_to_prefix; 45, identifier:len; 46, argument_list; 47, identifier:collections; 48, identifier:OrderedDict; 49, call; 50, attribute; 51, argument_list; 52, attribute; 53, argument_list; 54, string_content:utf-8; 55, attribute; 56, identifier:sorted; 57, argument_list; 58, identifier:data; 59, identifier:append; 60, binary_operator:uri + ':' + od[uri]; 61, string; 62, identifier:join; 63, identifier:data; 64, identifier:self; 65, identifier:_uri_to_prefix; 66, call; 67, binary_operator:uri + ':'; 68, subscript; 69, string_content:; 70, attribute; 71, argument_list; 72, identifier:uri; 73, string; 74, identifier:od; 75, identifier:uri; 76, attribute; 77, identifier:items; 78, string_content::; 79, identifier:self; 80, identifier:_uri_to_prefix
code: def serialize_text(self):
          '''Returns a serialized form of the Namepace.
  
          All the elements in the namespace are sorted by
          URI, joined to the associated prefix with a colon and
          separated with spaces.
          :return: bytes
          '''
          if self._uri_to_prefix is None or len(self._uri_to_prefix) == 0:
              return b''
          od = collections.OrderedDict(sorted(self._uri_to_prefix.items()))
          data = []
          for uri in od:
              data.append(uri + ':' + od[uri])
          return ' '.join(data).encode('utf-8')