def convert(self, value):
if not isinstance(value, ConvertingDict) and isinstance(value, dict):<EOL><INDENT>value = ConvertingDict(value)<EOL>value.configurator = self<EOL><DEDENT>elif not isinstance(value, ConvertingList) and isinstance(value, list):<EOL><INDENT>value = ConvertingList(value)<EOL>value.configurator = self<EOL><DEDENT>elif not isinstance(value, ConvertingTuple) andisinstance(value, tuple):<EOL><INDENT>value = ConvertingTuple(value)<EOL>value.configurator = self<EOL><DEDENT>elif isinstance(value, six.string_types):  <EOL><INDENT>m = self.CONVERT_PATTERN.match(value)<EOL>if m:<EOL><INDENT>d = m.groupdict()<EOL>prefix = d['<STR_LIT>']<EOL>converter = self.value_converters.get(prefix, None)<EOL>if converter:<EOL><INDENT>suffix = d['<STR_LIT>']<EOL>converter = getattr(self, converter)<EOL>value = converter(suffix)<EOL><DEDENT><DEDENT><DEDENT>return value<EOL>
Convert values to an appropriate type. dicts, lists and tuples are
replaced by their converting alternatives. Strings are checked to
see if they have a conversion format and are converted if they do.