def METHOD_NAME(p):
  """Shuffles data from PCollection.
  Args:
    p: PCollection.
  Returns:
    PCollection of shuffled data.
  """
  class _AddRandomKey(beam.DoFn):
    def process(self, element):
      yield random.random(), element
  shuffled_data = (
      p
      | 'PairWithRandom' >> beam.ParDo(_AddRandomKey())
      | 'GroupByRandom' >> beam.GroupByKey()
      | 'DropRandom' >> beam.FlatMap(lambda (k, vs): vs))
  return shuffled_data