def parse(self, file_obj):
host = {"<STR_LIT:host>": ["<STR_LIT:*>"], "<STR_LIT>": {}}<EOL>for line in file_obj:<EOL><INDENT>line = line.strip()<EOL>if not line or line.startswith("<STR_LIT:#>"):<EOL><INDENT>continue<EOL><DEDENT>match = re.match(self.SETTINGS_REGEX, line)<EOL>if not match:<EOL><INDENT>raise Exception("<STR_LIT>".format(line))<EOL><DEDENT>key = match.group(<NUM_LIT:1>).lower()<EOL>value = match.group(<NUM_LIT:2>)<EOL>if key == "<STR_LIT:host>":<EOL><INDENT>self._config.append(host)<EOL>host = {"<STR_LIT:host>": self._get_hosts(value), "<STR_LIT>": {}}<EOL><DEDENT>elif key == "<STR_LIT>" and value.lower() == "<STR_LIT:none>":<EOL><INDENT>host["<STR_LIT>"][key] = None<EOL><DEDENT>else:<EOL><INDENT>if value.startswith('<STR_LIT:">') and value.endswith('<STR_LIT:">'):<EOL><INDENT>value = value[<NUM_LIT:1>:-<NUM_LIT:1>]<EOL><DEDENT>if key in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>if key in host["<STR_LIT>"]:<EOL><INDENT>host["<STR_LIT>"][key].append(value)<EOL><DEDENT>else:<EOL><INDENT>host["<STR_LIT>"][key] = [value]<EOL><DEDENT><DEDENT>elif key not in host["<STR_LIT>"]:<EOL><INDENT>host["<STR_LIT>"][key] = value<EOL><DEDENT><DEDENT><DEDENT>self._config.append(host)<EOL>
Read an OpenSSH config from the given file object.

:param file_obj: a file-like object to read the config file from