def check_functioncall(self, node):
        if DEBUG:
            print "Checking function call.."
        global blacklist
        isopen = False
        for fname,fvalue in ast.iter_fields(node):
            if DEBUG:
                print fname, " ", fvalue
            if fname == 'func' and type(fvalue).__name__ == 'Name':
                if fvalue.id == 'open':
                    isopen = True
                elif fvalue.id in blacklist:
                    self.safe = False
                    print "%d | Forbidden function call: %s --> EXIT" % (node.lineno,fvalue.id)
            if fname == 'args' and isopen:
                for arg in fvalue:
                    if type(arg).__name__ == 'Str':
                        if arg.__dict__['s'] == 'w' or arg.__dict__['s'] == 'a':
                            self.safe = False
                            print "%d | Write to file --> EXIT" % node.lineno
                    elif type(arg).__name__ == 'Name':
                        self.safe = False
                        print "%d | File operation with variable argument: %s --> EXIT" % (node.lineno,arg.id)
dataset/ETHPy150Open denizalti/concoord/concoord/safetychecker.py/SafetyVisitor.check_functioncall/original