:param list | dict data:
    :param Optional[int] indent:
    :rtype: unicode
771921
def dump_json(data, indent=None):
    
    return json.dumps(data,
                      indent=indent,
                      ensure_ascii=False,
                      sort_keys=True,
                      separators=(',', ': '))
717068
def output(data, **kwargs):  # pylint: disable=unused-argument
    '''
    
    '''
    try:
        if 'output_indent' not in __opts__:
            return salt.utils.json.dumps(data, default=repr, indent=4)

        indent = __opts__.get('output_indent')
        sort_keys = False

        if indent is None:
            indent = None

        elif indent == 'pretty':
            indent = 4
            sort_keys = True

        elif isinstance(indent, int):
            if indent >= 0:
                indent = indent
            else:
                indent = None

        return salt.utils.json.dumps(data, default=repr, indent=indent, sort_keys=sort_keys)

    except UnicodeDecodeError as exc:
        log.error('Unable to serialize output to json')
        return salt.utils.json.dumps(
            {'error': 'Unable to serialize output to json',
             'message': six.text_type(exc)}
        )

    except TypeError:
        log.debug('An error occurred while outputting JSON', exc_info=True)
    # Return valid JSON for unserializable objects
    return salt.utils.json.dumps({})
447396
def indent(s, spaces=4):
    
    new = re.sub('(\n+)', '\\1%s' % (' ' * spaces), s)
    return (' ' * spaces) + new.strip()
1276734
function stringifyIndented(value, chr, n) {
  return indent(JSON.stringify(value, null, n), chr, n).slice(chr.length * n)
}
1021728
def prepare_rows(self,
                     rows,
                     indent,
                     has_header):

        ''''''

        out = []

        def row_wrapper(row):
            new_rows = [
                self.wrapfunc(item).split('\n')
                for item in row
            ]
            rows = []
            for item in map(lambda *args: args, *new_rows):
                if isinstance(item, (tuple, list)):
                    rows.append([substr or '' for substr in item])
                else:
                    rows.append([item])
            return rows

        logical_rows = [
            row_wrapper(row)
            for row in rows
        ]

        columns = map(lambda *args: args, *reduce(operator.add, logical_rows))

        max_widths = [
            max([len(six.text_type(item)) for item in column])
            for column in columns
        ]
        row_separator = self.row_delimiter * (len(self.prefix) + len(self.suffix) + sum(max_widths) +
                                              len(self.delim) * (len(max_widths) - 1))

        justify = self._JUSTIFY_MAP[self.justify.lower()]

        if self.separate_rows:
            out.append(
                self.ustring(
                    indent,
                    self.LIGHT_GRAY,  # pylint: disable=no-member
                    row_separator
                )
            )
        for physical_rows in logical_rows:
            for row in physical_rows:
                line = self.prefix \
                        + self.delim.join([
                                justify(six.text_type(item), width)
                                for (item, width) in zip(row, max_widths)
                        ]) + self.suffix
                out.append(
                    self.ustring(
                        indent,
                        self.WHITE,  # pylint: disable=no-member
                        line
                    )
                )
            if self.separate_rows or has_header:
                out.append(
                    self.ustring(
                        indent,
                        self.LIGHT_GRAY,  # pylint: disable=no-member
                        row_separator
                    )
                )
                has_header = False
        return out
1080287
def _fill_text(self, text, width, indent):
        
        parts = text.split('\n\n')
        for i, part in enumerate(parts):
            # Check to see if it's a bulleted list--if so, then fill each line
            if part.startswith('* '):
                subparts = part.split('\n')
                for j, subpart in enumerate(subparts):
                    subparts[j] = super(WrappedTextHelpFormatter, self)._fill_text(
                        subpart, width, indent
                    )
                parts[i] = '\n'.join(subparts)
            else:
                parts[i] = super(WrappedTextHelpFormatter, self)._fill_text(part, width, indent)

        return '\n\n'.join(parts)
323545
def ast_str(self, indent=0):
        
        line = self.line or 0
        col = self.column or 0
        name = type(self).__name__
        spell = getattr(self, 'name', '[no spelling]')
        result = ' ({})'.format(self.result) if hasattr(self, 'result') else ''
        prefix = indent * '| '
        return '{}[{}:{}] {}{}: {}'.format(prefix, line, col,
                                           name, result, spell)
