def dup_finder(filename, unique_attr):
    """ Function to find duplicates in GTFS stop or route files

    :param filename: Input file location
    :param unique_attr: Attribute row in data set to be checked for duplicates

    dup_finder(str, int) -> str
    """
    fhand = open(filename, 'r')
    uid = {}
    for line in fhand:
        line1 = line.split(',"')
        line2 = line1[0].split(',')
        if line2[unique_attr] not in uid:
            uid[line2[unique_attr]] = 1
        else:
            uid[line2[unique_attr]] += 1
    fhand.close()
    for unique in uid:
        if uid[unique] > 1:
            print(unique)
