def check_symbols_used(self):
        self.symbolsused = set()
        all_interptext_props = []
        all_code_props = []
        for (key, propval) in self.props.items():
            if keyword.iskeyword(key):
                print('Warning: prop "%s" in %s is a keyword' % (key, None))
            if is_interp_text(propval):
                all_interptext_props.append( (propval['text'], None) )
            if is_code(propval):
                all_code_props.append( (key, propval['text'], None) )
            if is_move(propval):
                if propval['loc'] not in self.locations:
                    print('Warning: move prop "%s" in %s goes to undefined loc: %s' % (key, None, propval['loc']))
        for (lockey, loc) in self.locations.items():
            for (key, propval) in loc.props.items():
                if keyword.iskeyword(key):
                    print('Warning: prop "%s" in %s is a keyword' % (key, lockey))
                if is_interp_text(propval):
                    all_interptext_props.append( (propval['text'], lockey) )
                if is_code(propval):
                    all_code_props.append( (key, propval['text'], lockey) )
                if is_move(propval):
                    if propval['loc'] not in self.locations:
                        print('Warning: move prop "%s" in %s goes to undefined loc: %s' %(key, lockey, propval['loc']))
            
        for (key, text, lockey) in all_code_props:
            try:
                ast.parse(text, filename='%s.%s' % (lockey, key,))
            except Exception as ex:
                print('Warning: code prop "%s" in %s does not parse: %s' % (key, lockey, ex))

        for (text, lockey) in all_interptext_props:
            for nod in twcommon.interp.parse(text):
                if isinstance(nod, twcommon.interp.Link):
                    self.symbolsused.add( (nod.target, lockey) )
                if isinstance(nod, twcommon.interp.Interpolate):
                    self.symbolsused.add( (nod.expr, lockey) )

        for (symbol, lockey) in self.symbolsused:
            if not symbol.isidentifier():
                try:
                    ast.parse(symbol)
                except:
                    print('Warning: code snippet "%s" in %s does not parse.' % (symbol, lockey,))                    
                continue
            if lockey is None:
                loc = None
            else:
                loc = self.locations[lockey]
            if loc and symbol in loc.props:
                continue
            if symbol in self.props:
                continue
            print('Warning: symbol "%s" in %s is not defined.' % (symbol, lockey,))
dataset/ETHPy150Open erkyrath/tworld/twloadworld.py/World.check_symbols_used/original