Removes one or more of ``instances`` from the relation.
507387
async def remove(self, *instances, using_db=None) -> None:
        
        db = using_db if using_db else self.model._meta.db
        if not instances:
            raise OperationalError("remove() called on no instances")
        through_table = Table(self.field.through)

        if len(instances) == 1:
            condition = (getattr(through_table, self.field.forward_key) == instances[0].id) & (
                getattr(through_table, self.field.backward_key) == self.instance.id
            )
        else:
            condition = (getattr(through_table, self.field.backward_key) == self.instance.id) & (
                getattr(through_table, self.field.forward_key).isin([i.id for i in instances])
            )
        query = db.query_class.from_(through_table).where(condition).delete()
        await db.execute_query(str(query))
114328
def remove_from_parent(self):
        """"""
        parent = self.parent
        if parent is not None:
            try:
                children = parent.children
            except AttributeError: pass
            else:
                remove_upto_once(children, self)
242545
def delete_relation(self, src, relation, target):
        '''  '''
        self.__require_string__(relation)
        if src in self and target in self:
            self._get_item_node(src).unlink(relation, self._get_item_node(target))
1202173
public static function clearRelatedInstancePool()
    {
        // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
        // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
                DealerShedulesTableMap::clearInstancePool();
                DealerContactTableMap::clearInstancePool();
                DealerContentTableMap::clearInstancePool();
                DealerFolderTableMap::clearInstancePool();
                DealerBrandTableMap::clearInstancePool();
                DealerProductTableMap::clearInstancePool();
                DealerAdminTableMap::clearInstancePool();
                DealerI18nTableMap::clearInstancePool();
                DealerVersionTableMap::clearInstancePool();
            }
299556
public static function cleanup_instances() {
        global $DB;
        self::init_levels();

        $sqls = array();
        foreach (self::$alllevels as $level=>$classname) {
            $sqls[] = $classname::get_cleanup_sql();
        }

        $sql = implode(" UNION ", $sqls);

        // it is probably better to use transactions, it might be faster too
        $transaction = $DB->start_delegated_transaction();

        $rs = $DB->get_recordset_sql($sql);
        foreach ($rs as $record) {
            $context = context::create_instance_from_record($record);
            $context->delete();
        }
        $rs->close();

        $transaction->allow_commit();
    }
931706
def remove(self, index):
        '''
        
        '''
        raise NotImplementedError
        if hasattr(index, '__iter__'):
            ind = set(index)
        else:
            ind = [index]

        # Rebuild relationships, excluding the provided indices
        self._relationships = [r for i, r in enumerate(self._relationships) if i not in ind]
1167272
def remove_handlers_bound_to_instance(self, obj):
        
        for handler in self.handlers:
            if handler.im_self == obj:
                self -= handler
529299
private void doDelete(DBIDRef id) {
    // Remove id
    ids.remove(id);
    // Remove from all representations.
    for(Relation<?> relation : relations) {
      // ID has already been removed, and this would loop...
      if(relation == idrep) {
        continue;
      }
      if(!(relation instanceof ModifiableRelation)) {
        throw new AbortException("Non-modifiable relations have been added to the database.");
      }
      ((ModifiableRelation<?>) relation).delete(id);
    }
    DBIDFactory.FACTORY.deallocateSingleDBID(id);
  }
621799
def remove(self, spec_or_id, multi=True, *args, **kwargs):
        """"""
        if multi:
            return self.delete_many(spec_or_id)
        return self.delete_one(spec_or_id)
1234734
def delete_relation(self, src, relation, *targets):
        '''  '''
        self.__require_string__(relation)
        if len(targets):
            for i in targets:
                self._delete_single_relation(src, relation, i)
        else:
            # delete all connections of that relation from src
            for i in list(self.find(src, relation)):
                self._delete_single_relation(src, relation, i)
646908
def cleanup_relations(self):
        """"""
        collections = self.collections
        for relation in [x for col in collections.values()
                         for x in col.model.relations.values()]:
            db.session.query(relation)\
                       .filter(~relation.listing.any())\
                       .delete(synchronize_session=False)
        db.session.commit()
226186
public static function clearExcept(array $keepInstanceNames)
    {
        foreach (self::$instances as $name => $instance) {
            if (!in_array($name, $keepInstanceNames)) {
                self::clear($name);
            }
        }
    }
986168
public static function clearInstancePool($and_clear_all_references = false)
    {
      if ($and_clear_all_references) {
        foreach (RemoteAppPeer::$instances as $instance) {
          $instance->clearAllReferences(true);
        }
      }
        RemoteAppPeer::$instances = array();
    }
1118305
def remove_instances_by_prefix(nova_api, prefix):
    """"""
    for server in nova_api.servers.list():
        if server.name.startswith(prefix):
            LOG.info("Remove instance '%s'" % server.name)
            server.delete()
1334533
def remove_many(self, it):
        """"""
        # find indicies of objects in iterable
        to_be_deleted = list(it)
        del_indices = []
        for i, ob in enumerate(self.obs):
            try:
                tbd_index = to_be_deleted.index(ob)
            except ValueError:
                continue
            else:
                del_indices.append(i)
                to_be_deleted.pop(tbd_index)

            # quit early if we have found them all
            if not to_be_deleted:
                break

        for i in sorted(del_indices, reverse=True):
            self.pop(i)

        return self
269073
def remove(*models)
      @connection.delete_by_id(
        models.map { |model| Adapters::InstanceAdapter.adapt(model).index_id }
      )
    end
1188642
def delete_instance(self, credentials, name, **kwargs):
        """"""
        op_name = delete_instance(
            credentials, self.project, self.zone, name, **kwargs)

        return op_name