def prefix_with_ns_if_necessary(name, name_ns, source_ns):<EOL>
if source_ns == name_ns:<EOL><INDENT>return name<EOL><DEDENT>return '<STR_LIT>'.format(fmt_namespace(name_ns.name), name)<EOL>
Returns a name that can be used to reference `name` in namespace `name_ns`
from `source_ns`.

If `source_ns` and `name_ns` are the same, that's just `name`. Otherwise
it's `name_ns`.`name`.