<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(self, kv):
 """ Parses key value string into dict Examples: >> parser.parse('test1.test2=value') {'test1': {'test2': 'value'}} >> parser.parse('test=value') {'test': 'value'} """

        key, val = kv.split(self.kv_sep, 1)
        keys = key.split(self.keys_sep)
        for k in reversed(keys):
            val = {k: val}
        return val