def to_string(self):
        def string_rep(val):
            """ Determine the correct string rep for the config file """
            if isinstance(val, bool):
                # True -> true and False -> false
                return six.text_type(val).lower()
            elif isinstance(val, six.string_types) and val.startswith(':'):
                # ruby symbols, like :nested, used for "output_style"
                return six.text_type(val)
            elif isinstance(val, dict):
                # ruby hashes, for "sass_options" for example
                return u'{%s}' % ', '.join("'%s' => '%s'" % i for i in val.items())
            elif isinstance(val, tuple):
                val = list(val)
            # works fine with strings and lists
            return repr(val)
        return u'\n'.join(['%s = %s' % (k, string_rep(v)) for k, v in self.items()])
dataset/ETHPy150Open miracle2k/webassets/src/webassets/filter/compass.py/CompassConfig.to_string/original