docs: def delete(self, verbose=True):
          """
          Deletes the contents of the table and its dependent tables, recursively.
          User is prompted for confirmation if config['safemode'] is set to True.
          """
          conn = self.connection
          already_in_transaction = conn.in_transaction
          safe = config['safemode']
          if already_in_transaction and safe:
              raise DataJointError('Cannot delete within a transaction in safemode. '
                                   'Set dj.config["safemode"] = False or complete the ongoing transaction first.')
          graph = conn.dependencies
          graph.load()
          delete_list = collections.OrderedDict(
              (name, _rename_map(next(iter(graph.parents(name).items()))) if name.isdigit() else FreeTable(conn, name))
              for name in graph.descendants(self.full_table_name))
  
          # construct restrictions for each relation
          restrict_by_me = set()
          # restrictions: Or-Lists of restriction conditions for each table.
          # Uncharacteristically of Or-Lists, an empty entry denotes "delete everything".
          restrictions = collections.defaultdict(list)
          # restrict by self
          if self.restriction:
              restrict_by_me.add(self.full_table_name)
              restrictions[self.full_table_name].append(self.restriction)  # copy own restrictions
          # restrict by renamed nodes
          restrict_by_me.update(table for table in delete_list if table.isdigit())  # restrict by all renamed nodes
          # restrict by secondary dependencies
          for table in delete_list:
              restrict_by_me.update(graph.children(table, primary=False))   # restrict by any non-primary dependents
  
          # compile restriction lists
          for name, table in delete_list.items():
              for dep in graph.children(name):
                  # if restrict by me, then restrict by the entire relation otherwise copy restrictions
                  restrictions[dep].extend([table] if name in restrict_by_me else restrictions[name])
  
          # apply restrictions
          for name, table in delete_list.items():
              if not name.isdigit() and restrictions[name]:  # do not restrict by an empty list
                  table.restrict([
                      r.proj() if isinstance(r, FreeTable) else (
                          delete_list[r[0]].proj(**{a: b for a, b in r[1]['attr_map'].items()})
                          if isinstance(r, _rename_map) else r)
                      for r in restrictions[name]])
          if safe:
              print('About to delete:')
  
          if not already_in_transaction:
              self.connection.start_transaction()
          total = 0
          try:
              for name, table in reversed(list(delete_list.items())):
                  if not name.isdigit():
                      count = table.delete_quick(get_count=True)
                      total += count
                      if (verbose or safe) and count:
                          print('{table}: {count} items'.format(table=name, count=count))
          except:
              # Delete failed, perhaps due to insufficient privileges. Cancel transaction.
              if not already_in_transaction:
                  self.connection.cancel_transaction()
              raise
          else:
              assert not (already_in_transaction and safe)
              if not total:
                  print('Nothing to delete')
                  if not already_in_transaction:
                      self.connection.cancel_transaction()
              else:
                  if already_in_transaction:
                      if verbose:
                          print('The delete is pending within the ongoing transaction.')
                  else:
                      if not safe or user_choice("Proceed?", default='no') == 'yes':
                          self.connection.commit_transaction()
                          if verbose or safe:
                              print('Committed.')
                      else:
                          self.connection.cancel_transaction()
                          if verbose or safe:
                              print('Cancelled deletes.')