title: Get random sample from list while maintaining ordering of items?
body: <p>I have a sorted list, let say: (its not really just numbers, its a list of objects that are sorted with a complicated time consuming algorithm)</p>
  
  <pre><code>mylist = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ,9  , 10 ]
  </code></pre>
  
  <p>Is there some python function that will give me N of the items, but will keep the order?</p>
  
  <p>Example:</p>
  
  <pre><code>randomList = getRandom(mylist,4)
  # randomList = [ 3 , 6 ,7 , 9 ]
  randomList = getRandom(mylist,4)
  # randomList = [ 1 , 2 , 4 , 8 ]
  </code></pre>
  
  <p>etc...</p>