def contains_in_any_order(expected):
  def matcher(value):
    vs = collections.Counter(value)
    es = collections.Counter(expected)
    if vs != es:
      raise ValueError(
          'extra: %s, missing: %s' % (vs - es, es - vs))
    return True
  return matcher
dataset/ETHPy150Open GoogleCloudPlatform/DataflowPythonSDK/google/cloud/dataflow/examples/complete/autocomplete_test.py/contains_in_any_order/original