def linearize_aliases(self):<EOL>
linearized_aliases = []<EOL>seen_aliases = set()  <EOL>def add_alias(alias):<EOL><INDENT>if alias in seen_aliases:<EOL><INDENT>return<EOL><DEDENT>elif alias.namespace != self:<EOL><INDENT>return<EOL><DEDENT>if is_alias(alias.data_type):<EOL><INDENT>add_alias(alias.data_type)<EOL><DEDENT>linearized_aliases.append(alias)<EOL>seen_aliases.add(alias)<EOL><DEDENT>for alias in self.aliases:<EOL><INDENT>add_alias(alias)<EOL><DEDENT>return linearized_aliases<EOL>
Returns a list of all aliases used in the namespace. The aliases are
ordered to ensure that if they reference other aliases those aliases
come earlier in the list.