<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _lookup_namespace(self, symbol, namespace):
 """Helper for lookup_symbol that only looks up variables in a namespace. Args: symbol: Symbol namespace: pointer into self.namespaces """

        for namespace_part in symbol.parts:
            namespace = namespace.get(namespace_part)
            if namespace is None:
                break
            if not isinstance(namespace, dict):
                return namespace
        raise Error('%s not found' % symbol.name)