#!/usr/bin/env python3
import sys

leaguePath = sys.argv[1]

with open(leaguePath) as f:
    content = f.readlines()
    league_set = set([pid.strip() for pid in content if pid.strip() != ''])

for line in sys.stdin:
    # parse input from mappers
    pid, count = line.strip().split('\t', 1)
    if pid not in league_set:
        continue

    # convert count (currently a string) to int
    try:
        count = int(count)
    except ValueError:
        # count was not a number, so silently
        # ignore/discard this line
        continue

    print('%s\t%s' % (pid, count))

53a4b99c3063f4d610b2dd22241a14b6a44abd09
<mask token>

<mask token>
with open(leaguePath) as f:
    content = f.readlines()
    league_set = set([pid.strip() for pid in content if pid.strip() != ''])
for line in sys.stdin:
    pid, count = line.strip().split('\t', 1)
    if pid not in league_set:
        continue
    try:
        count = int(count)
    except ValueError:
        continue
    print('%s\t%s' % (pid, count))

<mask token>
leaguePath = sys.argv[1]
with open(leaguePath) as f:
    content = f.readlines()
    league_set = set([pid.strip() for pid in content if pid.strip() != ''])
for line in sys.stdin:
    pid, count = line.strip().split('\t', 1)
    if pid not in league_set:
        continue
    try:
        count = int(count)
    except ValueError:
        continue
    print('%s\t%s' % (pid, count))

import sys
leaguePath = sys.argv[1]
with open(leaguePath) as f:
    content = f.readlines()
    league_set = set([pid.strip() for pid in content if pid.strip() != ''])
for line in sys.stdin:
    pid, count = line.strip().split('\t', 1)
    if pid not in league_set:
        continue
    try:
        count = int(count)
    except ValueError:
        continue
    print('%s\t%s' % (pid, count))

#!/usr/bin/env python3
import sys

leaguePath = sys.argv[1]

with open(leaguePath) as f:
    content = f.readlines()
    league_set = set([pid.strip() for pid in content if pid.strip() != ''])

for line in sys.stdin:
    # parse input from mappers
    pid, count = line.strip().split('\t', 1)
    if pid not in league_set:
        continue

    # convert count (currently a string) to int
    try:
        count = int(count)
    except ValueError:
        # count was not a number, so silently
        # ignore/discard this line
        continue

    print('%s\t%s' % (pid, count))
