<commit_before>import numpy
import random

# TODO: do something about the lack of symmetric

class terrain_generator():
    def create_random(self, size, range):
        """Creates a random terrain map"""
        return numpy.random.random_integers(0, range - 1, size)

    def create_streak(self, size, range):
        """Creates a terrain map containing streaks that run from north-west to south-east"""
        ret = [[0]]
        for x in xrange(size[0] - 1):
            pos_west = ret[0][-1]
            if not pos_west:
              ret[0].append(pos_west + random.randrange(0, 2))
            elif pos_west == range - 1:
              ret[0].append(pos_west + random.randrange(-1, 1))
            else:
              ret[0].append(pos_west + random.randrange(-1, 2))

        for y in xrange(size[1] - 1):
            pos_north = ret[0][-1]
            if not pos_north:
                next_row = [pos_north + random.randrange(0, 2)]<commit_msg>fixed typo<commit_after>import numpy
import random

# TODO: do something about the lack of symmetry

class terrain_generator():
    def create_random(self, size, range):
        """Creates a random terrain map"""
        return numpy.random.random_integers(0, range - 1, size)

    def create_streak(self, size, range):
        """Creates a terrain map containing streaks that run from north-west to south-east"""
        ret = [[0]]
        for x in xrange(size[0] - 1):
            pos_west = ret[0][-1]
            if not pos_west:
              ret[0].append(pos_west + random.randrange(0, 2))
            elif pos_west == range - 1:
              ret[0].append(pos_west + random.randrange(-1, 1))
            else:
              ret[0].append(pos_west + random.randrange(-1, 2))

        for y in xrange(size[1] - 1):
            pos_north = ret[0][-1]
            if not pos_north:
                next_row = [pos_north + random.randrange(0, 2)]
{'fraction_non_alphanumeric': 0.12067156348373557, 'fraction_numerical': 0.024134312696747113, 'mean_word_length': 2.1058631921824102, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6919573', 'n_tokens_mistral': 607, 'n_tokens_neox': 578, 'n_words': 168}