def load(self, filename):
        '''
        Load and index keys from OpenSSH known_hosts file. In order to
        preserve lines, the text content is stored in a list (_lines),
        and indexes are used to keep line number(s) per host, as well as
        index lists for hashed hosts and wildcard matches, which would
        both need to be sequentially scanned if the host is not found
        in the primary index lookup.

        If this method is called multiple times, the host keys are appended,
        not cleared.  So multiple calls to `load` will produce a concatenation
        of the loaded files, in order.
        '''
        offset = len(self._lines)
        with open(filename, 'r') as f:
            for lineno, line in enumerate(f):
                self._lines.append(line.rstrip('\n'))
                try:
                    e = HostKeyEntry.from_line(line, lineno)
                    if e is not None:
                        # Just construct the host index entries during load
                        # Identify as hashed entry, negation, wildcard, or regular
                        # Keep the index by the source lineno (plus offset, if
                        # loading multiple files), as the matching needs the
                        # whole line for negation logic, and to pick up the
                        # optional @marker...
                        for h in e.hostnames:
                            if h.startswith('|'):
                                self._hashed_hosts.append((h, offset + lineno))
                            elif h.startswith('!'):
                                # negation - do not index
                                pass
                            elif '*' in h or '?' in h:
                                self._wildcards.append((h, offset + lineno))
                            else:
                                self._index[h].append(offset + lineno)
                except (UnreadableKey, __HOLE__) as e:
                    logging.getLogger('radssh.keys').error(
                        'Skipping unloadable key line (%s:%d): %s' % (filename, lineno + 1, line))
                    pass
dataset/ETHPy150Open radssh/radssh/radssh/known_hosts.py/KnownHosts.load