def add_name(self, name, reflineno=None, glob=False, to_js=None, force=False):
        #if not force and self.assign_state is False:
        #    return
        if not force and \
           (self.assign_state is False and \
            isinstance(self.names[-1], ClassNames)):
            return
        depth = 0
        for names in self.names:
            if not isinstance(names, ClassNames):
                depth += 1
        if name in self.names[-1]:
            _name = self.names[-1][name]
            if reflineno is None and len(self.names) > 1 and \
               not _name.glob and _name.reflineno is not None and \
               _name.depth == depth and force is False:
                print _name.name, _name.reflineno, _name.glob, _name.depth, len(self.names) - 1
                reflineno = _name.reflineno
                _name.reflineno = None
                raise self.TranslationError(
                    "Local variable '%s' referenced before assignment at line %s" % (name, reflineno)
                )
        else:
            done = []
            if len(self.names) == 1:
                _name = Name(name, reflineno, glob, to_js)
                _name.depth = 1
            elif reflineno is not None:
                _name = None
                names = self.names[:-1]
                while len(names):
                    if name in names[-1]:
                        _name = names[-1][name]
                        break
                    done.append(names.pop())
                if _name is None:
                    _name = Name(name, reflineno, to_js=to_js)
                    _name.depth = 1
            else:
                _name = Name(name, reflineno, glob, to_js)
                _name.depth = depth
                #_name.depth = 0
                #for names in self.names:
                #    if not isinstance(names, ClassNames):
                #        _name.depth += 1
            if reflineno is not None and _name.depth == 0:
                if not _name.builtin and builtin_names in name:
                    _name.builtin = True
            if not force and self.assign_state is False and \
               _name.depth == 1 and \
               len(self.names) > 1:
                return
            while len(done):
                done[-1][name] = _name
                done.pop()
            self.names[-1][name] = _name
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/translator_dict.py/Translator.add_name/swapped operands of `in`