nodes: 0, module; 1, function_definition; 2, function_name:_get_all_ns_packages; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, return_statement; 9, comment:"""Return sorted list of all package namespaces"""; 10, assignment; 11, call; 12, identifier:pkgs; 13, boolean_operator; 14, identifier:sorted; 15, argument_list; 16, attribute; 17, list; 18, call; 19, attribute; 20, identifier:namespace_packages; 21, identifier:flatten; 22, argument_list; 23, identifier:self; 24, identifier:distribution; 25, call; 26, identifier:map; 27, argument_list; 28, attribute; 29, identifier:pkgs; 30, identifier:self; 31, identifier:_pkg_names
code: def _get_all_ns_packages(self):
          """Return sorted list of all package namespaces"""
          pkgs = self.distribution.namespace_packages or []
          return sorted(flatten(map(self._pkg_names, pkgs)))