def filter_partition_list(partitions, devnames):
 filtered_list = []
 for p in partitions:
  for d in devnames:
   if ((p.device == d) and (p not in filtered_list)):
    filtered_list.append(p)
 return filtered_list

def filter_partition_list ( partitions , devnames ) : filtered_list = [ ] for p in partitions : for d in devnames : if ( ( p . device == d ) and ( p not in filtered_list ) ) : filtered_list . append ( p ) return filtered_list
pick and choose which partition to keep .