def main():
    (options, args_, parser_) = simple_options(_parser, __version__, __dependencies__)

    source_file = options.input

    LOG.info('%s %s', __file__, source_file)
    LOG.info('input: %s', source_file)

    try:
        with open(source_file, 'r') as source:
            json_asset = json.load(source)

            def find_node(nodes, sub_asset):
                for (k, v) in sub_asset.iteritems():
                    if fnmatch(k, nodes[0]):
                        if len(nodes) == 1:
                            yield (k, sub_asset[k])
                        elif isinstance(v, dict):
                            for n in find_node(nodes[1:], sub_asset[k]):
                                yield n
                            for n in find_node(nodes, sub_asset[k]):
                                yield n

            if options.path:
                node_list = options.path.split('/')

            if options.html:
                renderer = Json2htmlRenderer()
            elif options.color:
                renderer = Json2txtColourRenderer()
            else:
                renderer = Json2txtRenderer()

            disassembler = Disassembler(renderer, options.listcull, options.dictcull, options.depth)
            expand = True

            if options.output:
                with open(options.output, 'w') as target:
                    if options.path:
                        for name, node in find_node(node_list, json_asset):
                            target.write(name + ': ' + disassembler.mark_up_asset({name: node}, expand))
                            target.write('\n')
                    else:
                        target.write(disassembler.mark_up_asset({'root': json_asset}, expand))
                        target.write('\n')
            elif options.color:
                if options.path:
                    for name, node in find_node(node_list, json_asset):
                        print '\033[;31m' + name + '\033[;m' + ': ' + disassembler.mark_up_asset({name: node}, expand),
                else:
                    print disassembler.mark_up_asset({'root': json_asset}, expand)
            else:
                if options.path:
                    for name, node in find_node(node_list, json_asset):
                        print name + ': ' + disassembler.mark_up_asset({name: node}, expand),
                else:
                    print disassembler.mark_up_asset({'root': json_asset}, expand)

    except __HOLE__ as e:
        LOG.error(e)
        return e.errno
    except Exception as e:
        LOG.critical('Unexpected exception: %s', e)
        return 1
    return 0
dataset/ETHPy150Open turbulenz/turbulenz_tools/turbulenz_tools/tools/json2txt.py/main