def _lookup_namespace(self, symbol, namespace):
for namespace_part in symbol.parts:<EOL><INDENT>namespace = namespace.get(namespace_part)<EOL>if namespace is None:<EOL><INDENT>break<EOL><DEDENT>if not isinstance(namespace, dict):<EOL><INDENT>return namespace<EOL><DEDENT><DEDENT>raise Error('<STR_LIT>' % symbol.name)<EOL>
Helper for lookup_symbol that only looks up variables in a
        namespace.

        Args:
          symbol: Symbol
          namespace: pointer into self.namespaces