def translate(self, mo):
attrs = {}<EOL>groupdict = mo.groupdict()<EOL>for name, value in compat_iteritems(groupdict):<EOL><INDENT>if value is None:<EOL><INDENT>value = None<EOL><DEDENT>elif self._int_re.match(value):<EOL><INDENT>value = int(value)<EOL><DEDENT>elif self._float_re.match(value):<EOL><INDENT>value = float(value)<EOL><DEDENT>attrs[name] = (value)<EOL><DEDENT>return Struct(attrs)<EOL>
Extract a structure from a match object, while translating the types in the process.