def getRandomWithMods(inputSpace, maxChanges):
 size = len(inputSpace)
 ind = np.random.random_integers(0, (size - 1), 1)[0]
 value = copy.deepcopy(inputSpace[ind])
 if (maxChanges == 0):
  return value
 return modifyBits(value, maxChanges)

def getRandomWithMods ( inputSpace , maxChanges ) : size = len ( inputSpace ) ind = np . random . random_integers ( 0 , ( size - 1 ) , 1 ) [ 0 ] value = copy . deepcopy ( inputSpace [ ind ] ) if ( maxChanges == 0 ) : return value return modifyBits ( value , maxChanges )
returns a random selection from the inputspace with randomly modified up to maxchanges number of bits .