0ec801fd087ff1d049344af4270a8b0220571ced,skbio/maths/gradient.py,,make_groups,#Any#Any#Any#Any#,36
Before Change
// Getting the index of the columns in the mapping file
ind_group = mapping[0].index(vector_category)
ind_sort = mapping[0].index(sort_category) if sort_category else 0
// Creating groups
groups = {}
for row in mapping[1:]:
After Change
// Creating groups
groups = defaultdict([])
// If sort_category is provided, we used the value of such category to sort
// otherwise we use the sample id
if sort_category:
sort_f = lambda sid: metamap.get_category_value(sid, sort_category)
else:
sort_f = lambda sid: sid
// Loop through all the sample ids present on the mapping file
for sid in metamap.sample_ids:
if sid not in ord_res.site_ids:
continue
// Get the group for the current sample
g = metamap.get_category_value(sid, vector_category)
// Add the current sample to the group
groups[g].append((sort_f(sid), sid))
// Sort the groups
for g in groups:
groups[g] = signed_natsort(groups[g])
return groups
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances Project Name: biocore/scikit-bio
Commit Name: 0ec801fd087ff1d049344af4270a8b0220571ced
Time: 2014-04-28
Author: josenavasmolina@gmail.com
File Name: skbio/maths/gradient.py
Class Name:
Method Name: make_groups
Project Name: HazyResearch/fonduer
Commit Name: b4ec3ea5a927e5ff3736c180157d8a727b67107d
Time: 2018-09-20
Author: senwu@cs.stanford.edu
File Name: src/fonduer/candidates/mentions.py
Class Name: Ngrams
Method Name: apply
Project Name: deeptools/HiCExplorer
Commit Name: 09a7f7a4deb2d05942e3ce122ddbe84205d984d6
Time: 2018-06-18
Author: wolffj@informatik.uni-freiburg.de
File Name: hicexplorer/chicPlotViewpoint.py
Class Name:
Method Name: main