Base level method for removing data from the API
186176
def _delete_json(self, instance, space=None, rel_path=None, extra_params=None, id_field=None, append_to_path=None):
        

        model = type(instance)

        # Only API.spaces and API.event should not provide
        # the `space argument
        if space is None and model not in (Space, Event):
            raise Exception(
                'In general, `API._delete_json` should always '
                'be called with a `space` argument.'
            )

        if not extra_params:
            extra_params = {}

        if not id_field:
            id_field = 'number'

        if not instance.get(id_field, None):
            raise AttributeError(
                '%s does not have a value for the id field \'%s\'' % (
                    instance.__class__.__name__,
                    id_field
                )
            )

        # Generate the url to hit
        url = '{0}/{1}/{2}/{3}{4}.json?{5}'.format(
            settings.API_ROOT_PATH,
            settings.API_VERSION,
            rel_path or model.rel_path,
            instance[id_field],
            append_to_path or '',
            urllib.urlencode(extra_params),
        )

        # Fetch the data
        response = requests.delete(
            url=url,
            headers={
                'X-Api-Key': self.key,
                'X-Api-Secret': self.secret,
                'Content-type': "application/json",
            },
        )

        if response.status_code == 204:  # OK
            return True
        else:  # Most likely a 404 Not Found
            raise Exception(
                'Code {0} returned from `{1}`. Response text: "{2}".'.format(
                    response.status_code,
                    url,
                    response.text
                )
            )
642320
def clear(self):
        
        del self._statements_and_parameters[:]
        self.keyspace = None
        self.routing_key = None
        if self.custom_payload:
            self.custom_payload.clear()
207580
def clear_data(self):
        
        if (self.get_data_metadata().is_read_only() or
                self.get_data_metadata().is_required()):
            raise errors.NoAccess()
        if self._my_map['data'] == self._data_default:
            return
        dbase = JSONClientValidated('repository',
                                    runtime=self._runtime).raw()
        filesys = gridfs.GridFS(dbase)
        filesys.delete(self._my_map['data'])
        self._my_map['data'] = self._data_default
        del self._my_map['base64']
469312
function() {
        //remove all event handlers, delete from entities
        this.each(function() {
            var comp;
            this.trigger("Remove");
            for (var compName in this.__c) {
                comp = components[compName];
                if (comp && "remove" in comp) comp.remove.call(this, true);

                // update map from component to (entityId -> entity)
                delete compEntities[compName][this[0]];
            }
            this._unbindAll();
            delete entities[this[0]];
        });
    }
483237
function removeRoutes(app) {
  return function (api, done) {
    if (!api) {
      done(null, false); // no routes to remove
      return
    }

    var removedRoutes = _.remove(app._router.stack, function (layer) {
      if (layer.route == undefined) {
        return false;
      } else {
        return api.matchesRoute(layer.route.path, layer.route.methods);
      }
    });

    if (removedRoutes && removedRoutes.length > 0) {
      console.log(`removed ${removedRoutes.length} routes`);
    }

    done(null, api);
  }
}
1320008
public void cleanDataSources() {

        Hashtable<String, List<String>> removedDsKeyTable = null;

        //gather all the empty ds's key, can't remove item while iterate
        Enumeration<String> allPoolKeys = dbmsPoolTable.keys();
        while (allPoolKeys.hasMoreElements()) {
            String dbPoolKey = allPoolKeys.nextElement();
            Hashtable<String, DataSource> dsTable = dbmsPoolTable.get(dbPoolKey);
            Enumeration<String> allDsKeys = dsTable.keys();
            while (allDsKeys.hasMoreElements()) {
                String dsKey = allDsKeys.nextElement();
                DataSource ds = dsTable.get(dsKey);

                //c3p0 impl
                if (ds != null && ds instanceof PooledDataSource) {
                    PooledDataSource pDs = (PooledDataSource) ds;
                    int conCount;
                    try {
                        conCount = pDs.getNumConnectionsAllUsers();
                    } catch (SQLException e) {
//                  todo      logger.error
//                                ("Failed to get total number of connections for datasource. dbmsPoolKey = "
//                                        + dbPoolKey, e);
                        continue;
                    }
                    //no connections
                    if (conCount == 0) {
                        List<String> removedList = null;
                        if (removedDsKeyTable == null) {
                            removedDsKeyTable = new Hashtable<>();
                        } else {
                            removedList = removedDsKeyTable.get(dbPoolKey);
                        }

                        if (removedList == null) {
                            removedList = new ArrayList<>();
                            removedList.add(dsKey);
                            removedDsKeyTable.put(dbPoolKey, removedList);
                        } else {
                            removedList.add(dsKey);
                        }
                    }
                }
            }
        }

        //have empty ds
        if (removedDsKeyTable != null && !removedDsKeyTable.isEmpty()) {
            Enumeration<String> removedPoolKeys = removedDsKeyTable.keys();
            while (removedPoolKeys.hasMoreElements()) {
                String removedPoolKey = removedPoolKeys.nextElement();
                PooledDataSourceProvider provider = this.getProvider(removedPoolKey);
                List<String> removedDsList = removedDsKeyTable.get(removedPoolKey);
                Hashtable<String, DataSource> dsTable = dbmsPoolTable.get(removedPoolKey);
                for (String dsKey : removedDsList) {
                    DataSource removedDs = dsTable.remove(dsKey);
                    try {
                        provider.closePooledDataSource(removedDs);
                    } catch (SQLException e) {
                        //can't show the dsKey since it has encrypted password there
//                  todo      logger.error("Failed to close datadsource in dmbs poolKey = "
//                                + removedPoolKey, e);
                        continue;
                    }

                    //tracing
//                todo    if (logger.isDebugEnabled()) {
//                        logger.debug("Removed one datasource in dbms poolKey = "
//                                + removedPoolKey);
//                    }
                }
                //don't have any ds for the pool key
                if (dsTable.isEmpty()) {
                    dbmsPoolTable.remove(removedPoolKey);
                    //tracing
//              todo      if (logger.isDebugEnabled()) {
//                        logger.debug("Removed dbms poolKey = " + removedPoolKey);
//                    }
                }
            }
        }
    }
