def pick_target_decoy(tfeature, dfeature):
    """Feed it with a target and decoy score and the protein/gene/id names,
    and this will return target/decoy type, the winning ID and the score"""
    tscore, dscore = get_score(tfeature), get_score(dfeature)
    if tscore == dscore:
        # same score or both False
        return False
    elif False in [tscore, dscore]:
        # return the non-False feature
        return [v for k, v in {tscore: tfeature, dscore: dfeature}.items()
                if k is not False][0]
    elif tscore > dscore:
        return tfeature
    elif tscore < dscore:
        return dfeature
    else:
        # in case uncaught edgecase occurs
        print('WARNING, target score {} and decoy score {} could not be '
              'compared'.format(tscore, dscore))
        return False
def pick_target_decoy ( tfeature , dfeature ) : tscore , dscore = get_score ( tfeature ) , get_score ( dfeature ) if tscore == dscore : return False elif False in [ tscore , dscore ] : return [ v for k , v in { tscore : tfeature , dscore : dfeature } . items ( ) if k is not False ] [ 0 ] elif tscore > dscore : return tfeature elif tscore < dscore : return dfeature else : print ( 'WARNING, target score {} and decoy score {} could not be ' 'compared' . format ( tscore , dscore ) ) return False
Feed it with a target and decoy score and the protein/gene/id names,
    and this will return target/decoy type, the winning ID and the score