<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_vars(self, tokens):
 """ Given an iterable of tokens, returns variables and their values as a dictionary. For example: ['dtap=prod', 'comment=some comment'] Returns: {'dtap': 'prod', 'comment': 'some comment'} """

        key_values = {}
        for token in tokens:
            if token.startswith('#'):
                # End parsing if we encounter a comment, which lasts
                # until the end of the line.
                break
            else:
                k, v = token.split('=', 1)
                key = k.strip()
                key_values[key] = v.strip()
        return key_values