import csv


def read_csv(input_file):
    """ Read a csv as dict
      Return participant dict with paired_site """
    participant = {}
    with open(input_file) as csv_file:
        reader = csv.DictReader(csv_file)
        try:
            for row in reader:
                if row["paired_site"] == "" or row["paired_site"] is None:
                    # no_site_pairing is a possible bucket name in awardee bucket
                    row["paired_site"] = "no_site_pairing"

                participant[row["pmi_id"]] = row["paired_site"]
        except KeyError as e:
            print("Check csv file headers. Error: {}".format(e))

        return participant