def open_get_line(filename, limit=-1, **kwargs):
    """Opens the password file named @filename and reads first @limit
    passwords. @kwargs are passed to get_line for further processing.
    For example, pw_filter etc.
    @fielname: string
    @limit: integer
    """
    allowed_keys_for_get_line = {'sep', 'pw_filter', 'errors'}
    for k in list(kwargs.keys()):
        if k not in allowed_keys_for_get_line:
            del kwargs[k]
    print("After filtering: {}".format(kwargs))
    with open_(filename, 'rt') as f:
        for w, c in get_line(f, limit, **kwargs):
            yield w, c
Opens the password file named @filename and reads first @limit
    passwords. @kwargs are passed to get_line for further processing.
    For example, pw_filter etc.
    @fielname: string
    @limit: integer