def generate_zip_with_7za_from_filepairs(pairs, archive_path):

  staging_dir = '/tmp/stage_7za'
  if os.path.exists(staging_dir):
    shutil.rmtree(staging_dir)
  os.makedirs(staging_dir)

  pair_map = {}
  for source, dest in pairs:
    if not source.endswith(dest):
      staging_source = os.path.join(staging_dir, dest)
      shutil.copyfile(source, staging_source)
      source_root = staging_dir
    else:
      source_root = source[:-len(dest)]
    if source_root not in pair_map:
      pair_map[source_root] = set()
    pair_map[source_root].add(dest)
  for source_root, dest_set in pair_map.iteritems():
    generate_zip_with_7za(source_root, sorted(dest_set), archive_path)
Tests the queryset filter method parses it's kwargs properly
dataset/ETHPy150Open googlei18n/nototools/nototools/tool_utils.py/generate_zip_with_7za_from_filepairs--crossover with--dataset/ETHPy150Open datastax/python-driver/tests/integration/cqlengine/query/test_named.py/TestQuerySetOperation.test_query_filter_parsing