Skip to content

Instantly share code, notes, and snippets.

View jgdshkovi's full-sized avatar
🎯
Focusing

Jagadeesh Kovi jgdshkovi

🎯
Focusing
View GitHub Profile
@jgdshkovi
jgdshkovi / EmployeeService.java
Created December 13, 2021 05:42
Collections problem
package com.cg.demo;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
//import java.util.function.Predicate;
//import java.util.TreeSet;
public class EmployeeService {
from collections import defaultdict
def list_duplicates(seq):
tally = defaultdict(list)
for i,item in enumerate(seq):
tally[item].append(i)
return ((key,locs) for key,locs in tally.items() if len(locs)>1)
def return_mask(wts, labels,thr):
modsource = labels.copy()
import warnings
import numpy as np
import scipy.sparse as sp
from joblib import Parallel, delayed
from sklearn.cluster import KMeans
from sklearn.cluster import _k_means_fast as _k_means
from sklearn.cluster.k_means_ import (