def sample_mapped_keys(mapping, min_coverage=50):
 if (min_coverage == 0):
  return {}
 sample_keys = {}
 for key in mapping.keys():
  if (min_coverage > 1):
   sample_keys[key] = sample(mapping[key], min((min_coverage - 1), len(mapping[key])))
  else:
   sample_keys[key] = []
  sample_keys[key].append(key)
 return sample_keys

def sample_mapped_keys ( mapping , min_coverage = 50 ) : if ( min_coverage == 0 ) : return { } sample_keys = { } for key in mapping . keys ( ) : if ( min_coverage > 1 ) : sample_keys [ key ] = sample ( mapping [ key ] , min ( ( min_coverage - 1 ) , len ( mapping [ key ] ) ) ) else : sample_keys [ key ] = [ ] sample_keys [ key ] . append ( key ) return sample_keys
sample up to min_coverage keys for each key in mapping .