444410
function formatList(raw) {
    var list;

    if (!raw) {
        return [];
    }

    list = raw.replace(/\(.+?\)/g, '').split(', ');
    list = list.map(function (item) {
        return item.trim();
    });

    return list;
}
702264
def format_lists(lists)
      lists.inject([nil]) do |buf, (_, val)|
        opts = Kat::Search.send(val[:select])
        buf << val[:select].to_s.capitalize
        buf << nil unless opts.values.first.is_a? Array
        width = opts.keys.sort { |a, b| b.size <=> a.size }.first.size
        opts.each do |k, v|
          buf += if v.is_a? Array
                   [nil, "%#{ width }s => #{ v.shift }" % k] +
                     v.map { |e| ' ' * (width + 4) + e }
                 else
                   ["%-#{ width }s => #{ v }" % k]
                 end
        end
        buf << nil
      end
    end
1351851
def format_errors(errors, indent=0, prefix='', suffix=''):
    
    if is_single_item_iterable(errors):
        errors = errors[0]
    if isinstance(errors, SINGULAR_TYPES):
        yield indent_message(repr(errors), indent, prefix=prefix, suffix=suffix)

    elif isinstance(errors, collections.Mapping):
        for key, value in errors.items():
            assert isinstance(key, SINGULAR_TYPES), type(key)
            if isinstance(value, SINGULAR_TYPES):
                message = "{0}: {1}".format(repr(key), repr(value))
                yield indent_message(message, indent, prefix=prefix, suffix=suffix)
            else:
                yield indent_message(repr(key), indent, prefix=prefix, suffix=':')
                for message in format_errors(value, indent + 4, prefix='- '):
                    yield message

    elif is_non_string_iterable(errors):
        # for making the rhs of the numbers line up
        extra_indent = int(math.ceil(math.log10(len(errors)))) + 2
        for index, value in enumerate(errors):
            list_prefix = "{0}. ".format(index)
            messages = format_errors(
                value,
                indent=indent + extra_indent - len(list_prefix),
                prefix=list_prefix,
            )
            for message in messages:
                yield message
    else:
        assert False, "should not be possible"
367410
def build_data_list(lst):
    
    txt = '<H3>' + List + '<H3><UL>'
    for i in lst:
        txt += '<LI>' + i + '</LI>'
        
    txt += '<UL>'
    return txt
609843
def custom_print(data_structure, indent):
    
    for key, value in data_structure.items():
        print("\n%s%s:" % (' ' * attribute_indent * indent, str(key)), end=' ')
        if isinstance(value, OrderedDict):
            custom_print(value, indent + 1)
        elif isinstance(value, dict):
            custom_print(value, indent + 1)
        else:
            print("%s" % (str(value)), end=' ')
364940
def format_list(data):
    
    if isinstance(data, (list, tuple)):
        to_clean = ['[', ']', '(', ')', "'"]
        for item in to_clean:
            data = str(data).replace("u\"", "\"").replace("u\'", "\'")
            data = str(data).replace(item, '')
    return data
1168807
def add_line_with_subsequent_indent(self, line, indent=4):
        
        if isinstance(line, (list, tuple)):
            line = ''.join(line)
        line = line.strip()
        width = self.textwidth-self.indent-indent
        wrapped_lines = textwrap.wrap(line[indent:], width=width)
        for i in range(len(wrapped_lines)):
            if wrapped_lines[i] != '':
                wrapped_lines[i] = indent * ' ' + wrapped_lines[i]
        self.pieces.append(line[:indent] + '\n'.join(wrapped_lines)[indent:] + '  \n')
1329854
def tostr(self, object, indent=-2):
        
        history = []
        return self.process(object, history, indent)
407785
def quoted_or_list(items: List[str]) -> Optional[str]:
    
    return or_list([f"'{item}'" for item in items])
1171265
def indent(func):
    
    def wrapper(self, *args, **kwds):
        func(self, *args, **kwds)
        return Indent(self)
    return wrapper