<commit_before>/* Copyright 2009 INRIA, Université Bordeaux 1  */

#include <config.h>
#include <libtopology.h>

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

static void output_topology (lt_topo_t *topology, lt_level_t l, FILE *output, int i, int verbose_mode);

int
main (int argc, char *argv[])
{
  int err;
  int verbose_mode = 0;
  lt_topo_t *topology;
  FILE *output;

  err = lt_topo_init (&topology, NULL);
  if (!err)
    return EXIT_FAILURE;

  while (argc >= 2)
    {
      if (!strcmp (argv[1], "-v") || !strcmp (argv[1], "--verbose"))
	verbose_mode = 1;
      else
	fprintf (stderr, "Unrecognized options: %s\n", argv[1]);
      argc--;
      argv++;
    }

  output = stdout;

  output_topology (topology, &topology->levels[0][0], output, 0, verbose_mode);

  if (verbose_mode)
    {
      int l,i;
      for (l = 0; l < LT_LEVEL_MAX; l++)
	{
	  int depth = topology->type_depth[l];
	  for (i = 0; i<depth; i++)
	    fprintf (output, " ");
	  fprintf (output, "depth %d:\ttype #%d (%s)\n", depth, l, lt_level_string (l));
	}
    }

  lt_topo_fini (topology);

  return EXIT_SUCCESS;
}

#define indent(output, i) \
  fprintf (output, "%*s", 2*i, "");<commit_msg>use %*s to more easily indent<commit_after>/* Copyright 2009 INRIA, Université Bordeaux 1  */

#include <config.h>
#include <libtopology.h>

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

static void output_topology (lt_topo_t *topology, lt_level_t l, FILE *output, int i, int verbose_mode);

int
main (int argc, char *argv[])
{
  int err;
  int verbose_mode = 0;
  lt_topo_t *topology;
  FILE *output;

  err = lt_topo_init (&topology, NULL);
  if (!err)
    return EXIT_FAILURE;

  while (argc >= 2)
    {
      if (!strcmp (argv[1], "-v") || !strcmp (argv[1], "--verbose"))
	verbose_mode = 1;
      else
	fprintf (stderr, "Unrecognized options: %s\n", argv[1]);
      argc--;
      argv++;
    }

  output = stdout;

  output_topology (topology, &topology->levels[0][0], output, 0, verbose_mode);

  if (verbose_mode)
    {
      int l;
      for (l = 0; l < LT_LEVEL_MAX; l++)
	{
	  int depth = topology->type_depth[l];
	  fprintf (output, "%*sdepth %d:\ttype #%d (%s)\n", depth, "", depth, l, lt_level_string (l));
	}
    }

  lt_topo_fini (topology);

  return EXIT_SUCCESS;
}

#define indent(output, i) \
  fprintf (output, "%*s", 2*i, "");
{'fraction_non_alphanumeric': 0.1715623669646658, 'fraction_numerical': 0.0140485312899106, 'mean_word_length': 3.3357933579335795, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '712644', 'n_tokens_mistral': 972, 'n_tokens_neox': 919, 'n_words': 245}