1301633
def _api_delete(path, data, server=None):
    '''
    
    '''
    server = _get_server(server)
    response = requests.delete(
            url=_get_url(server['ssl'], server['url'], server['port'], path),
            auth=_get_auth(server['user'], server['password']),
            headers=_get_headers(),
            params=data,
            verify=False
    )
    return _api_response(response)
1171994
function(collection, blacklist){
        var obj,
            result = [],
            prop,
            i,
            j,
            collLen,
            listLen;

        blacklist = blacklist || ["__columns"];

        if(!collection || !collection.length){
            return result;
        }

        collLen = collection.length;

        for(i=0; i<collLen; i++){
            obj = collection[i];

            //delete null properties
            for(prop in obj){
                if(obj[prop] === null){
                    delete obj[prop];
                }
            }

            listLen = blacklist.length;
            for(j=0; j<listLen; j++){
                delete obj[blacklist[j]];
            }
            //These are javascript objects and not json, so we have to do this magic to strip it of get methods.
            result.push(JSON.parse(JSON.stringify(obj)));
        }

        return result;
    }
1328805
def delete_pushdata(pushdata)
      @chunks = @chunks.inject([]) do |list, chunk|
        list << chunk if chunk.pushdata != pushdata
        list
      end
      return self
    end
346272
function removeAPI(name, ignoreNotFound) {
  return function (done) {
    API.removeByName(name, function (err, api) {
      if (api) {
        done(null, api);
      } else {
        if (err && err.message == NOT_FOUND) {
          if (ignoreNotFound) {
            done(null, false);
          } else {
            done(err);
          }
        } else {
          console.log(err);
          done(err);
        }
      }
    });
  }
}
672022
def delete_api(self, ret):
        '''
        
        '''

        exists_response = __salt__['boto_apigateway.api_exists'](name=self.rest_api_name,
                                                                 description=_Swagger.AWS_API_DESCRIPTION,
                                                                 **self._common_aws_args)
        if exists_response.get('exists'):
            if __opts__['test']:
                ret['comment'] = 'Rest API named {0} is set to be deleted.'.format(self.rest_api_name)
                ret['result'] = None
                ret['abort'] = True
                return ret

            delete_api_response = __salt__['boto_apigateway.delete_api'](name=self.rest_api_name,
                                                                         description=_Swagger.AWS_API_DESCRIPTION,
                                                                         **self._common_aws_args)
            if not delete_api_response.get('deleted'):
                ret['result'] = False
                ret['abort'] = True
                if 'error' in delete_api_response:
                    ret['comment'] = 'Failed to delete rest api: {0}.'.format(delete_api_response['error']['message'])
                return ret

            ret = _log_changes(ret, 'delete_api', delete_api_response)
        else:
            ret['comment'] = ('api already absent for swagger file: '
                              '{0}, desc: {1}'.format(self.rest_api_name, self.info_json))

        return ret
271272
def delete(self, endpoint, json=None, params=None, **kwargs):
        
        json = kwargs['data'] if 'data' in kwargs else json
        return self._make_request('delete', endpoint, data=json, params=params)
454926
def remove(config, username, filename, force):
        """"""
        client = Client()
        client.prepare_connection()
        user_api = UserApi(client)
        key_api = API(client)
        key_api.remove(username, user_api, filename, force)
581835
def remove_api_key(self):
        
        url = self.record_url + "/remove_api_key"
        res = requests.patch(url=url, headers=HEADERS, verify=False)
        res.raise_for_status()
        self.api_key = ""
983959
def _api_delete(self, api_key=None, **kwargs):
		
		api_key = api_key or self.default_api_key

		return self.api_retrieve(api_key=api_key).delete(**kwargs)
320555
public void delete(boolean forceDelete) throws APIException {
        HttpResponse response = client.delete(getUrl() + "?force=" + forceDelete);
        HttpClientHelpers.throwIfNotOk(response);
    }
980398
function removeObject (obj, iterate, context) {
  if (obj) {
    if (arguments.length > 1) {
      var removeKeys = []
      var rest = []
      context = context || this
      if (!isFunction(iterate)) {
        iterate = pluckProperty(iterate)
      }
      each(obj, function (item, index, rest) {
        if (iterate.call(context, item, index, rest)) {
          removeKeys.push(index)
        }
      })
      if (isArray(obj)) {
        lastEach(removeKeys, function (item, key) {
          rest.push(obj[item])
          obj.splice(item, 1)
        })
      } else {
        rest = {}
        arrayEach(removeKeys, function (key) {
          rest[key] = obj[key]
          deleteProperty(obj, key)
        })
      }
      return rest
    }
    return clearObject(obj)
  }
  return obj
}