'Undefine data/code/function.
returns True if ok'

def undefine(self, ad):

    ad = self.mem.get_head_addr(ad)
    self.__undefine(ad, force=True)
    entry = ad
    fid = self.mem.get_func_id(ad)
    is_code = self.mem.is_code(ad)
    if (fid != (-1)):
        entry = self.__db.func_id[fid]
        func_obj = self.__db.functions[entry]
        del self.__db.functions[entry]
        if (func_obj is not None):
            del self.__db.end_functions[func_obj[FUNC_END]]
            del self.__db.func_id[fid]
    self.mem.rm_range(entry, max(self.mem.get_size(entry), 1))
    if (entry in self.__db.xrefs):
        self.mem.add(entry, 1, MEM_UNK)
    if is_code:
        (gph, _) = self.__dis.get_graph(entry)
        del gph.nodes[entry]
        for n in gph.nodes:
            self.mem.rm_range(n, max(self.mem.get_size(n), 1))
            if (entry in self.__db.xrefs):
                self.mem.add(entry, 1, MEM_UNK)
    return True
