<commit_before>from itertools import combinations

from cement.core import controller, handler

from chewdoku.models import Game, SolutionFound, NoCandidates

class Solver(controller.CementBaseController):
    class Meta:
        label='base'
        arguments = [
            (['--input', '-i'], {
                'action': 'store',
                'help': 'File to read puzzle data from',
            }),
            (['--difficulty', '-d'], {
                'action': 'store',
                'type': int,
                'default': 0,
                'help': 'Use techniques up to certain difficulty level.',
            }),
        ]

    def load_puzzle(self):
        initial_state = ''
        with open(self.app.pargs.input, 'r') as input:
            initial_state = input.readline()
        game = Game()
        for square, value in enumerate(initial_state):<commit_msg>Add option to read specific line from puzzle file<commit_after>from itertools import combinations

from cement.core import controller, handler

from chewdoku.models import Game, SolutionFound, NoCandidates

class Solver(controller.CementBaseController):
    class Meta:
        label='base'
        arguments = [
            (['--input', '-i'], {
                'action': 'store',
                'help': 'File to read puzzle data from',
            }),
            (['--line', '-l'], {
                'action': 'store',
                'default': 1,
                'type': int,
                'help': 'Line number to read from file',
            }),
            (['--difficulty', '-d'], {
                'action': 'store',
                'type': int,
                'default': 0,
                'help': 'Use techniques up to certain difficulty level.',
            }),
        ]

    def load_puzzle(self):
        initial_state = ''
        with open(self.app.pargs.input, 'r') as input:
            for line in range(self.app.pargs.line):
                initial_state = input.readline()
        game = Game()
        for square, value in enumerate(initial_state):
{'fraction_non_alphanumeric': 0.12730806608357628, 'fraction_numerical': 0.0014577259475218659, 'mean_word_length': 1.6879895561357703, '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': '2595742', 'n_tokens_mistral': 554, 'n_tokens_neox': 523, 'n_words': 156}