<commit_before>#include "Python.h"

static PyObject *
mandelbrot(PyObject *self, PyObject *args)
{
  int c_real,
    c_imaginary,
    iterations,
    i,
    real,
    imaginary,
    tmp;

  if (!PyArg_ParseTuple(args, "iii", &c_real, &c_imaginary, &iterations))
    return NULL;
  real = c_real;
  imaginary = c_imaginary;
  for (i = 0 ; i < iterations ; i++)
    {
      if (real * real + imaginary * imaginary > 4)
	break;
      tmp = imaginary;
      imaginary = 2 * real * imaginary + c_imaginary;
      real = real * real - tmp * tmp + c_real;
    }
  return Py_BuildValue("i", i);
}<commit_msg>fix: add methods initialization in cmandelbrot<commit_after>#include "Python.h"

static PyObject *
mandelbrot(PyObject *self, PyObject *args)
{
  int c_real,
    c_imaginary,
    iterations,
    i,
    real,
    imaginary,
    tmp;

  if (!PyArg_ParseTuple(args, "iii", &c_real, &c_imaginary, &iterations))
    return NULL;
  real = c_real;
  imaginary = c_imaginary;
  for (i = 0 ; i < iterations ; i++)
    {
      if (real * real + imaginary * imaginary > 4)
	break;
      tmp = imaginary;
      imaginary = 2 * real * imaginary + c_imaginary;
      real = real * real - tmp * tmp + c_real;
    }
  return Py_BuildValue("i", i);
}

static PyMethodDef Methods[] = {
      {"cmandelbrot",  mandelbrot, METH_VARARGS,
       "Calculate number of iterations for a given complex."},
      {NULL, NULL, 0, NULL}        /* Sentinel */
};

PyMODINIT_FUNC
initcmandelbrot(void)
{
  (void) Py_InitModule("cmandelbrot", Methods);
}
{'fraction_non_alphanumeric': 0.12680683311432325, 'fraction_numerical': 0.0045992115637319315, 'mean_word_length': 2.9354005167958657, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6097066', 'n_tokens_mistral': 554, 'n_tokens_neox': 543, 'n_words': 143}