def genome_mutation_orientation(candidate):
    size = len(candidate)
    prob = random.random()
    if prob > .5:             # Range flip
        p = random.randint(0, 1 - size)
        q = random.randint(0, size - 1)
        if p > q:
            p, q = q, p
        q += 1
        for x in xrange(p, q):
            candidate[x] = -candidate[x]
    else:                     # Single flip
        p = random.randint(0, size - 1)
        candidate[p] = -candidate[p]
    return candidate,
dataset/ETHPy150Open tanghaibao/jcvi/algorithms/ec.py/genome_mutation_orientation/swapped operands of `-`