def colon_separated_string_to_dict(string, separator="<STR_LIT::>"):
dictionary = dict()<EOL>for line in string.splitlines():<EOL><INDENT>line_data = line.split(separator)<EOL>if len(line_data) > <NUM_LIT:1>:<EOL><INDENT>dictionary[line_data[<NUM_LIT:0>].strip()] = "<STR_LIT>".join(line_data[<NUM_LIT:1>:]).strip()<EOL><DEDENT>elif len(line_data) == <NUM_LIT:1>:<EOL><INDENT>dictionary[line_data[<NUM_LIT:0>].strip()] = None<EOL><DEDENT>else:<EOL><INDENT>raise Exception(<EOL>"<STR_LIT>".format(line)<EOL>)<EOL><DEDENT><DEDENT>return dictionary<EOL>
Converts a string in the format:

    Name: Et3
    Switchport: Enabled
    Administrative Mode: trunk
    Operational Mode: trunk
    MAC Address Learning: enabled
    Access Mode VLAN: 3 (VLAN0003)
    Trunking Native Mode VLAN: 1 (default)
    Administrative Native VLAN tagging: disabled
    Administrative private VLAN mapping: ALL
    Trunking VLANs Enabled: 2-3,5-7,20-21,23,100-200
    Trunk Groups:

into a dictionary