Parameters
        ----------
        idx_to_delete_list, list

        Returns
        -------
        TermDocMatrix
345388
def remove_terms_by_indices(self, idx_to_delete_list):
        '''
        
        '''
        new_X, new_term_idx_store = self._get_X_after_delete_terms(idx_to_delete_list)

        return self._make_new_term_doc_matrix(new_X=new_X,
                                              new_mX=self._mX,
                                              new_y=None,
                                              new_category_idx_store=None,
                                              new_term_idx_store=new_term_idx_store,
                                              new_metadata_idx_store=self._metadata_idx_store,
                                              new_y_mask=np.ones(new_X.shape[0]).astype(np.bool))
1283473
def delete_list(self, list_id):
        
        route_values = {}
        if list_id is not None:
            route_values['listId'] = self._serialize.url('list_id', list_id, 'str')
        self._send(http_method='DELETE',
                   location_id='01e15468-e27c-4e20-a974-bd957dcccebc',
                   version='5.0-preview.1',
                   route_values=route_values)
309787
def delete_all_but(self, prefix, name):
        
        if prefix == name:
            Log.note("{{index_name}} will not be deleted", {"index_name": prefix})
        for a in self.get_aliases():
            # MATCH <prefix>YYMMDD_HHMMSS FORMAT
            if re.match(re.escape(prefix) + "\\d{8}_\\d{6}", a.index) and a.index != name:
                self.delete_index(a.index)
414087
def delistify(x):
    
    if isinstance(x, list):
        x = [e.replace("'", "") for e in x]
        return '-'.join(sorted(x))
    return x
1199622
def remove_hash_prefix_indices(self, threat_list, indices):
        """"""
        batch_size = 40
        q = '''DELETE FROM hash_prefix
                WHERE threat_type=? AND platform_type=? AND threat_entry_type=? AND value IN ({})
        '''
        prefixes_to_remove = self.get_hash_prefix_values_to_remove(threat_list, indices)
        with self.get_cursor() as dbc:
            for i in range(0, len(prefixes_to_remove), batch_size):
                remove_batch = prefixes_to_remove[i:(i + batch_size)]
                params = [
                    threat_list.threat_type,
                    threat_list.platform_type,
                    threat_list.threat_entry_type
                ] + [sqlite3.Binary(b) for b in remove_batch]
                dbc.execute(q.format(','.join(['?'] * len(remove_batch))), params)
981001
def remove_terms(self,list_term_ids):
        
        nodes_to_remove = set()
        for term in self:
            if term.get_id() in list_term_ids:
                nodes_to_remove.add(term.get_node())
                #For removing the previous comment
                prv = term.get_node().getprevious()
                if prv is not None:
                    nodes_to_remove.add(prv)
        
        for node in nodes_to_remove:
            self.node.remove(node)
277549
def list_remove_by_index(l, index):
    ''''''
    if index < 0 or index >= len(l):
        raise ValueError('index out of range')
    if index == (len(l) - 1):
        l.pop()
    elif index == 0:
        l = l[1:]
    else:
        l = l[0:index] + l[index+1:]

    return l
682616
def term_matrix(idlist, subject_category, taxon, **kwargs):
    
    results = search_associations(objects=idlist,
                                  subject_taxon=taxon,
                                  subject_category=subject_category,
                                  select_fields=[M.SUBJECT, M.OBJECT_CLOSURE],
                                  facet_fields=[],
                                  rows=-1,
                                  include_raw=True,
                                  **kwargs)
    docs = results['raw'].docs

    subjects_per_term = {}
    smap = {}
    for d in docs:
        smap[d[M.SUBJECT]] = 1
        for c in d[M.OBJECT_CLOSURE]:
            if c in idlist:
                if c not in subjects_per_term:
                    subjects_per_term[c] = []
                subjects_per_term[c].append(d[M.SUBJECT])
    pop_n = len(smap.keys())

    cells = []
    for cx in idlist:
        csubjs = set(subjects_per_term[cx])
        for dx in idlist:
            dsubjs = set(subjects_per_term[dx])
            a = len(csubjs.intersection(dsubjs))
            b = len(csubjs) - a
            c = len(dsubjs) - a
            d = pop_n - len(dsubjs) - b
            ctable = [[a, b], [c, d]]

            _, p_under = sp.stats.fisher_exact(ctable, 'less')
            _, p_over = sp.stats.fisher_exact(ctable, 'greater')

            cells.append({'c':cx, 'd':dx,
                          'nc':len(csubjs),
                          'nd':len(dsubjs),
                          'n':a,
                          'p_l':p_under,
                          'p_g':p_over
            })
    return cells
80173
def get_values(self, idx):
        
        if isinstance(idx, list):
            idx = np.array(idx, dtype=int)

        return self._data[:, idx]
936544
function removeFromList(imageIdIndex) {
    const index = stackPrefetch.indicesToRequest.indexOf(imageIdIndex);

    if (index > -1) {
      // Don't remove last element if imageIdIndex not found
      stackPrefetch.indicesToRequest.splice(index, 1);
    }
  }
457875
def delete(self, **kwargs):
        

        return self._client['users/*/lists/*'].delete(self.username, self.id, **kwargs)
559936
def cleanup(self):
        
        remove = []
        for handle, assoc in self.assocs.items():
            if assoc.expiresIn == 0:
                remove.append(handle)
        for handle in remove:
            del self.assocs[handle]
        return len(remove), len(self.assocs)
882091
def term_doc_lists(self):
        '''
        
        '''
        doc_ids = self._X.transpose().tolil().rows
        terms = self._term_idx_store.values()
        return dict(zip(terms, doc_ids))
1325502
def compact(self, term_doc_matrix):
		'''
		
		'''
		tdf = self.term_ranker(term_doc_matrix).get_ranks()
		tdf_sum = tdf.sum(axis=0)
		tdf_portions = tdf / tdf_sum
		threshold = np.max(self.term_count / tdf_sum)
		terms_to_remove = tdf_portions[~(tdf_portions > threshold).any(axis=1)].index
		return term_doc_matrix.remove_terms(terms_to_remove)
63804
def destroy_list(self, list_id):
        
        return List(tweepy_list_to_json(self._client.destroy_list(list_id=list_id)))
1272334
def get_doc_lengths(self):
        '''
        
        '''
        idx_to_delete_list = self._build_term_index_list(True, self._get_non_unigrams())
        unigram_X, _ = self._get_X_after_delete_terms(idx_to_delete_list)
        return unigram_X.sum(axis=1).A1
455159
def _delete(self, identifier=None):
        
        query = text("""
            DELETE FROM identifier_index
            WHERE identifier = :identifier;
        """)
        self.backend.library.database.connection.execute(query, identifier=identifier)